Skip to content
Snippets Groups Projects
Commit 20be53af authored by Alex Arnaud's avatar Alex Arnaud
Browse files

rel #14943 : frbr display player in notice

parent 13970bae
Branches
Tags
3 merge requests!715Master,!648Dev#14943 record to album link backend,!639Dev#14943 record to album link backend
......@@ -49,9 +49,19 @@ class FRBR_LinkLoader extends Storm_Model_Loader {
public function findAllAlbumsFromNotice($notice) {
return Class_FRBR_Link::findAllBy(['source_type' => Class_FRBR_Link::TYPE_NOTICE,
'target_type' => Class_FRBR_Link::TYPE_ALBUM,
'source_key' => $notice->getClefAlpha()]);
return Class_FRBR_Link::findAllBy($this->_albumsFromNoticeFilter($notice));
}
public function countAlbumsFromNotice($notice) {
return Class_FRBR_Link::countBy($this->_albumsFromNoticeFilter($notice));
}
protected function _albumsFromNoticeFilter($notice) {
return ['source_type' => Class_FRBR_Link::TYPE_NOTICE,
'target_type' => Class_FRBR_Link::TYPE_ALBUM,
'source_key' => $notice->getClefAlpha()];
}
......
......@@ -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
*/
......@@ -91,10 +91,9 @@ class Class_Onglet {
function checkIfHasRessourcesNumeriques($notice) {
if(null !== $exemplaire = Class_Exemplaire::findFirstBy(['id_notice' => $notice->getId()]))
return ($exemplaire->getAlbum() != null);
return false;
return (null !== ($exemplaire = Class_Exemplaire::findFirstBy(['id_notice' => $notice->getId()]))
&& null !== $exemplaire->getAlbum())
|| 0 < Class_FRBR_Link::countAlbumsFromNotice($notice);
}
......@@ -103,10 +102,10 @@ class Class_Onglet {
$targetLinks = $notice->getLinksAsTarget();
return !(0 == count($sourceLinks) and 0 == count($targetLinks));
}
function setDisplayMode($display) {
$this->display=$display;
return $this;
......
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