Re: [rt-users] Assets with 'dynamic' titles

2017-02-21 Thread Dippery, Kyle
Probably?

If you copy Asset.pm from its home to $RT4/local/lib/RT/Asset_Local.pm, you can 
modify the Create subroutine (and then probably delete all the routines that 
you don't override).  I'd aim for someplace around lines 222-231 (of the 
original file):

222 my $catalog = RT::Catalog->new( $self->CurrentUser );
223 $catalog->Load($args{'Catalog'});
224 
225 $args{'Catalog'} = $catalog->id;
226 
227 return (0, $self->loc("Permission Denied"))
228 unless $catalog->CurrentUserHasRight('CreateAsset');
229 
230 return (0, $self->loc('Invalid Name (names may not be all digits)'))
231 unless $self->ValidateName( $args{'Name'} );

If you create a Catalog for "Things that don't have a specific name", you can 
search for its $catalog->id, then generate the name for assets that are in that 
catalog.  Something like:

227 return (0, $self->loc("Permission Denied"))
228 unless $catalog->CurrentUserHasRight('CreateAsset');
229 
230 # This code snippet is not tested.  Please hack at it in a test environment 
before relying on it.
231 # let's make some assumptions
232 # - "Things that don't have a specific name" is Catalog #2
233 # - Type of Thing ('HDD', for example) is Custom Field #12
234 # - Manufacturer is Custom Field #23
235 # - Serial Number is Custom Field #48
236 if ($catalog->id==2) {
237 $args{'Name'} = $args{'CustomField-12'} . ' ' . $args{'CustomField-23'} 
. ' '. $args{'CustomField-48'};
238 }
239
240 return (0, $self->loc('Invalid Name (names may not be all digits)'))
241 unless $self->ValidateName( $args{'Name'} );

(Offhand, I don't know for certain that $catalog->id will be numeric, and not a 
string.  You might need to use a string comparison in the if statement.)

Good luck,
Kyle
--
Kyle Dippery
Engineering Computing Services
219 RMB
859-257-1346


From: rt-users  on behalf of Andrew 
Ruthven 
Sent: Tuesday, February 21, 2017 3:03 PM
To: rt-users
Subject: [rt-users] Assets with 'dynamic' titles

Hey,

I'm wanting to use Assets to track, well, our assets. But I'll be
tracking hard drives and a few other components as well which don't
have a specific name . Is it possible to have the subject dynamically
generated using a combination of Custom Fields and even potentially
relationships?

Ideally I'd have something like:

HDD $manufacturer $serial_number

Where $manufacturer $serial_number both come from Custom Fields.

Cheers,
Andrew

--
Andrew Ruthven, Wellington, New Zealand
and...@etc.gen.nz | linux.conf.au 2017, Hobart, AU
  New Zealand's only Cloud:   |   The Future of Open Source
https://catalyst.net.nz/cloud | http://linux.conf.au





[rt-users] Assets with 'dynamic' titles

2017-02-21 Thread Andrew Ruthven
Hey,

I'm wanting to use Assets to track, well, our assets. But I'll be
tracking hard drives and a few other components as well which don't
have a specific name . Is it possible to have the subject dynamically
generated using a combination of Custom Fields and even potentially
relationships?

Ideally I'd have something like:

HDD $manufacturer $serial_number

Where $manufacturer $serial_number both come from Custom Fields.

Cheers,
Andrew

-- 
Andrew Ruthven, Wellington, New Zealand
and...@etc.gen.nz | linux.conf.au 2017, Hobart, AU
  New Zealand's only Cloud:   |   The Future of Open Source
https://catalyst.net.nz/cloud |     http://linux.conf.au





Re: [rt-users] RT 4 on Amazon EC2

2017-02-21 Thread Andrew Huddleston
I had this issue the other day using Amazon Linux AMI.  Stand alone server 
would run, but httpd would spike to 100+% cpu, no error, no logs, no output.. 
eventually I gave up and used the Centos7 AMI, worked like a dream first time. 
I now run rt4 in aws.

Andrew Huddleston

On 22 Feb 2017, at 6:12 am, François Meehan 
> wrote:

Hi,

I have restored a production instance of RT to an Amazon EC2 t2.small virtual 
machine. It has 2 Gig of RAM.

I can’t get Apache with Mod_FCGI to work but RT will run ok when using the 
stand alone server.


There are no error message to help.

One particularity of EC2 is that is does not have a memory Swap file 
configured. I wonder if this can cause the issue.

Has anyone successful at running RT 4 on EC2?

Thanks in advance,

--

[VuWall]François MEEHAN
IT Administrator
Administrateur TI   T: +1 514-505-4436
Skype: VuWall-Support



IMPORTANT NOTICE: This email, including any attachments, may contain 
privileged, confidential, and/or proprietary information, or may be subject to 
copyright. This email is intended only to be seen and used by the named 
addressee(s). If you are not the intended recipient of this email, you must not 
disclose or use the information contained in this email. If you have received 
this email in error, please notify the sender immediately, and permanently 
delete the original and any copies. We do not guarantee that this email and any 
attachments are free from virus or other errors. We will not be responsible for 
loss or damage resulting (either directly or indirectly) from any such virus or 
error. The content of and opinions expressed in this email are not necessarily 
the opinions held by Hillsong Church. If you believe this message is classified 
as a commercial electronic message in accordance with the Spam Act, you may 
indicate that you do not wish to receive further commercial electronic messages 
from us by sending an email to priv...@hillsong.com . Please consider the 
environmental impact before printing this email.


[rt-users] RT 4 on Amazon EC2

2017-02-21 Thread François Meehan
Hi,

I have restored a production instance of RT to an Amazon EC2 t2.small
virtual machine. It has 2 Gig of RAM.

I can’t get Apache with Mod_FCGI to work but RT will run ok when using the
stand alone server.


There are no error message to help.

One particularity of EC2 is that is does not have a memory Swap file
configured. I wonder if this can cause the issue.

Has anyone successful at running RT 4 on EC2?

Thanks in advance,

-- 

[image: VuWall]  *François MEEHAN*
IT Administrator
Administrateur TI T: +1 514-505-4436
Skype: VuWall-Support