[greenstone-users] Form Searching

From Katherine Don
DateSat Nov 7 14:53:29 2009
Subject [greenstone-users] Form Searching
In-Reply-To (4AE97189-D309-0083-0-nelligan-ca)
Hi Devon

If you want to do this for all collections, then you can edit the main
macro files.

Open up macros/query.dm and look for the initfqf and clearfqf functions.

Comment out the bits indicated below - by adding // in front of each line.

// fqf - the field selection box
function initfqf() \{
var i;
fqf = argfqf.split(",");
num_opts = document.QueryForm.fqf[0].options.length; // assumes all
have the same options
for (i=0; i<fqf.length && i<document.QueryForm.fqf.length; i++) \{
if (fqf[i] != "")\{
for (j=0;j<num_opts;j++) \{
if (fqf[i]== document.QueryForm.fqf[i].options[j].value) \{
document.QueryForm.fqf[i].options[j].selected = true;
[comment out all from here ...]
//if (fqf.length < document.QueryForm.fqf.length) \{ // initialize
remaining ones
// for (i=fqf.length;i<document.QueryForm.fqf.length;i++) \{
// var z=i;
// while (z >= num_opts) \{
// z = z-(num_opts);
// \}
// document.QueryForm.fqf[i].options[z].selected = true;

// \}
[to here]


function clearfqf() \{
var i;
for (i=0;i<document.QueryForm.fqf.length;i++) \{
[comment from here...]
//var z = i;
///if (i >= document.QueryForm.fqf[i].options.length) z =
//document.QueryForm.fqf[i].options[z].selected = true;
[ to here, then add the following line]
document.QueryForm.fqf[i].options[0].selected = true;

(Don't copy the [..] bits, they are just the instructions.)
Then it should all work as requested :-)

If you only want to do this for one collection, then I think it should
work if you copy the entire _formfunctions_ macro into the collections
extra.dm, (collect/collname/macros/extra.dm) preceded by
package query
on its own line. Then make the changes in extra.dm.

Devon Cinnamon wrote:
> Hi, I was wondering if it is possible to show the same search fields
> in form view for all four forms fields available. I would like to set
> the default search field to Title and not have it alternate between
> all my search fields.
> Thank you
> Devon
> Confidentiality Note
> This message is intended only for the use of the individual or entity
> to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable
> law. If the reader of this message is not the intended recipient, or
> the employee or agent responsible for delivering the message to the
> intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited.
> If you have received this communication in error, please notify us
> immediately. Thank you.
> AVIS - Courriel confidentiel Ce courriel est transmis au destinataire
> pour ses propres fins. Il pourrait contenir des renseignements
> confidentiels ou soumis au secret professionnel de l'avocat. Si vous
> n'□tes pas le v□ritable destinataire, ou son/sa mandataire, il est
> strictement interdit de diffuser ce courriel, les renseignements qu'il
> contient ou les documents qui lui sont joints. Si vous avez re□u ce
> courriel par erreur, veuillez en aviser l'exp□diteur imm□diatement et
> veuillez le supprimer sans le lire, l'imprimer, le sauvegarder ou le
> diffuser. Merci de votre aimable collaboration.
> ------------------------------------------------------------------------
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users