From 335c8e515994907e768899d2b4d73c0215cc96e1 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 17 Dec 2012 02:59:04 +0000 Subject: [PATCH] * finish task #938. --- module/search/view/buildform.html.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index c25daaec5a..ba475ca81a 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -46,6 +46,19 @@ function setField(fieldName, fieldNO) { $("#value" + fieldNO).datePicker({createButton:true, startDate:startDate}) $("#value" + fieldNO).addClass('date'); // Shortcut the width of the datepicker to make sure align with others. + var groupItems = search->groupItems?>; + var maxNO = 2 * groupItems; + var nextNO = fieldNO > groupItems ? fieldNO - groupItems + 1 : fieldNO + groupItems; + var nextValue = $('#value' + nextNO).val(); + if(nextNO <= maxNO && fieldNO < maxNO && (nextValue == '' || nextValue == 0)) + { + $('#field' + nextNO).val($('#field' + fieldNO).val()); + $('#operator' + nextNO).val('<='); + $('#valueBox' + nextNO).html($('#box' + fieldName).children().clone()); + $('#valueBox' + nextNO).children().attr({name : 'value' + nextNO, id : 'value' + nextNO}); + $("#value" + nextNO).datePicker({createButton:true, startDate:startDate}); + $("#value" + nextNO).addClass('date'); + } } }