Skip to content
Snippets Groups Projects
Commit 24e60f76 authored by Laurent's avatar Laurent
Browse files

Merge branch 'hotline#30163_increase_oai_results_per_pages' into 'stable'

Hotline#30163 increase oai results per pages

See merge request !1143
parents 29316261 f2a9c48d
Branches
Tags
No related merge requests found
- ticket #30163 : Augmentation de la limite d'affichage de 10 à 100 résultats dans la recherche de catalogue OAI
\ No newline at end of file
......@@ -16,14 +16,14 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class TableNoticesOAI extends Zend_Db_Table_Abstract {
protected $_name = 'oai_notices';
public function insertOrUpdate($data) {
$statement =
$statement =
"INSERT INTO ".$this->_name." (date, id_entrepot, id_oai, alpha_titre, data, recherche) ".
"VALUES ('".$data['date']."','".$data['id_entrepot']."','".$data['id_oai']."','".$data['alpha_titre']."','".$data['data']."','".$data['recherche']."') ".
"ON DUPLICATE KEY UPDATE date='".$data['date']."', alpha_titre='".$data['alpha_titre']."', data='".$data['data']."', recherche='".$data['recherche']."';";
......@@ -36,11 +36,11 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
protected $_table_name = 'oai_notices';
protected $_belongs_to = array('entrepot' => array('model' => 'Class_EntrepotOAI',
'referenced_in' => 'id_entrepot'));
protected $_table_notices;
protected $_oai_service;
protected $_entrepot_oai;
protected $_default_attribute_values = array('data' => '',
protected $_default_attribute_values = array('data' => '',
'date' => '');
......@@ -76,7 +76,7 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
->setOAIHandler($this->_entrepot_oai->getHandler())
->getRecordsFromSet($set);
$this->saveRecords($records);
$this->saveRecords($records);
return $this->getOAIService()->getListRecordsResumptionToken();
}
......@@ -124,7 +124,7 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
return null;
$records = $oai_service->getNextRecords();
$this->saveRecords($records);
$this->saveRecords($records);
return $oai_service->getListRecordsResumptionToken();
}
......@@ -164,7 +164,7 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
$this->_indexation = new Class_Indexation();
return $this->_indexation;
}
protected function toAlpha($data) {
return $this->getIndexation()->alphaMaj($data);
}
......@@ -226,8 +226,8 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
$recherche=trim($recherche);
if(!$recherche) {
$ret["statut"]="erreur";
$ret["erreur"]=$translate->_("Il n'y aucun mot assez significatif pour la recherche");
$ret["statut"]="erreur";
$ret["erreur"]=$translate->_("Il n'y aucun mot assez significatif pour la recherche");
return $ret;}
// Constitution des requetes
......@@ -258,7 +258,7 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
//------------------------------------------------------------------------------------------------------
public function getPageResultat($req, $page = 1) {
// Nombre par page
$this->nb_par_page=10;
$this->nb_par_page=100;
// Calcul de la limite
$page = (int)$page ? (int)$page : 1;
......@@ -310,7 +310,7 @@ class Class_NoticeOAI extends Storm_Model_Abstract {
return $this->getEntrepot()->isGallica();
}
public function getGallicaArkId() {
if (!$this->isGallica())
return '';
......
......@@ -207,7 +207,7 @@ class OAIControllerResultatActionTest extends AbstractControllerTestCase {
->answers(1)
->whenCalled('fetchAll')
->with("select id from oai_notices where MATCH(recherche) AGAINST('+(POMME POMMES POM)' IN BOOLEAN MODE) order by alpha_titre LIMIT 0,10",
->with("select id from oai_notices where MATCH(recherche) AGAINST('+(POMME POMMES POM)' IN BOOLEAN MODE) order by alpha_titre LIMIT 0,100",
false)
->answers(array(array('id' => 2)))
->beStrict();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment