Add missing POD. Refactor to use the definition to draw the edit form.
This commit is contained in:
parent
e6d47212cc
commit
f5fdc49f43
1 changed files with 96 additions and 94 deletions
|
|
@ -52,95 +52,67 @@ sub _fetchDepartments {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub definition {
|
sub definition {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $definition = shift;
|
my $definition = shift;
|
||||||
my $i18n = WebGUI::International->new($session,"Asset_InOutBoard");
|
my $i18n = WebGUI::International->new($session,"Asset_InOutBoard");
|
||||||
push(@{$definition}, {
|
push(@{$definition}, {
|
||||||
tableName=>'InOutBoard',
|
tableName => 'InOutBoard',
|
||||||
className=>'WebGUI::Asset::Wobject::InOutBoard',
|
className => 'WebGUI::Asset::Wobject::InOutBoard',
|
||||||
assetName=>$i18n->get('assetName'),
|
assetName => $i18n->get('assetName'),
|
||||||
icon=>'iob.gif',
|
icon => 'iob.gif',
|
||||||
properties=>{
|
autoGenerateForms => 1,
|
||||||
statusList => {
|
properties => {
|
||||||
defaultValue => $i18n->get(10)."\n"
|
statusList => {
|
||||||
.$i18n->get(11)."\n",
|
tab => 'properties',
|
||||||
fieldType=>"textarea"
|
defaultValue => $i18n->get(10)."\n".$i18n->get(11)."\n",
|
||||||
},
|
fieldType => "textarea",
|
||||||
reportViewerGroup => {
|
label => $i18n->get(1),
|
||||||
defaultValue => 3,
|
hoverHelp => $i18n->get('1 description'),
|
||||||
fieldType => "group"
|
subtext => $i18n->get(2),
|
||||||
},
|
},
|
||||||
inOutGroup => {
|
reportViewerGroup => {
|
||||||
defaultValue => 2,
|
tab => 'security',
|
||||||
fieldType => "group"
|
defaultValue => 3,
|
||||||
},
|
fieldType => "group",
|
||||||
inOutTemplateId => {
|
label => $i18n->get(3),
|
||||||
fieldType=>"template",
|
hoverHelp => $i18n->get("3 description"),
|
||||||
defaultValue => 'IOB0000000000000000001'
|
},
|
||||||
},
|
inOutGroup => {
|
||||||
reportTemplateId => {
|
tab => 'security',
|
||||||
fieldType=>"template",
|
defaultValue => 2,
|
||||||
defaultValue => 'IOB0000000000000000002'
|
fieldType => "group",
|
||||||
},
|
label => $i18n->get('inOutGroup'),
|
||||||
paginateAfter => {
|
hoverHelp => $i18n->get('inOutGroup description'),
|
||||||
fieldType=>"integer",
|
},
|
||||||
defaultValue => 50
|
inOutTemplateId => {
|
||||||
},
|
tab => 'display',
|
||||||
}
|
fieldType => "template",
|
||||||
});
|
namespace => "InOutBoard",
|
||||||
return $class->SUPER::definition($session, $definition);
|
label => $i18n->get("In Out Template"),
|
||||||
|
hoverHelp => $i18n->get("In Out Template description"),
|
||||||
|
defaultValue => 'IOB0000000000000000001',
|
||||||
|
},
|
||||||
|
reportTemplateId => {
|
||||||
|
tab => 'display',
|
||||||
|
fieldType => "template",
|
||||||
|
defaultValue => 'IOB0000000000000000002',
|
||||||
|
label => $i18n->get(13),
|
||||||
|
hoverHelp => $i18n->get("13 description"),
|
||||||
|
namespace => "InOutBoard/Report"
|
||||||
|
},
|
||||||
|
paginateAfter => {
|
||||||
|
tab => 'display',
|
||||||
|
fieldType => "integer",
|
||||||
|
defaultValue => 50,
|
||||||
|
label => $i18n->get(12),
|
||||||
|
hoverHelp => $i18n->get('12 description'),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return $class->SUPER::definition($session, $definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub getEditForm {
|
|
||||||
my $self = shift;
|
|
||||||
my $tabform = $self->SUPER::getEditForm();
|
|
||||||
my $i18n = WebGUI::International->new($self->session, "Asset_InOutBoard");
|
|
||||||
$tabform->getTab("properties")->textarea(
|
|
||||||
-name=>"statusList",
|
|
||||||
-label=>$i18n->get(1),
|
|
||||||
-hoverHelp=>$i18n->get('1 description'),
|
|
||||||
-value=>$self->getValue("statusList"),
|
|
||||||
-subtext=>$i18n->get(2),
|
|
||||||
);
|
|
||||||
$tabform->getTab("display")->integer(
|
|
||||||
-name=>"paginateAfter",
|
|
||||||
-label=>$i18n->get(12),
|
|
||||||
-hoverHelp=>$i18n->get('12 description'),
|
|
||||||
-value=>$self->getValue("paginateAfter"),
|
|
||||||
);
|
|
||||||
$tabform->getTab("display")->template (
|
|
||||||
-name => "inOutTemplateId",
|
|
||||||
-value => $self->getValue("inOutTemplateId"),
|
|
||||||
-label => $i18n->get("In Out Template"),
|
|
||||||
-hoverHelp => $i18n->get("In Out Template description"),
|
|
||||||
-namespace => "InOutBoard"
|
|
||||||
);
|
|
||||||
$tabform->getTab("display")->template (
|
|
||||||
-name => "reportTemplateId",
|
|
||||||
-value => $self->getValue("reportTemplateId"),
|
|
||||||
-label => $i18n->get(13),
|
|
||||||
-hoverHelp => $i18n->get("13 description"),
|
|
||||||
-namespace => "InOutBoard/Report"
|
|
||||||
);
|
|
||||||
$tabform->getTab("security")->group(
|
|
||||||
-name=>"reportViewerGroup",
|
|
||||||
-value=>[$self->getValue("reportViewerGroup")],
|
|
||||||
-label=>$i18n->get(3),
|
|
||||||
-hoverHelp=>$i18n->get("3 description"),
|
|
||||||
);
|
|
||||||
$tabform->getTab("security")->group(
|
|
||||||
-name=>"inOutGroup",
|
|
||||||
-value=>[$self->getValue("inOutGroup")],
|
|
||||||
-label=>$i18n->get('inOutGroup'),
|
|
||||||
-hoverHelp=>$i18n->get('inOutGroup description'),
|
|
||||||
);
|
|
||||||
return $tabform;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 prepareView ( )
|
=head2 prepareView ( )
|
||||||
|
|
@ -166,6 +138,14 @@ sub prepareView {
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 view
|
||||||
|
|
||||||
|
Render the viewing screen, which displays In/Out status and a form to change
|
||||||
|
status.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub view {
|
sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my %var;
|
my %var;
|
||||||
|
|
@ -296,14 +276,14 @@ order by department, lastName, firstName";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_edit {
|
|
||||||
my $self = shift;
|
|
||||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
|
||||||
return $self->session->privilege->locked() unless $self->canEditIfLocked;
|
|
||||||
return $self->getAdminConsole->render($self->getEditForm->print, $self->addEditLabel);
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
=head2 www_selectDelegates
|
||||||
|
|
||||||
|
Form where a user can select delegates, other users who are allowed to change
|
||||||
|
their status.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_selectDelegates {
|
sub www_selectDelegates {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my %userNames = ();
|
my %userNames = ();
|
||||||
|
|
@ -356,6 +336,13 @@ sub www_selectDelegates {
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_selectDelegatesEditSave
|
||||||
|
|
||||||
|
Process the selectDeletages form.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_selectDelegatesEditSave {
|
sub www_selectDelegatesEditSave {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my @delegates = $self->session->form->selectList("delegates");
|
my @delegates = $self->session->form->selectList("delegates");
|
||||||
|
|
@ -369,6 +356,13 @@ sub www_selectDelegatesEditSave {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_setStatus
|
||||||
|
|
||||||
|
Process the form from the view method to set status for a user.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_setStatus {
|
sub www_setStatus {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
#$self->session->errorHandler->warn("delegateId: ". $self->session->form->process("delegate")."\n" );
|
#$self->session->errorHandler->warn("delegateId: ". $self->session->form->process("delegate")."\n" );
|
||||||
|
|
@ -394,6 +388,14 @@ sub www_setStatus {
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_viewReport
|
||||||
|
|
||||||
|
Builds a templated form for doing drill-down reports, along with displaying results from
|
||||||
|
the report.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_viewReport {
|
sub www_viewReport {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return "" unless ($self->session->user->isInGroup($self->getValue("reportViewerGroup")));
|
return "" unless ($self->session->user->isInGroup($self->getValue("reportViewerGroup")));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue