Added default view property to SQLForm. Removed unused viewTemplateId

from SQLForm table. Updated help and international.
This commit is contained in:
Yung Han Khoe 2006-04-26 12:56:18 +00:00
parent 2ef113eb02
commit 1991685839
4 changed files with 41 additions and 5 deletions

View file

@ -838,6 +838,10 @@ sub definition {
fieldType => 'databaseLink',
defaultValue => 0,
},
defaultView => {
fieldType => 'selectBox',
defaultValue => 'normalSearch',
},
}
});
return $class->SUPER::definition($session, $definition);
@ -964,6 +968,17 @@ sub getEditForm {
-value => $self->get('searchTemplateId'),
-namespace => 'SQLForm/Search',
);
$tabform->getTab('display')->selectBox(
-name => 'defaultView',
-label => $i18n->get('gef default view'),
-hoverHelp => $i18n->get('gef default view description'),
-value => [$self->get('defaultView')],
-options => {
'normalSearch' => $i18n->get('s normal search'),
'superSearch' => $i18n->get('s advanced search')
},
-multiple => 0,
);
$tabform->getTab('security')->group(
-name => 'submitGroupId',
-label => $i18n->get('gef submit group'),
@ -1282,8 +1297,11 @@ sub view {
my $self = shift;
my ($output, @links);
return $output .$self->www_search;
if ($self->get('defaultView') eq 'superSearch') {
return $output .$self->www_superSearch;
}else{
return $output .$self->www_search;
}
}
#-------------------------------------------------------------------
@ -3382,7 +3400,6 @@ sub _constructSearchForm {
2 => $i18n->get('_csf normal and trash')
);
$self->session->style->setScript($self->session->config->get("extrasURL").'/'.'wobject/SQLForm/SQLFormSearch.js', {type => 'text/javascript'});
my $searchType = $self->session->form->process("searchType") || $self->session->scratch->get('SQLForm_'.$self->getId.'searchType') || 'or';
@ -3486,6 +3503,7 @@ my $cmd = "WebGUI::Form::$searchElement".'($self->session, $parameters)';
$form .= '<td>'.WebGUI::Form::submit($self->session, {value => $i18n->get('s search button')}).'</td>';
$form .= '</table>';
$form .= WebGUI::Form::formFooter($self->session);
$form .= '<script src="'.$self->session->config->get("extrasURL").'/wobject/SQLForm/SQLFormSearch.js" type="text/javascript"></script>';
$form .= '<script type="text/javascript">'.$js.'</script>';
return $form;
@ -3838,6 +3856,8 @@ my $sth = $dbLink->db->unconditionalRead($sql);
$var->{showMetaData} = $self->get('showMetaData');
$var->{managementLinks} = $self->_getManagementLinks;
# Only process style if search is called directly;
return $self->processTemplate($var, $self->getValue('searchTemplateId')) unless ($self->session->form->process("func") eq 'superSearch');
return $self->processStyle($self->processTemplate($var, $self->getValue('searchTemplateId')));
}

View file

@ -53,6 +53,12 @@ our $HELP = {
namespace => 'Asset_SQLForm',
},
{
title => 'gef default view',
description => 'gef default view description',
namespace => 'Asset_SQLForm',
},
{
title => 'gef submit group',
description => 'gef submit group description',

View file

@ -829,7 +829,7 @@ not possible ta add fields. Please add at least one field type by going to|,
'gef table name description' => {
message => q|<p>This is the name the table you want to attach
should get in the database, or if you want to attach the SQLForm to an existing
table, the nam of that table.</p>|,
table, the name of that table.</p>|,
lastUpdated => 0,
},
@ -908,6 +908,16 @@ search results.</p>|,
lastUpdated => 0,
},
'gef default view' => {
message => q|Default view|,
lastUpdated => 0,
},
'gef default view description' => {
message => q|<p>This property switches the default view between normal and advanced search.</p>|,
lastUpdated => 0,
},
'gef submit group' => {
message => q|Group to submit records|,
lastUpdated => 0,