4 |
package Arh::Model::Unit; |
package Arh::Model::Unit; |
5 |
use Jifty::DBI::Schema; |
use Jifty::DBI::Schema; |
6 |
|
|
7 |
|
use Data::Dump qw/dump/; |
8 |
|
|
9 |
use Arh::Record schema { |
use Arh::Record schema { |
10 |
|
|
11 |
column name => |
column name => |
13 |
label is _("Name"), |
label is _("Name"), |
14 |
is mandatory; |
is mandatory; |
15 |
|
|
16 |
column number => |
column inv_id => |
17 |
type is 'text', |
type is 'text', |
18 |
label is _("Number"), |
label is _("Number"), |
19 |
is mandatory; |
is mandatory; |
26 |
|
|
27 |
column dimensions => |
column dimensions => |
28 |
label is _("Dimensions"), |
label is _("Dimensions"), |
29 |
hit is _("Separate values with ; (semicolumn)"), |
hint is _("Separate values with ; (semicolumn)"), |
30 |
type is 'text'; |
type is 'text'; |
31 |
|
|
32 |
column position => |
column discovered_at => |
33 |
label is _("Place of discovery"), |
label is _("Place of discovery"), |
34 |
type is 'text'; |
type is 'text'; |
35 |
|
|
59 |
return $m; |
return $m; |
60 |
} |
} |
61 |
|
|
62 |
sub current_user_can { |
use Arh::DefaultACL; |
|
my ( $self, $action,$item,$name ) = @_; |
|
|
return 1 if $self->current_user->superuser || $self->current_user->administrator; |
|
|
return 1 if $self->current_user->id && $action eq 'read'; |
|
|
return 0; |
|
|
} |
|
63 |
|
|
64 |
1; |
1; |
65 |
|
|