Added default view property to SQLForm. Removed unused viewTemplateId
from SQLForm table. Updated help and international.
This commit is contained in:
parent
2ef113eb02
commit
1991685839
4 changed files with 41 additions and 5 deletions
|
|
@ -999,7 +999,7 @@ CREATE TABLE SQLForm (
|
||||||
assetId varchar(22) NOT NULL default '',
|
assetId varchar(22) NOT NULL default '',
|
||||||
formId varchar(22) default NULL,
|
formId varchar(22) default NULL,
|
||||||
tableName varchar(255) default NULL,
|
tableName varchar(255) default NULL,
|
||||||
viewTemplateId varchar(22) default NULL,
|
defaultView varchar(22) default NULL,
|
||||||
searchTemplateId varchar(22) default NULL,
|
searchTemplateId varchar(22) default NULL,
|
||||||
editTemplateId varchar(22) default NULL,
|
editTemplateId varchar(22) default NULL,
|
||||||
submitGroupId varchar(22) default NULL,
|
submitGroupId varchar(22) default NULL,
|
||||||
|
|
|
||||||
|
|
@ -838,6 +838,10 @@ sub definition {
|
||||||
fieldType => 'databaseLink',
|
fieldType => 'databaseLink',
|
||||||
defaultValue => 0,
|
defaultValue => 0,
|
||||||
},
|
},
|
||||||
|
defaultView => {
|
||||||
|
fieldType => 'selectBox',
|
||||||
|
defaultValue => 'normalSearch',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return $class->SUPER::definition($session, $definition);
|
return $class->SUPER::definition($session, $definition);
|
||||||
|
|
@ -964,6 +968,17 @@ sub getEditForm {
|
||||||
-value => $self->get('searchTemplateId'),
|
-value => $self->get('searchTemplateId'),
|
||||||
-namespace => 'SQLForm/Search',
|
-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(
|
$tabform->getTab('security')->group(
|
||||||
-name => 'submitGroupId',
|
-name => 'submitGroupId',
|
||||||
-label => $i18n->get('gef submit group'),
|
-label => $i18n->get('gef submit group'),
|
||||||
|
|
@ -1282,8 +1297,11 @@ sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($output, @links);
|
my ($output, @links);
|
||||||
|
|
||||||
|
if ($self->get('defaultView') eq 'superSearch') {
|
||||||
return $output .$self->www_search;
|
return $output .$self->www_superSearch;
|
||||||
|
}else{
|
||||||
|
return $output .$self->www_search;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -3382,7 +3400,6 @@ sub _constructSearchForm {
|
||||||
2 => $i18n->get('_csf normal and trash')
|
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';
|
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 .= '<td>'.WebGUI::Form::submit($self->session, {value => $i18n->get('s search button')}).'</td>';
|
||||||
$form .= '</table>';
|
$form .= '</table>';
|
||||||
$form .= WebGUI::Form::formFooter($self->session);
|
$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>';
|
$form .= '<script type="text/javascript">'.$js.'</script>';
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
|
@ -3838,6 +3856,8 @@ my $sth = $dbLink->db->unconditionalRead($sql);
|
||||||
$var->{showMetaData} = $self->get('showMetaData');
|
$var->{showMetaData} = $self->get('showMetaData');
|
||||||
$var->{managementLinks} = $self->_getManagementLinks;
|
$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')));
|
return $self->processStyle($self->processTemplate($var, $self->getValue('searchTemplateId')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@ our $HELP = {
|
||||||
namespace => 'Asset_SQLForm',
|
namespace => 'Asset_SQLForm',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title => 'gef default view',
|
||||||
|
description => 'gef default view description',
|
||||||
|
namespace => 'Asset_SQLForm',
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title => 'gef submit group',
|
title => 'gef submit group',
|
||||||
description => 'gef submit group description',
|
description => 'gef submit group description',
|
||||||
|
|
|
||||||
|
|
@ -829,7 +829,7 @@ not possible ta add fields. Please add at least one field type by going to|,
|
||||||
'gef table name description' => {
|
'gef table name description' => {
|
||||||
message => q|<p>This is the name the table you want to attach
|
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
|
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,
|
lastUpdated => 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -908,6 +908,16 @@ search results.</p>|,
|
||||||
lastUpdated => 0,
|
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' => {
|
'gef submit group' => {
|
||||||
message => q|Group to submit records|,
|
message => q|Group to submit records|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue