[freeside-commits] freeside/FS/FS Schema.pm, 1.215, 1.216 inventory_item.pm, 1.4, 1.5 AccessRight.pm, 1.50, 1.51
Ivan,,,
ivan at wavetail.420.am
Thu May 20 15:48:44 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv27688/FS/FS
Modified Files:
Schema.pm inventory_item.pm AccessRight.pm
Log Message:
agent virt inventory, RT#7010
Index: inventory_item.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/inventory_item.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- inventory_item.pm 9 Dec 2008 01:46:52 -0000 1.4
+++ inventory_item.pm 20 May 2010 22:48:42 -0000 1.5
@@ -106,6 +106,9 @@
my $error =
$self->ut_numbern('itemnum')
|| $self->ut_foreign_key('classnum', 'inventory_class', 'classnum' )
+ #|| $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' )
+ || $self->ut_agentnum_acl('agentnum', ['Configuration',
+ 'Edit global inventory'] )
|| $self->ut_text('item')
|| $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum' )
;
@@ -127,6 +130,17 @@
qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
}
+=item agent
+
+Returns the associated agent for this event, if any, as an FS::agent object.
+
+=cut
+
+sub agent {
+ my $self = shift;
+ qsearchs('agent', { 'agentnum' => $self->agentnum } );
+}
+
=back
=head1 SUBROUTINES
@@ -142,7 +156,7 @@
my $opt = { 'table' => 'inventory_item',
#'params' => [ 'itembatch', 'classnum', ],
- 'params' => [ 'classnum', ],
+ 'params' => [ 'classnum', 'agentnum', ],
'formats' => { 'default' => [ 'item' ] },
'default_csv' => 1,
};
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -w -d -r1.215 -r1.216
--- Schema.pm 30 Apr 2010 02:32:38 -0000 1.215
+++ Schema.pm 20 May 2010 22:48:41 -0000 1.216
@@ -2593,12 +2593,13 @@
'columns' => [
'itemnum', 'serial', '', '', '', '',
'classnum', 'int', '', '', '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
'item', 'varchar', '', $char_d, '', '',
'svcnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'itemnum',
'unique' => [ [ 'classnum', 'item' ] ],
- 'index' => [ [ 'classnum' ], [ 'svcnum' ] ],
+ 'index' => [ [ 'classnum' ], [ 'agentnum' ], [ 'svcnum' ] ],
},
'inventory_class' => {
Index: AccessRight.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/AccessRight.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -w -d -r1.50 -r1.51
--- AccessRight.pm 18 May 2010 03:25:31 -0000 1.50
+++ AccessRight.pm 20 May 2010 22:48:42 -0000 1.51
@@ -285,6 +285,9 @@
'Edit billing events',
{ rightname=>'Edit global billing events', global=>1 },
+ 'Edit inventory',
+ { rightname=>'Edit global inventory', global=>1 },
+
{ rightname=>'Dialup configuration' },
{ rightname=>'Dialup global configuration', global=>1 },
More information about the freeside-commits
mailing list