package WebGUI::Asset::Shortcut; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2006 Plain Black Corporation. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use Tie::IxHash; use WebGUI::Asset; use WebGUI::International; use WebGUI::Operation::Profile; use WebGUI::ProfileField; use WebGUI::ProfileCategory; use WebGUI::Macro; our @ISA = qw(WebGUI::Asset); #------------------------------------------------------------------- sub _drawQueryBuilder { my $self = shift; # Initialize operators my @textFields = qw|text yesNo selectList radioList|; my $i18n = WebGUI::International->new($self->session,"Asset_Shortcut"); my %operator; foreach (@textFields) { $operator{$_} = { "=" => $i18n->get("is"), "!=" => $i18n->get("isnt") }; } $operator{integer} = { "=" => $i18n->get("equal to"), "!=" => $i18n->get("not equal to"), "<" => $i18n->get("less than"), ">" => $i18n->get("greater than") }; # Get the fields and count them my $fields = $self->getMetaDataFields(); my $fieldCount = scalar(keys %$fields); unless ($fieldCount) { # No fields found.... return 'No metadata defined yet. Click here to define metadata attributes.'; } # Static form fields my $shortcutCriteriaField = WebGUI::Form::textarea($self->session, { name=>"shortcutCriteria", value=>$self->getValue("shortcutCriteria"), extras=>'style="width: 100%" '.$self->{_disabled} }); my $conjunctionField = WebGUI::Form::selectBox($self->session, { name=>"conjunction", options=>{ "AND" => $i18n->get("AND"), "OR" => $i18n->get("OR")}, value=>["OR"], extras=>'class="qbselect"', } ); # html my $output; $output .= ''; $output .= ''; $output .= qq|
| $shortcutCriteriaField | ||||
| $conjunctionField | ||||
$fieldLabel |
$opField | $valueField | ||
| '.$i18n->get('fieldName').' | '.$i18n->get('edit delete fieldname').' | '.$i18n->get('Original Value').' | '.$i18n->get('New value').' | '.$i18n->get('Replacement value').' |
| '.$prop.' | '; $output .= ''; $output .= $self->session->icon->edit('func=editOverride;fieldName='.$prop,$self->get("url")); $output .= $self->session->icon->delete('func=deleteOverride;fieldName='.$prop,$self->get("url")) if exists $overrides{overrides}{$prop}; $output .= ' | '; $output .= $overrides{overrides}{$prop}{origValue}; $output .= ' | '; $output .= $overrides{overrides}{$prop}{newValue}; $output .= ' | '; $output .= $overrides{overrides}{$prop}{parsedValue}; $output .= ' |