diff --git a/docs/upgrades/upgrade_6.8.8-6.99.0.pl b/docs/upgrades/upgrade_6.8.8-6.99.0.pl index 4e4c1ba25..cca18d2a6 100644 --- a/docs/upgrades/upgrade_6.8.8-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.8-6.99.0.pl @@ -999,7 +999,7 @@ CREATE TABLE SQLForm ( assetId varchar(22) NOT NULL default '', formId varchar(22) default NULL, tableName varchar(255) default NULL, - viewTemplateId varchar(22) default NULL, + defaultView varchar(22) default NULL, searchTemplateId varchar(22) default NULL, editTemplateId varchar(22) default NULL, submitGroupId varchar(22) default NULL, diff --git a/lib/WebGUI/Asset/Wobject/SQLForm.pm b/lib/WebGUI/Asset/Wobject/SQLForm.pm index 0740dd6f1..828592bcf 100644 --- a/lib/WebGUI/Asset/Wobject/SQLForm.pm +++ b/lib/WebGUI/Asset/Wobject/SQLForm.pm @@ -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 .= '
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.
|, +table, the name of that table.|, lastUpdated => 0, }, @@ -908,6 +908,16 @@ search results.|, lastUpdated => 0, }, + 'gef default view' => { + message => q|Default view|, + lastUpdated => 0, + }, + + 'gef default view description' => { + message => q|This property switches the default view between normal and advanced search.
|, + lastUpdated => 0, + }, + 'gef submit group' => { message => q|Group to submit records|, lastUpdated => 0,