OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



search reviewer by interests

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

search reviewer by interests

Postby MarieNyst » Fri Dec 21, 2012 9:10 am

Hi,

when I'm looking for a reviewer for an article, I would like to search by several review interests. But the search function seems to look for the exact term and don't cut the terms on several words to search.

Problem is :
if I have a reviewer with interests : word 1, word 2, word 3, word 4
I look for : word 2, word 1
this reviewer don't appear...
and if I look for word 1, word 2
this reviewer appear.

Is there any way to do this ?
MarieNyst
 
Posts: 24
Joined: Thu Nov 29, 2012 9:35 pm

Re: search reviewer by interests

Postby MarieNyst » Tue Jan 08, 2013 9:20 am

Well, I looked at source code and find how to fix it.
If ojs developpers see this (or if someone tell me who I have to join to suggest it to be changed on the official version) it's just a little detail :

in file \classes\submission\sectionEditor\SectionEditorSubmissionDAO.inc.php
line 767

replace this :
Code: Select all
$searchSql = "AND LOWER($fieldName) LIKE LOWER(?)";
$paramArray[] = '%' . $search . '%';

by this :
Code: Select all
$searchArray = explode(",",$search);
$n=count($searchArray);
if($n>0)
{
   $searchSql = "AND (LOWER($fieldName) LIKE LOWER(?)";
   $paramArray[] = '%' . $searchArray[0] . '%';
   for($i=1;$i<$n;$i++)
   {
      $searchSql .="OR LOWER($fieldName) LIKE LOWER(?)";
      $paramArray[] = '%' . $searchArray[$i] . '%';
   }
   $searchSql .= ")";
}


it split text on ',' and search all the terms.

with hope this will be usefull for someone else :)
MarieNyst
 
Posts: 24
Joined: Thu Nov 29, 2012 9:35 pm

Re: search reviewer by interests

Postby theodore » Wed Jan 16, 2013 8:01 am

thnx! very useful. Maybe could use the same to getCopyeditorsNotAssignedToArticle function.
theodore
 
Posts: 37
Joined: Wed May 16, 2012 8:52 am

Re: search reviewer by interests

Postby MarieNyst » Fri Jan 25, 2013 9:32 am

I'm happy to know that someone use it :)

there where a little bug on the above code, here is the revised version :

Code: Select all
$searchArray1 = explode(", ",$search);
               $m=count($searchArray1);
               $n=0;
               for ($i=0;$i<$m;$i++)
               {
                  $Array=explode(",",$searchArray1[$i]);
                  $j = count($Array);
                  for ($k = 0; $k<$j;$k++)
                  {
                     $searchArray[$n]=$Array[$k];
                     $n++;
                  }
               }
               if($n>0)
               {
                  $searchSql = "AND (LOWER($fieldName) LIKE LOWER(?)";
                  $paramArray[] = '%' . $searchArray[0] . '%';
                  for($i=1;$i<$n;$i++)
                  {
                     $searchSql .="OR LOWER($fieldName) LIKE LOWER(?)";
                     $paramArray[] = '%' . $searchArray[$i] . '%';
                  }
                  $searchSql .= ")";
               }


it cut the text on ", " (with a space char) and then cut it on "," (some reviewer were not found because of the space char)
MarieNyst
 
Posts: 24
Joined: Thu Nov 29, 2012 9:35 pm


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests