|;
$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"),
diff --git a/lib/WebGUI/i18n/English/Asset_Shortcut.pm b/lib/WebGUI/i18n/English/Asset_Shortcut.pm
index f45a3d311..bc489f1c4 100644
--- a/lib/WebGUI/i18n/English/Asset_Shortcut.pm
+++ b/lib/WebGUI/i18n/English/Asset_Shortcut.pm
@@ -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".
-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.
+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,
},
diff --git a/www/extras/wobject/Shortcut/querybuilder.js b/www/extras/wobject/Shortcut/querybuilder.js
index 92111d715..ada94e8a7 100644
--- a/www/extras/wobject/Shortcut/querybuilder.js
+++ b/www/extras/wobject/Shortcut/querybuilder.js
@@ -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 + '"';