Commit cefdfe1b authored by Laurent's avatar Laurent

7.3.7

Merge branch 'origin-stable' into origin-hotline-master

Conflicts:
	VERSIONS
	library/startup.php
	tests/library/Class/WebService/SIGB/OrpheeFixtures.php
parents 110c7799 363174dd
10/09/2015 - v7.3.7
- ticket #28137 : Branchcode non rempli lors de l'envoi d'une suggestion vers Koha
- ticket #28822 : amélioration des performances du calcul des facettes d'un résultat de recherche
- ticket #27895 : Handle changes on Orphee webservices
- ticket #28200 : correction de l'url absolue vers les notices dans les newsletters
- ticket #28967 : Correction de la prise en compte du paramètre qui permet de limiter le nombre d'avis dans l'affichage hiérarchique.
- ticket #28994 : Prend en compte le changement d'ordre de la balise biblioitemnumber dans la réponse XML de ILSDI (Koha).
- ticket #29103 : Le terme 'Portail' est maintenant traductible et peut être remplacé via la variable TEXT_REPLACEMENTS
04/09/2015 - v7.3.6
- ticket #26961 : correction du décalage du pointeur de localisation des documents sur le plan des exemplaires
- ticket #26961 : correction du décalage du pointeur de localisation des documents sur le plan des exemplaires
- ticket #29043 : Correction de la prise en compte du décodage des accents pour les fichiers code barres de suppression d'exemplaires
......
- ticket #28137 : Branchcode non rempli lors de l'envoi d'une suggestion vers Koha
\ No newline at end of file
- ticket #28822 : amélioration des performances du calcul des facettes d'un résultat de recherche
\ No newline at end of file
......@@ -36,7 +36,7 @@ echo $this->ligneInfos($this->traduire("Utilisateur"), $this->user->getLogin());
echo $this->ligneInfos("Pseudo", $this->user->getNomAff());
echo $this->ligneInfos("Rôle", $acl->getLibelleRole($this->user->getRoleLevel()));
$bib = $this->user->getBib();
$bib = (!$bib) ? 'Portail' : $bib->getLibelle();
$bib = (!$bib) ? $this->_('Portail') : $bib->getLibelle();
echo $this->ligneInfos("Bibliothèque", $bib);
?>
......
<?php
<?php
echo $this->profileSelect('users',$this->id_zone,$this->id_bib,'zb',0,true,true,true);
......@@ -23,7 +23,7 @@ else
<tr>
<td colspan="10" class="separ"></td>
</tr>
<?php
<?php
$acl = new ZendAfi_Acl_AdminControllerRoles();
......@@ -31,8 +31,8 @@ $ligne=0;
foreach($this->users as $user)
{
$ligne ++ ;
if ($ligne & 1) $class="first"; else $class="second";
if ($user["ID_SITE"] =="0") $nom_bib="Portail";
if ($ligne & 1) $class="first"; else $class="second";
if ($user["ID_SITE"] =="0") $nom_bib = $this->_('Portail');
else $nom_bib=fetchOne("select nom_court from int_bib where id_bib=".$user["ID_SITE"]);
if (strlen($user["LOGIN"])>=15) $login= substr($user["LOGIN"],0,15).'...'; else $login=$user["LOGIN"];
if (strlen($nom_bib)>=40) $nom_bib_r= substr($nom_bib,0,40).'...'; else $nom_bib_r=$nom_bib;
......@@ -45,11 +45,11 @@ foreach($this->users as $user)
if (Class_Users::getIdentity()->isAdmin()) {
echo('<a href="'.BASE_URL.'/admin/users/edit/id/'.$user["ID_USER"].'">'.$this->boutonIco("type=edit").'</a>&nbsp;&nbsp; <a href="'.BASE_URL.'/admin/users/delete/id/'.$user["ID_USER"].'">');
if ($user["ID_USER"] != '1') echo $this->boutonIco("type=del");
echo('</a>');
}
echo('</td></tr>');
}
echo ('</table>');
echo BR.'<div align="center" style="width:100%">'.$this->pager($this->nombre,$this->nb_par_page,$this->page,$this->url).'</div>';
......
......@@ -154,10 +154,13 @@ class BlogController extends ZendAfi_Controller_Action {
public function hierarchicalAction() {
$cfg = Class_Profil::getCurrentProfil()->getConfigurationOf('blog','hierarchical','');
$nb_display = isset($cfg['nb_display']) ? $cfg['nb_display'] : null;
$this->view->list = $this->_helper
->reviewListViewMode(['model' => Class_Catalogue::find($this->_getParam('id', 0)),
'id' => $this->_getParam('id'),
'page' => $this->_getParam('page', 1),
'truncate_at' => $this->_getParam('truncate_at')]);
'truncate_at' => $this->_getParam('truncate_at'),
'nb_display' => $nb_display]);
}
}
\ No newline at end of file
......@@ -8,8 +8,8 @@
// Nom de la ville
if ($bib = $article->getBib())
$ville = $bib->getVille();
else
$ville = "Portail";
else
$ville = $this->_('Portail');
if (!array_key_exists($ville, $news_bib))
$news_bib[$ville] = array();
......@@ -28,4 +28,4 @@
}
echo('</ul>');
}
}?>
\ No newline at end of file
}?>
......@@ -32,6 +32,9 @@ class BibCSite extends Zend_Db_Table_Abstract {
class BibLoader extends Storm_Model_Loader {
use Trait_Translator;
protected $_portail;
public function findAllWithPortail() {
......@@ -68,7 +71,7 @@ class BibLoader extends Storm_Model_Loader {
public function getPortail() {
if (!isset($this->_portail))
$this->_portail = $this->newInstanceWithId(0)->setLibelle('Portail');
$this->_portail = $this->newInstanceWithId(0)->setLibelle($this->_('Portail'));
return $this->_portail;
}
......
......@@ -234,8 +234,9 @@ class Class_Newsletter extends Storm_Model_Abstract {
->tagAnchor($view->absoluteUrl(
[ 'controller' => 'recherche',
'action' => 'viewnotice',
'id' => $notice->getId()]
),
'id' => $notice->getId()],
null, true
),
$view->tagImg($vignette,
['style' => 'float:left;width:50px;vertical-align:top;padding:5px',
'alt' => 'vignette']
......
......@@ -60,6 +60,7 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader {
public function getNoticeFromXML($xml) {
$this->_xml_parser = Class_WebService_XMLParser::newInstance();
$this->_notice = new Class_WebService_SIGB_Notice(0);
$this->_xml_parser
->setElementHandler($this)
->parse($xml);
......@@ -75,7 +76,7 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader {
public function endBiblioItemNumber($data) {
if (!$this->_xml_parser->inParents('items'))
$this->_notice = new Class_WebService_SIGB_Notice($data);
$this->_notice->setId($data);
}
......
......@@ -56,8 +56,13 @@ class Class_WebService_SIGB_Orphee_GetLstPretResponseReader extends Class_WebSer
$this->_emprunts []= $this->_current_emprunt;
}
public function endTit($data) {
$this->endTitre($data);
}
public function endTitre($data) {
if ($data = trim($data))
$this->_current_emprunt->getExemplaire()->setTitre($data);
}
......@@ -74,6 +79,11 @@ class Class_WebService_SIGB_Orphee_GetLstPretResponseReader extends Class_WebSer
public function endAut($data) {
$this->endAuteur($data);
}
public function endAuteur($data) {
if ($data = trim($data))
$this->_current_emprunt->getExemplaire()->setAuteur($data);
}
......
......@@ -75,6 +75,11 @@ class Class_WebService_SIGB_Orphee_GetLstRsvResponseReader extends Class_WebServ
public function endTit($data) {
$this->endTitre($data);
}
public function endTitre($data) {
$this->_current_reservation->getExemplaire()->setTitre(trim($data));
}
......
......@@ -94,6 +94,11 @@ abstract class ZendAfi_Controller_Action_Helper_AbstractListViewMode extends Zen
}
protected function getNbDisplay() {
return (isset($this->_params['nb_display']) && $this->_params['nb_display']) ? $this->_params['nb_display'] : $this->_items_by_page;
}
protected function getItemsParams() {
$default_params = ['limitPage' => [$this->getPage(), $this->_items_by_page]];
......
......@@ -70,7 +70,8 @@ class ZendAfi_Controller_Action_Helper_ReviewListViewMode extends ZendAfi_Contro
public function getItems() {
return Class_AvisNotice::getAvisFromPreferences(['id_catalogue' => $this->getModelId()],
[$this->getPage(), $this->_items_by_page]);
[$this->getPage(),
$this->getNbDisplay()]);
}
......
......@@ -16,7 +16,7 @@
*
* 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
*/
////////////////////////////////////////////////////////////////////////////////
// OPAC3 : FILTRE DE SELECTION : ZONE / BIBLIOTHEQUE / PROFIL
......@@ -25,13 +25,13 @@
// b -> rend combo bib
// p -> rend combo profil
////////////////////////////////////////////////////////////////////////////////
class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHelper
{
public $user; // User identifié
//-----------------------------------------------------------------------------------------------
// Main routine
// Main routine
//-----------------------------------------------------------------------------------------------
public function profileSelect($url,$id_zone=0, $id_bib=0,$combo="zb", $id_profil=0,$portail=false,$all=true,$champ_nom=false)
{
......@@ -39,7 +39,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
if($id_profil) $titre.=$this->translate()->_(" et profil");
$this->user = ZendAfi_Auth::getInstance()->getIdentity();
$html = '<div class="form" style="font-size:10pt">'.$titre.'<br/><table cellpadding="3" cellspacing="1" border="0">';
// Combo des zones
if(preg_match("^z^",$combo))
{
......@@ -48,7 +48,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
<td>'.$this->getZoneSelect($id_zone,$portail,$all,$url).'</td>
</tr>';
}
// Combo des bibliotheques
if(preg_match("^b^",$combo))
{
......@@ -57,7 +57,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
<td>'.$this->getBibSelect($id_zone,$id_bib,$portail,$all,$url).'</td>
</tr>';
}
// Combo des profils
if(preg_match("^p^",$combo))
{
......@@ -67,7 +67,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
</tr>';
}
$html.='</table>';
// Recherche d'abonnés
if($champ_nom==true)
{
......@@ -76,9 +76,9 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html.='<table cellpadding="3" cellspacing="1" border="0">';
$rech_user = isset($_SESSION["admin"]["rech_user"]) ? $_SESSION["admin"]["rech_user"] : array('role' => 0, 'login' => '', 'nom' => '');
$cls=new ZendAfi_Acl_AdminControllerRoles();
$combo_roles= Class_Users::getIdentity()->isAdmin() ? $cls->rendCombo($rech_user["role"],$this->user->ROLE_LEVEL,true) : $cls->rendCombo('2','2',false);
$combo_roles= Class_Users::getIdentity()->isAdmin() ? $cls->rendCombo($rech_user["role"],$this->user->ROLE_LEVEL,true) : $cls->rendCombo('2','2',false);
$html.='
<tr>
......@@ -101,7 +101,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
</table>
</form>';
}
$html.='</div>';
return $html;
}
......@@ -114,22 +114,22 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$class_zone = new Class_Zone();
$zone_array = $class_zone->getAllZone();
$redirect = "location='".BASE_URL."/admin/".$url."?z='+ this.value + '&amp;b=ALL'";
// Si l'user est minimum modo_portail
if ($this->user->ROLE_LEVEL > 4)
{
$html[]='<select name="zone" id="zone" onchange="'.$redirect.'">';
if($all == true) $html[]='<option value="ALL" >** tous **</option>';
if($portail == true)
if($portail == true)
{
if($id_zone_selected=="PORTAIL" or !$id_zone_selected) $sel = ' selected="selected"'; else $sel = "";
$html[]='<option value="PORTAIL"'.$sel.'>Portail</option>';
$html[]='<option value="PORTAIL"'.$sel.'>' . $this->_('Portail') . '</option>';
}
}
// Si l'user est admin_bib
else $html[]='<select name="zone" id="zone" disabled="disabled">';
foreach ($zone_array as $zone) {
if($id_zone_selected == $zone->ID_ZONE and $id_zone_selected !="PORTAIL") $sel = 'selected="selected"'; else $sel="";
......@@ -149,7 +149,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='</select>';
return (implode('',$html));
}
//----------------------------------------------------------------------------------
// Combo des bibliotheques
//----------------------------------------------------------------------------------
......@@ -158,23 +158,23 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$class_bib = new Class_Bib();
$bib_array = $class_bib->getBibs($id_zone);
$redirect = "location='".BASE_URL."/admin/".$url."?z=".$id_zone."&amp;b='+ this.value";
if ($this->user->ROLE_LEVEL > 4) // Si l'user est minimum modo_portail
{
$html[]='<select name="bib" id="bib" onchange="'.$redirect.'">';
if($id_zone != "PORTAIL")
{
{
if($id_bib == "ALL") $sel = 'selected="selected"'; else $sel="";
if($all == true) $html[]='<option value="ALL" '.$sel.'>** '.$this->translate()->_('toutes').' **</option>';
}
if($portail == true and (!$id_zone or $id_zone=="PORTAIL" or $id_zone=="ALL"))
if($portail == true and (!$id_zone or $id_zone=="PORTAIL" or $id_zone=="ALL"))
{
if($id_bib == "PORTAIL") $sel = 'selected="selected"'; else $sel="";
$html[]='<option value="PORTAIL" '.$sel.'>'.$this->translate()->_('Portail').'</option>';
}
}
else $html[]='<select name="bib" id="bib" style="width:100%" disabled="disabled">';
if($bib_array)
{
foreach ($bib_array as $bib)
......@@ -194,7 +194,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='</select>';
return implode('',$html);
}
//----------------------------------------------------------------------------------
// Combo des profils
//----------------------------------------------------------------------------------
......@@ -205,8 +205,8 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='<select name="id_profil" id="id_profil" onchange="'.$redirect.'">';
foreach ($profil_array as $profil) {
if ($id_profil == $profil->getId())
$selected='selected="selected"';
else
$selected='selected="selected"';
else
$selected='';
$html[]='<option value="'.$profil->getId().'" '.$selected.'>'.$profil->getLibelle().'</option>';
}
......
......@@ -64,7 +64,7 @@ function defineConstant($name, $value) {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.3');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.6');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.7');
defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/');
......
......@@ -579,6 +579,11 @@ class Admin_NewsletterControllerPreviewActionTest extends Admin_NewsletterContro
public function noticeShouldBePresent() {
$this->assertQueryContentContains('p', 'Martine à la plage', $this->_response->getBody());
}
/** @test */
public function noticeMartineALaPlageUrlShouldBeRechercheViewNotice42() {
$this->assertXPath('//a[@href="http://localhost' . BASE_URL . '/recherche/viewnotice/id/42"]');
}
}
......
......@@ -52,7 +52,7 @@ class SystemeControllerWebServicesActionTest extends Admin_AbstractControllerTes
public function webServiceFnacGetResumeShouldWork() {
$this->dispatch('/admin/systeme/webservices/id_service/Fnac/id_fonction/1');
$this->assertXPathContentContains('//pre[@class="resultat"]',
'Une enquête sur un réseau de prostitution dévoile des secrets d\'espionnage',
'Tandis que Lisbeth Salander coule des journées',
$this->_response->getBody());
}
......
......@@ -26,6 +26,9 @@ class BlogControllerHierarchicalTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Class_Profil::getCurrentProfil()
->setCfgModules(['blog' => ['hierarchical' => ['nb_display' => 2]]]);
Class_AdminVar::set('AVIS_MIN_SAISIE', 0);
Class_AdminVar::set('AVIS_MAX_SAISIE', 1000);
......@@ -73,6 +76,26 @@ class BlogControllerHierarchicalTest extends AbstractControllerTestCase {
'id_user' => 3,
'clef_oeuvre' => $this->ksp->getClefOeuvre()]);
$this->fixture('Class_AvisNotice',
['id' => 2,
'note' => 4,
'entete' => 'Nice !',
'avis' => 'What a nice game',
'statut' => 1,
'date_avis' => '2016-05-18 00:00:00',
'id_user' => 3,
'clef_oeuvre' => $this->ksp->getClefOeuvre()]);
$this->fixture('Class_AvisNotice',
['id' => 3,
'note' => 5,
'entete' => 'So hot !',
'avis' => 'What a hot game',
'statut' => 1,
'date_avis' => '2014-05-18 00:00:00',
'id_user' => 3,
'clef_oeuvre' => $this->ksp->getClefOeuvre()]);
$this->fixture('Class_Users',
['id' => 3,
'login' => 'Harlock',
......@@ -145,6 +168,20 @@ class BlogControllerHierarchicalTest extends AbstractControllerTestCase {
}
/** @test */
public function kspSecondReviewTitleShouldBePresent() {
$this->assertXPathContentContains('//a[contains(@href, "blog/viewavis/id/2")]',
'Nice');
}
/** @test */
public function kspThirdReviewTitleShouldNotBePresent() {
$this->assertNotXPathContentContains('//a[contains(@href, "blog/viewavis/id/3")]',
'So hot !');
}
/** @test */
public function kspAuthorShouldBePresent() {
$this->assertXPathContentContains('//a[contains(@href, "blog/viewauteur/id/3")]',
......
......@@ -20,6 +20,102 @@
*/
class KohaFixtures {
public static function xmlGetRecordOneJardinEnfanceWithItemOnTop() {
return
'<?xml version="1.0" encoding="ISO-8859-1" ?>
<GetRecords>
<record>
<isbn>9782862749198</isbn>
<marcxml>
<record
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
xmlns="http://www.loc.gov/MARC21/slim">
<leader>00397nac a22001451u 4500</leader>
<datafield tag="010" ind1=" " ind2=" ">
<subfield code="a">9782862749198</subfield>
</datafield>
<datafield tag="090" ind1=" " ind2=" ">
<subfield code="a">1</subfield>
</datafield>
<datafield tag="101" ind1=" " ind2=" ">
<subfield code="a">fre</subfield>
</datafield>
<datafield tag="100" ind1=" " ind2=" ">
<subfield code="a">20080725 frey50 </subfield>
</datafield>
<datafield tag="200" ind1=" " ind2=" ">
<subfield code="a">Jardins d\'enfance</subfield>
<subfield code="b">LITT</subfield>
<subfield code="f">Abécassis, Eliette</subfield>
</datafield>
<datafield tag="210" ind1=" " ind2=" ">
<subfield code="c">cherche midi éditeur</subfield>
<subfield code="d">11/2001</subfield>
</datafield>
<datafield tag="215" ind1=" " ind2=" ">
<subfield code="a">180</subfield>
</datafield>
<datafield tag="225" ind1=" " ind2=" ">
<subfield code="a">nouvelles</subfield>
</datafield>
<datafield tag="995" ind1=" " ind2=" ">
<subfield code="9">1</subfield>
<subfield code="c">BIB</subfield>
<subfield code="2">0</subfield>
<subfield code="k">R ABE</subfield>
<subfield code="o">0</subfield>
<subfield code="e">Secteur Adulte</subfield>
<subfield code="b">BIB</subfield>
<subfield code="j">7786000200</subfield>
<subfield code="q">a</subfield>
<subfield code="r">2</subfield>
<subfield code="s">Achats</subfield>
</datafield>
<controlfield tag="001">1</controlfield>
</record>
</marcxml>
<publicationyear>2001</publicationyear>
<collectiontitle>nouvelles</collectiontitle>
<pages>180</pages>
<issues>
</issues>
<itemtype>LITT</itemtype>
<biblionumber>1</biblionumber>
<timestamp>2008-09-03 18:43:19</timestamp>
<cn_sort>_</cn_sort>
<publishercode>cherche midi éditeur</publishercode>
<reserves>
</reserves>
<items>
<item>
<biblioitemnumber>1</biblioitemnumber>
<wthdrawn>0</wthdrawn>
<holdingbranchname>Bibliothèque Jean Prunier</holdingbranchname>
<notforloan>0</notforloan>
<replacementpricedate>2008-08-20</replacementpricedate>
<itemnumber>1</itemnumber>
<location>Secteur Adulte</location>
<itemcallnumber>R ABE</itemcallnumber>
<date_due>2011-08-20</date_due>
<itemlost>0</itemlost>
<datelastseen>2008-08-20</datelastseen>
<homebranch>BIB</homebranch>
<homebranchname>Bibliothèque Jean Prunier</homebranchname>
<biblionumber>1</biblionumber>
<holdingbranch>BIB</holdingbranch>
<timestamp>2008-08-20 17:15:51</timestamp>
<damaged>0</damaged>
<cn_sort>R_ABE</cn_sort>
<dateaccessioned>2008-08-20</dateaccessioned>
</item>
</items>
<biblioitemnumber>1</biblioitemnumber>
</record>
</GetRecords>';
}
public static function xmlGetRecordOneJardinEnfance() {
return
'<?xml version="1.0" encoding="ISO-8859-1" ?>
......
......@@ -974,3 +974,23 @@ class KohaServiceGetNoticeHarryPotterWithRestrictionTest
$this->assertEquals('Réservé', $this->potter->exemplaireAt(8)->getDisponibilite());
}
}
class KohaServiceGetNoticeJardinEnfantWithItemOnTopTest extends KohaTestCase {
public function setUp() {
parent::setUp();