Fix shortcut hoverhelp, javascript, and criteria builder usability. Fixes bug #11516
This commit is contained in:
parent
33c54b66b6
commit
982e5117f1
4 changed files with 36 additions and 20 deletions
|
|
@ -18,6 +18,7 @@
|
|||
- fixed #11513: white text, broken account mgmt
|
||||
- fixed #11514: Added JS-type cancel button to edit view of WebGUI::Asset::Post (Bernd Kalbfuß-Zimmermann)
|
||||
- fixed #11469: Survey Ruler
|
||||
- fixed #11516: Shortcut Asset: Properties panel messed up in edit view
|
||||
|
||||
7.9.1
|
||||
- fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ sub _drawQueryBuilder {
|
|||
"AND" => $i18n->get("AND"),
|
||||
"OR" => $i18n->get("OR")},
|
||||
value=>["OR"],
|
||||
extras=>'class="qbselect"',
|
||||
extras=>'class="qbselect" '. $self->{_disabled},
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ sub _drawQueryBuilder {
|
|||
name=>$opFieldName,
|
||||
uiLevel=>5,
|
||||
options=>$operator{$fieldType},
|
||||
extras=>'class="qbselect"'
|
||||
extras=>'class="qbselect" '. $self->{_disabled},
|
||||
});
|
||||
# The value select field
|
||||
my $valFieldName = "val_field".$i;
|
||||
|
|
@ -96,13 +96,14 @@ sub _drawQueryBuilder {
|
|||
fieldType=>$fieldType,
|
||||
name=>$valFieldName,
|
||||
uiLevel=>5,
|
||||
extras=>qq/title="$fields->{$field}{description}" class="qbselect"/,
|
||||
extras=>qq/title="$fields->{$field}{description}" class="qbselect" /. $self->{_disabled},
|
||||
options=>$options,
|
||||
);
|
||||
# An empty row
|
||||
$output .= qq|<tr><td></td><td></td><td></td><td></td><td class="qbtdright"></td></tr>|;
|
||||
|
||||
# Table row with field info
|
||||
my $disabled = $self->{_disabled};
|
||||
$output .= qq|
|
||||
<tr>
|
||||
<td class="qbtdleft"><p class="qbfieldLabel">$fieldLabel</p></td>
|
||||
|
|
@ -114,7 +115,11 @@ sub _drawQueryBuilder {
|
|||
</td>
|
||||
<td class="qbtd"></td>
|
||||
<td class="qbtdright">
|
||||
<<<<<<< HEAD:lib/WebGUI/Asset/Shortcut.pm
|
||||
<input class="qbButton" type=button value=Add onclick="addCriteria('$fieldLabel', this.form.$opFieldName, this.form.$valFieldName)"></td>
|
||||
=======
|
||||
<input class="qbButton" type=button value=$addLabel onclick="addCriteria('$fieldLabel', this.form.$opFieldName, this.form.$valFieldName)" $disabled></td>
|
||||
>>>>>>> f32f209... Fix shortcut hoverhelp, javascript, and criteria builder usability. Fixes bug #11516:lib/WebGUI/Asset/Shortcut.pm
|
||||
</tr>
|
||||
|;
|
||||
$i++;
|
||||
|
|
@ -310,19 +315,12 @@ sub getEditForm {
|
|||
);
|
||||
if($self->session->setting->get("metaDataEnabled")) {
|
||||
$tabform->getTab("properties")->yesNo(
|
||||
-name=>"shortcutByCriteria",
|
||||
-value=>$self->getValue("shortcutByCriteria"),
|
||||
-label=>$i18n->get("Shortcut by alternate criteria"),
|
||||
-hoverHelp=>$i18n->get("Shortcut by alternate criteria description"),
|
||||
-extras=>q|onchange="
|
||||
if (this.form.shortcutByCriteria[0].checked) {
|
||||
this.form.resolveMultiples.disabled=false;
|
||||
this.form.shortcutCriteria.disabled=false;
|
||||
} else {
|
||||
this.form.resolveMultiples.disabled=true;
|
||||
this.form.shortcutCriteria.disabled=true;
|
||||
}"|
|
||||
);
|
||||
-name => "shortcutByCriteria",
|
||||
-value => $self->getValue("shortcutByCriteria"),
|
||||
-label => $i18n->get("Shortcut by alternate criteria"),
|
||||
-hoverHelp=> $i18n->get("Shortcut by alternate criteria description"),
|
||||
-extras => q|onchange="wgCriteriaDisable(this.form, this.form.shortcutByCriteria[0].checked)"|,
|
||||
);
|
||||
$tabform->getTab("properties")->yesNo(
|
||||
-name=>"disableContentLock",
|
||||
-value=>$self->getValue("disableContentLock"),
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ Most Recent will select the most recent asset that matches the shortcut criteria
|
|||
},
|
||||
|
||||
'Criteria description' => {
|
||||
message => q|A statement to determine what to mirror, in the form of "color = blue and weight != heavy". Multiple expressions may be joined with "and" and "or". <br />
|
||||
A property or value must be quoted if it contains spaces. Feel free to use the criteria builder to build your statements.|,
|
||||
lastUpdated => 1167190118,
|
||||
message => q|A statement to determine what to mirror, in the form of "color = blue and weight != heavy". Multiple expressions may be joined with "and" and "or". A property or value must be quoted if it contains spaces.<br />
|
||||
The statement may be entered by hand, or it can be built graphically using the Criteria builder. For each criteria that you want to enter, select the value for the metadata field and the operator. Then, use the conjunction field to choose how it works with the other criteria, and hit the Add button for the field you want to add.|,
|
||||
lastUpdated => 1270581368,
|
||||
},
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,29 @@
|
|||
function wgCriteriaDisable ( form, toDisable ) {
|
||||
var new_state = toDisable ? false : true;
|
||||
var elements = YAHOO.util.Dom.getElementsByClassName('qbselect');
|
||||
var buttons = YAHOO.util.Dom.getElementsByClassName('qbButton');
|
||||
form.resolveMultiples.disabled = new_state;
|
||||
form.shortcutCriteria.disabled = new_state;
|
||||
for(idx=0; idx < elements.length; idx++) {
|
||||
elements[idx].disabled = new_state;
|
||||
}
|
||||
for(idx=0; idx < buttons.length; idx++) {
|
||||
buttons[idx].disabled = new_state;
|
||||
}
|
||||
}
|
||||
|
||||
function addCriteria ( fieldname, opform, valform ) {
|
||||
var form = opform.form;
|
||||
var operator = getValue(opform);
|
||||
var value = getValue(valform);
|
||||
var criteria = form.shortcutCriteria.value;
|
||||
var conjunction = "";
|
||||
if (form.shortcutCriteria.disabled == true) {
|
||||
return;
|
||||
}
|
||||
if(! /^\s*$/.test(criteria)) {
|
||||
conjunction = " " + getValue(form.conjunction) + " ";
|
||||
}
|
||||
}
|
||||
//handle quotes
|
||||
if(/\s+/.test(fieldname)) {
|
||||
fieldname = '"' + fieldname + '"';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue