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





Re: [rt-users] How to customize AssetSearchFields

2017-02-16 Thread Dippery, Kyle
Try:

Set($AssetSearchFields, {
'CF.Inventar-Nr'  => '=',
Name=> 'LIKE',
Description => 'LIKE',
});

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


From: rt-users  on behalf of 
tbec...@frankenbach.com 
Sent: Wednesday, February 15, 2017 10:29 AM
To: rt-users
Subject: [rt-users] How to customize AssetSearchFields

Hello All,

I try to customize the Option AssetSearchFields in the RT_SiteConfig.pm.

The standard config ist:

Set($AssetSearchFields, {
id  => '=',
Name=> 'LIKE',
Description => 'LIKE',
});

I want to able to search for a cutom field called "Inventar-Nr". I added this 
field like this

Set($AssetSearchFields, {
Inventar-Nr  => '=',
Name=> 'LIKE',
Description => 'LIKE',
});

But after restart of Apache I aleays get the Asset id found. The field 
Inventar-Nr is not searched.

How can I do this?
Mit freundlichen Grüßen / best regards

Torsten Becker
Leiter EDV

Hauptsitz / Head Office:

Ernst Frankenbach GmbH Spedition
Am Weyer 5
D-55252 Mainz-Kastel
Germany Kontakt / Contact:

Phone: +49 (0) 6134 - 2900 130
Fax: +49 6134 - 2900 122
E-Mail: tbec...@frankenbach.com
Web:www.frankenbach.com



Geschäftsführer / Managing Director: Ernst Christian Frankenbach, Bernhard Karl 
Meineck
Amtsgericht / Commercial Register: Wiesbaden HRB 4060
UST-ID / VAT: DE217320363


[cid:_2_1430213414301ABC004E3C71C1257FDA][cid:_2_1430236414301ABC004E3C71C1257FDA][cid:_2_1430259414301ABC004E3C71C1257FDA][cid:_2_143027C414301ABC004E3C71C1257FDA]

Wir arbeiten ausschließlich auf Grundlage der Allgemeinen Deutschen 
Spediteurbedingungen, jeweils neuester Fassung. Diese beschränken in Ziffer 23 
ADSp die gesetzliche Haftung für Güterschäden nach § 431 HGB für Schäden im 
speditionellen Gewahrsam auf 5,-- Euro/kg, bei multimodalen Transporten unter 
Einschluss einer Seebeförderung auf 2 SZR/kg sowie ferner je Schadenfall bzw. 
-ereignis auf 1 Mio. bzw. 2 Mio. Euro oder 2 SZR/kg, je nachdem, welcher Betrag 
höher ist. Ergänzend wird vereinbart, dass (1) Ziffer 27 ADSp weder die Haftung 
des Spediteurs noch die Zurechnung des Verschuldens von Leuten und sonstigen 
Dritten abweichend von gesetzlichen Vorschriften wie § 507 HGB, Art. 25 MÜ, 
Art. 36 CIM, Art. 20, 21 CMNI zu Gunsten des Auftraggebers erweitert, (2) der 
Spediteur als Verfrachter in den in § 512 Abs. 2 Nr. 1 HGB aufgeführten Fällen 
des nautischen Verschulden oder Feuer an Bord nur für eigenes Verschulden 
haftet und (3) der Spediteur als Frachtführer im Sinne der CMNI unter den in 
Art. 25 Abs. 2 CMNI genannten Voraussetzungen nicht für nautisches Verschulden, 
Feuer an Bord oder Mängel des Schiffes haftet.

We operate exclusively in accordance with the latest version of the Allgemeinen 
Deutschen Spediteurbedingungen - ADSp - (German Freight Forwarders' 
GeneralTerms and Conditions). These limit in clause 23 ADSp the legal liability 
for damage to goods in case of damage to goods whilst in the care of a 
forwarder to € 5/kg, in ac-cordance with Art. 431 of the German Commercial Code 
(HGB); in case of multimod-al transports including sea transport to 2 SDR/kg. 
In addition the liability is limited to € 1 Million per damage respectively to 
€ 2 Million per event or 2 SDR/kg whichever is the greater. The parties agree 
subsidiary, that (1) clause 27 ADSp does neither ex-tend the liability nor the 
responsibility of the forwarder for agents, servants, employ-ees or crewmembers 
beyond legal regulations as Art. 507 HGB, Art. 25 MC, Art. 36 CIM, Art. 20, 21 
CMNI for the benefit of the principal, (2) the freight forwarder as a sea 
carrier is only liable for fault of his own part in case of risks provided in 
Art. 512 paragraph 2 no. 1 HGB such as default in navigation of the ship or 
fire on board and (3) the freight forwarder as a carrier defined in CMNI is 
relieved of liability in compli-ance with the requirements provided in Art. 25 
paragraph 2 CMNI such as default in navigation of the ship, fire on board or 
defects of vessel.



Re: [rt-users] Fwd: Using getting stuck when choosing new Custom Lifecycle

2017-02-14 Thread Dippery, Kyle
In my own custom lifecycle, I have one hyphenated status ("in-use").  I don't 
remember why (perhaps this is the reason), but I have it in quotation marks as 
a key in our transitions array:

 transitions => {
   ...
   "in-use"  => [qw(allocated recycled stolen lost deleted surplussed 
destroyed-for-parts scattered-across-the-desert)],
}

Your hyphenated ones aren't quoted in your array.  Perhaps that's the sticking 
point?  Perl might be trying to do math with the "-" before assigning to it.

--
Kyle Dippery
Engineering Computing Services
219 RMB
859-257-1346


From: rt-users  on behalf of Ben 
Pintilie 
Sent: Tuesday, February 14, 2017 8:29 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Fwd: Using getting stuck when choosing new Custom   
Lifecycle

Hi All,

Im having a strange issue, I know I have missed a step, but cant see where.  I 
have added in three new statuses, (aw-int aw-ext aw-qa) each new status meaning 
"awaiting-xxx"  I have carried out the update to RT_SiteConfig.pm as usual.  I 
have restarted RT and I can see the new statuses.  If any user or admin selects 
a status, it saves and reports correctly.  The issue is that we can not then 
change the status from any of the new statuses to an original status.  i.e. 
from aw-ext TO stalled.

The new statuses have been added like this:


Set(%Lifecycles,
 default => {
initial   => [ 'new' ],
active  => [ 'open', 'aw-ext', 'aw-int', 'aw-qa', 'stalled' ],


<- AND HERE ->



 # from   => [ to list ],
new  => [qw(open aw-ext aw-int aw-qa stalled resolved rejected 
deleted)],
open => [qw(new aw-ext aw-int aw-qa stalled resolved rejected 
deleted)],
stalled  => [qw(new open aw-ext aw-int aw-qa rejected resolved 
deleted)],
resolved => [qw(new open aw-ext aw-int aw-qa stalled rejected 
deleted)],
rejected => [qw(new open aw-ext aw-int aw-qa stalled resolved 
deleted)],
deleted  => [qw(new open aw-ext aw-int aw-qa stalled rejected 
resolved)],
aw-ext   => [qw(new open aw-int aw-qa stalled rejected resolved)],
aw-int   => [qw(new open aw-ext aw-qa stalled rejected resolved)],
aw-qa=> [qw(new open aw-ext aw-int stalled rejected resolved)],



<-AND HERE->



 actions => [
'new -> open'  => { label => 'Open It',  update => 'Respond' },
'new -> resolved'  => { label => 'Resolve',  update => 'Comment' },
'new -> rejected'  => { label => 'Reject',   update => 'Respond' },
'new -> deleted'   => { label => 'Delete'},

'open -> stalled'  => { label => 'Stall',update => 'Comment' },
'open -> resolved' => { label => 'Resolve',  update => 'Comment' },
'open -> rejected' => { label => 'Reject',   update => 'Respond' },
'open -> aw-ext'   => { label => 'AW-ext',   update => 'Comment' },
'open -> aw-int'   => { label => 'AW-int',   update => 'Comment' },
'open -> aw-qa'=> { label => 'AW-qa',update => 'Comment' },

'aw-ext -> stalled'  => { label => 'Stall',update => 'Comment' 
},
'aw-ext -> resolved' => { label => 'Resolve',  update => 'Comment' 
},
'aw-ext -> rejected' => { label => 'Reject',   update => 'Respond' 
},
'aw-ext -> aw-int'   => { label => 'AW-int',   update => 'Comment' 
},
'aw-ext -> aw-qa'=> { label => 'AW-qa',update => 'Comment' 
},

'aw-int -> stalled'  => { label => 'Stall',update => 'Comment' 
},
'aw-int -> resolved' => { label => 'Resolve',  update => 'Comment' 
},
'aw-int -> rejected' => { label => 'Reject',   update => 'Respond' 
},
'aw-int -> aw-ext'   => { label => 'AW-ext',   update => 'Comment' },
'aw-int -> aw-qa'=> { label => 'AW-qa',update => 'Comment' 
},

'aw-qa -> stalled'  => { label => 'Stall',update => 'Comment' },
'aw-qa -> resolved' => { label => 'Resolve',  update => 'Comment' },
'aw-qa -> rejected' => { label => 'Reject',   update => 'Respond' },
'aw-qa -> aw-ext'   => { label => 'AW-ext',   update => 'Comment' },
'aw-qa -> aw-int'   => { label => 'AW-int',   update => 'Comment' },

'stalled -> open'  => { label => 'Open It'   },
'resolved -> open' => { label => 'Re-open',  update => 'Comment' },
'rejected -> open' => { label => 'Re-open',  update => 'Comment' },
'deleted -> open'  => { label => 'Undelete'  },



I have *NOT* Changed the approvals lifecycle

Can anyone point me to what I have missed, I know its human error, I just cant 
see where!

Thanks
Ben


T: 01253 394911

W: blackpoolsixth.ac.uk

Blackpool Sixth, Blackpool Old Road, Blackpool, FY3

Re: [rt-users] Assets RT 4.4.0

2017-01-26 Thread Dippery, Kyle

Maybe use a custom field for Company?  Or create Company-specific catalogs?



From: rt-users  on behalf of Dunbar, 
Brian 
Sent: Thursday, January 26, 2017 2:59 PM
To: rt-users
Subject: [rt-users] Assets RT 4.4.0

Hello List,

I was asked to start using RT for Assets. I created a new catalog.

I put in my computer for test with serial number and details

When I set the owner. I could not set the Company it would only let me pick a 
domain account

So as an example my account is smithjohn and my email is 
john.sm...@company.com
When I add the record it picks by account name smithjohn
When I want to search by owner after I pick smithjohn and it reformats it to 
the email address and does not find my asset.
I can search on other fields but I would like to search by owner.



Any ideas?

Thanks