Skip to content
Snippets Groups Projects
Commit 99aef5ea authored by Laurent's avatar Laurent
Browse files

Merge branch 'master' into origin-dev-14409-filters-in-calendar-box

parents eaf3b765 25ac1b27
Branches
Tags
2 merge requests!529Hotline 6.56,!407Dev/14409 filters in calendar box
25/09/2014 - v6.52.6
- ticket #16434: Correction d'un bug dans la génération des flux RSS lorsque le titre contient des balises HTML ou des caractères spéciaux (<, &, ...)
- ticket #16319: la boîte bibliothèque numérique affiche les albums dans l'ordre des titres
20/09/2014 - v6.52.5
- ticket #14149: Cosmogramme / Aloes: ajout d'une option pour ne pas envoyer le code annexe pour la réservation des exemplaires. Ce qui permet de contourner le bug du web service Aloes qui gère mal l'option site de retrait = site de l'abonné.
......
This diff is collapsed.
......@@ -355,7 +355,7 @@ class RssController extends Zend_Controller_Action
$items = [];
foreach($notices as $notice) {
$items[] = [
'titre' => $notice["titre"] . ', ' . $notice["auteur"],
'titre' => '<![CDATA[' . str_replace(BR, ' ', $notice["titre"]) . ', ' . $notice["auteur"] . ']]>' ,
'lien' => $this->view->absoluteUrl([
'controller' => 'recherche',
'action' => 'viewnotice',
......
......@@ -59,6 +59,7 @@ class Cosmo_RunLogController extends Zend_Controller_Action {
header('Content-length: ' . $run->getFileSize());
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file_path) . '"');
ob_end_clean();
readfile($file_path);
}
}
......
......@@ -16,15 +16,15 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; 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 AlbumCategorieLoader extends Storm_Model_Loader {
/**
* @return array
/**
* @return array
*/
public function getCollections() {
return $this->findAllBy(array('parent_id' => 0,
return $this->findAllBy(array('parent_id' => 0,
'order' => 'libelle'));
}
......@@ -75,6 +75,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
'albums' => array('model' => 'Class_Album',
'role' => 'categorie',
'order' => 'titre',
'dependents' => 'delete'));
protected $_default_attribute_values = array('parent_id' => 0);
......@@ -98,7 +99,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
public function getChildrenCount() {
return $this->numberOfAlbums();
}
public function hasNoChild() {
return !$this->hasChildren();
......@@ -111,7 +112,7 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
public function isNew() {
return parent::isNew() || 0 == $this->getId();
}
/**
* @param array $datas
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; 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
*/
......@@ -28,7 +28,7 @@ class Class_ScriptLoader {
protected static $instance;
protected
protected
$_script_lines,
$_css_lines,
$_should_load_amber,
......@@ -80,6 +80,7 @@ class Class_ScriptLoader {
$this
->addScript(AMBERURL.'src/js/lib/jQuery/jquery.textarea.js')
->addScript(AMBERURL.'src/js/lib/CodeMirror/codemirror.js')
->addScript(AMBERURL.'src/js/lib/CodeMirror/css.js')
->addStyleSheet(AMBERURL.'src/js/lib/CodeMirror/codemirror.css')
->addStyleSheet(AMBERURL.'src/js/lib/CodeMirror/amber.css')
->addStyleSheet(AMBERURL.'src/css/amber.css')
......@@ -101,7 +102,7 @@ class Class_ScriptLoader {
$this->addScript(AMBERURL.'src/js/amber.js');
$deploy = $this->isAmberModeDeploy();
$amber_options = sprintf('{"home":"%s", "files":%s, "deploy":%s, "ready":%s}',
AMBERURL.'src/',
json_encode($this->_amberAdditionalFiles($deploy)),
......@@ -218,14 +219,14 @@ class Class_ScriptLoader {
return $this;
}
public function addJQueryBackEnd($js) {
if(Class_Users::getLoader()->isCurrentUserCanAccesBackend())
$this->addJQueryReady($js);
return $this;
}
/**
* @return ScriptLoader
......@@ -320,9 +321,9 @@ class Class_ScriptLoader {
return $this
->loadNotificationJS()
->addJQueryReady(sprintf('showNotification(%s)',
json_encode(array('message' => $message,
'autoClose' => true,
'duration' => 10,
json_encode(array('message' => $message,
'autoClose' => true,
'duration' => 10,
'type' => 'information'))));
}
......@@ -352,12 +353,12 @@ class Class_ScriptLoader {
unset($attributes['ie_version']);
}
$attributes = array_merge(['type' => 'text/css',
'rel' => 'stylesheet',
$attributes = array_merge(['type' => 'text/css',
'rel' => 'stylesheet',
'href' => $file,
'media' => 'screen'],
$attributes);
$html_attributes = '';
foreach($attributes as $name => $value)
$html_attributes .= sprintf(' %s="%s" ', $name, $value);
......@@ -439,15 +440,15 @@ class Class_ScriptLoader {
$this->addAdminStyleSheet($file, $additional_attributes);
return $this;
}
/**
/**
* @param $file string
* @param $additional_attributes array
* @return Class_ScriptLoader
* @return Class_ScriptLoader
*/
public function addOPACPluginStyleSheet($file, $additional_attributes=null) {
return $this->addStyleSheet(BASE_URL . '/public/opac/java/' . $file,
return $this->addStyleSheet(BASE_URL . '/public/opac/java/' . $file,
$additional_attributes);
}
......@@ -458,7 +459,7 @@ class Class_ScriptLoader {
* @return Class_ScriptLoader
*/
public function addOPACPluginStyleSheets($files, $additional_attributes=null) {
foreach($files as $file)
foreach($files as $file)
$this->addOPACPluginStyleSheet($file, $additional_attributes);
return $this;
}
......@@ -494,7 +495,7 @@ class Class_ScriptLoader {
/**
* @return ScriptLoader
*/
*/
public function _scriptsAddLine($line) {
$this->_script_lines []= $line;
return $this;
......@@ -503,7 +504,7 @@ class Class_ScriptLoader {
/**
* @return ScriptLoader
*/
*/
public function cssAddLine($line) {
$this->_css_lines []= $line;
return $this;
......@@ -512,7 +513,7 @@ class Class_ScriptLoader {
/**
* @return Boolean
*/
*/
public function isAmberModeDeploy() {
if (null == $amber = Zend_Registry::get('cfg')->get('amber'))
return true;
......@@ -525,7 +526,7 @@ class Class_ScriptLoader {
/**
* @return Array
*/
*/
public function &getAmberFiles() {
if (!isset($this->_amber_files)) {
$this->_amber_files = array('AFI-Core');
......@@ -540,7 +541,7 @@ class Class_ScriptLoader {
/**
* @return Array
*/
*/
public function &getAmberReadyScripts() {
if (!isset($this->_amber_ready_scripts))
$this->_amber_ready_scripts = array(sprintf('smalltalk.Package._defaultCommitPathJs_("%s/admin/amber/commitJs")', BASE_URL),
......@@ -553,7 +554,7 @@ class Class_ScriptLoader {
/**
* @param String package
* @return Class_ScriptLoader
*/
*/
public function addAmberPackage($package) {
if (in_array($package, $this->getAmberFiles()))
return $this;
......@@ -568,7 +569,7 @@ class Class_ScriptLoader {
/**
* @param String js
* @return Class_ScriptLoader
*/
*/
public function addAmberReady($js) {
if (!in_array($js, $this->getAmberReadyScripts()))
array_push($this->getAmberReadyScripts(), $js);
......@@ -578,14 +579,14 @@ class Class_ScriptLoader {
/**
* @return Boolean
*/
*/
protected function _amberAdditionalFiles($deploy) {
$additional_files = array();
foreach ($this->getAmberFiles() as $file) {
if ($deploy) $file .= '.deploy';
$additional_files []= sprintf('../../afi/js/%s.js', $file);
}
return $additional_files;
}
......@@ -632,7 +633,7 @@ class Class_ScriptLoader {
$template = $templates[$this->_jquery_ready_mode];
foreach ($this->_jquery_ready_scripts as $js)
foreach ($this->_jquery_ready_scripts as $js)
$this->addInlineScript(sprintf($template, $js));
return $this;
......@@ -695,7 +696,7 @@ class Class_ScriptLoader {
}
protected function getVersionPergameHash() {
if (null == $this->_version_pergame_hash)
$this->_version_pergame_hash = md5(VERSION_PERGAME);
......
......@@ -57,7 +57,7 @@ function defineConstant($name, $value) {
function setupConstants() {
defineConstant('VERSION_PERGAME','6.52');
defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '.5');
defineConstant('RELEASE_NUMBER', VERSION_PERGAME . '.6');
defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/');
......
......@@ -16,46 +16,46 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; 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 AlbumCategorieRootTest extends ModelTestCase {
public function setUp() {
$this->root = new Class_AlbumCategorie;
$this->root
->setId(0)
->setLibelle('ROOT')
->setSousCategories(array());
$this->cat_jeunesse = Class_AlbumCategorie::getLoader()
->newInstanceWithId(23)
->setLibelle('Jeunesse')
->setSousCategories(array())
->setParentCategorie($this->root);
$this->root->addSousCategorie($this->cat_jeunesse);
$this->cat_jeunesse = $this->fixture('Class_AlbumCategorie',
['id' => 23,
'libelle' => 'Jeunesse',
'sous_categories' => []]);
$this->album_tintin = $this->fixture('Class_Album',
['id' => 5,
'titre' => 'Tintin',
'categorie' => $this->cat_jeunesse]);
$this->album_lagaffe = $this->fixture('Class_Album',
['id' => 9,
'titre' => 'Gaston Lagaffe',
'categorie' => $this->cat_jeunesse]);
$this->album_tintin = Class_Album::getLoader()
->newInstanceWithId(5)
->setLibelle('Tintin')
->setCategorie($this->cat_jeunesse);
Class_AlbumCategorie::clearCache();
Class_Album::clearCache();
$this->cat_jeunesse = Class_AlbumCategorie::find(23);
$this->album_lagaffe = Class_Album::getLoader()
->newInstanceWithId(9)
->setLibelle('Gaston Lagaffe')
->setCategorie($this->cat_jeunesse);
$this->cat_jeunesse
->setAlbums(array($this->album_tintin,
$this->album_lagaffe));
$this->root = $this->fixture('Class_AlbumCategorie',
['id' => 0,
'libelle' => 'ROOT']);
$this->root->addSousCategorie($this->cat_jeunesse);
$this->cat_jeunesse->setParentCategorie($this->root);
}
/** @test */
public function shouldNotHaveParentCategory() {
$this->assertFalse($this->root->hasParentCategorie());
}
/** @test */
public function libelleShouldBeRoot() {
......@@ -65,33 +65,37 @@ class AlbumCategorieRootTest extends ModelTestCase {
/** @test */
public function getSousCategoriesShouldReturnAnArrayWithAlbumJeunesse() {
$this->assertEquals(array($this->cat_jeunesse), $this->root->getSousCategories());
$this->assertEquals(['Jeunesse'],
array_map(function($c) {return $c->getLibelle();},
$this->root->getSousCategories()));
}
/** @test */
public function catJeunesseGetAlbumsShouldReturnLagaffeAndTintin() {
$this->assertEquals(array($this->album_tintin, $this->album_lagaffe),
$this->cat_jeunesse->getAlbums());
$this->assertEquals(['Gaston Lagaffe', 'Tintin'],
array_map(function($a) {return $a->getTitre();},
$this->cat_jeunesse->getAlbums()));
}
/** @test */
public function albumTintinCategorieShouldBeCatJeunesse() {
$this->assertEquals($this->cat_jeunesse->getId(),
$this->assertEquals($this->cat_jeunesse->getId(),
$this->album_tintin->getCategorie()->getId());
}
/** @test */
public function albumTintinHierarchyShouldIncludeCatJeunesseAndRoot() {
$this->assertEquals(array($this->cat_jeunesse, $this->root),
$this->album_tintin->getHierarchy());
$this->assertEquals(['Jeunesse', 'ROOT'],
array_map(function($c) {return $c->getLibelle();},
Class_Album::find(5)->getHierarchy()));
}
/** @test */
public function catJeunesseHierarchyShouldIncludeRoot() {
$this->assertEquals(array($this->root),
$this->assertEquals(array($this->root),
$this->cat_jeunesse->getHierarchy());
}
......
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