Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
afi
opacce
Commits
b861d1dd
Commit
b861d1dd
authored
Jul 08, 2019
by
Ghislain Loas
Browse files
work on bootstrap
parent
8a48710a
Pipeline
#8091
passed with stage
in 34 minutes and 47 seconds
Changes
109
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
217 additions
and
14 deletions
+217
-14
application/modules/opac/controllers/BibController.php
application/modules/opac/controllers/BibController.php
+70
-0
application/modules/opac/controllers/CmsController.php
application/modules/opac/controllers/CmsController.php
+34
-5
application/modules/opac/views/scripts/bib/agenda.phtml
application/modules/opac/views/scripts/bib/agenda.phtml
+2
-0
application/modules/opac/views/scripts/bib/articles-pro.phtml
...ication/modules/opac/views/scripts/bib/articles-pro.phtml
+2
-0
application/modules/opac/views/scripts/bib/avis-pro.phtml
application/modules/opac/views/scripts/bib/avis-pro.phtml
+2
-0
application/modules/opac/views/scripts/bib/carte.phtml
application/modules/opac/views/scripts/bib/carte.phtml
+2
-0
application/modules/opac/views/scripts/bib/en-lire-plus.phtml
...ication/modules/opac/views/scripts/bib/en-lire-plus.phtml
+2
-0
application/modules/opac/views/scripts/bib/equipe.phtml
application/modules/opac/views/scripts/bib/equipe.phtml
+2
-0
application/modules/opac/views/scripts/bib/informations.phtml
...ication/modules/opac/views/scripts/bib/informations.phtml
+2
-0
application/modules/opac/views/scripts/bib/ouvertures.phtml
application/modules/opac/views/scripts/bib/ouvertures.phtml
+2
-0
application/modules/opac/views/scripts/bib/selections-pro.phtml
...ation/modules/opac/views/scripts/bib/selections-pro.phtml
+2
-0
doc/extern_libs.org
doc/extern_libs.org
+1
-2
library/Class/Article.php
library/Class/Article.php
+6
-0
library/Class/Bib.php
library/Class/Bib.php
+12
-1
library/Class/Calendar.php
library/Class/Calendar.php
+20
-6
library/Class/Newsletter.php
library/Class/Newsletter.php
+36
-0
library/Class/PanierNotice.php
library/Class/PanierNotice.php
+1
-0
library/Class/ScriptLoader.php
library/Class/ScriptLoader.php
+2
-0
library/Class/UserGroup.php
library/Class/UserGroup.php
+3
-0
library/Class/Users.php
library/Class/Users.php
+14
-0
No files found.
application/modules/opac/controllers/BibController.php
View file @
b861d1dd
...
...
@@ -248,4 +248,74 @@ class BibController extends ZendAfi_Controller_Action {
$this
->
view
->
titre
=
$this
->
_
(
'Carte des bibliothèques'
);
$this
->
view
->
libraries
=
Class_Bib
::
findAllWithCoordinates
();
}
public
function
enLirePlusAction
()
{
$this
->
_initLibrary
();
}
public
function
ouverturesAction
()
{
$this
->
_initLibrary
();
}
public
function
informationsAction
()
{
$this
->
_initLibrary
();
}
public
function
carteAction
()
{
$this
->
_initLibrary
();
}
public
function
equipeAction
()
{
$this
->
_initLibrary
();
}
public
function
agendaAction
()
{
$this
->
_initLibrary
();
}
public
function
avisProAction
()
{
$this
->
_initProUser
();
}
public
function
articlesProAction
()
{
$this
->
_initProUser
();
}
public
function
selectionsProAction
()
{
$this
->
_initProUser
();
}
protected
function
_initProUser
()
{
$this
->
_initLibrary
();
if
(
!
$pro
=
Class_Users
::
find
(
$this
->
_getParam
(
'pro_id'
)))
{
$this
->
_helper
->
notify
(
$this
->
_
(
'Une erreur c\'est produite.'
),
[
'status'
=>
'error'
]);
return
$this
->
_redirectClose
(
$this
->
_getReferer
());
}
if
(
!
$pro
->
canAccessBackend
())
{
$this
->
_helper
->
notify
(
$this
->
_
(
'Une erreur c\'est produite.'
),
[
'status'
=>
'error'
]);
return
$this
->
_redirectClose
(
$this
->
_getReferer
());
}
$this
->
view
->
pro
=
$pro
;
}
protected
function
_initLibrary
()
{
if
(
!
$this
->
view
->
library
=
Class_Bib
::
find
(
$this
->
_getParam
(
'id'
)))
{
$this
->
_helper
->
notify
(
$this
->
_
(
'Une erreur c\'est produite.'
),
[
'status'
=>
'error'
]);
return
$this
->
_redirectClose
(
$this
->
_getReferer
());
}
}
}
\ No newline at end of file
application/modules/opac/controllers/CmsController.php
View file @
b861d1dd
...
...
@@ -226,15 +226,34 @@ class CmsController extends ZendAfi_Controller_Action {
public
function
calendarAction
()
{
$viewRenderer
=
$this
->
getHelper
(
'ViewRenderer'
);
if
(
$this
->
_getParam
(
'render'
)
===
'ajax'
)
$viewRenderer
->
setLayoutScript
(
'empty.phtml'
);
$this
->
_initCalendarAndPreferences
();
$id_module
=
$this
->
_getParam
(
"id_module"
);
if
(
$this
->
_getParam
(
'render'
)
===
'ajax'
)
{
$content
=
$this
->
view
->
calendarContent
(
$this
->
view
->
calendar
,
$this
->
view
->
preferences
);
$script_loader
=
Class_ScriptLoader
::
getInstance
();
$scripts
=
$script_loader
->
addAdminScript
(
'onload_utils'
)
->
addJQueryReady
(
'setupAnchorsTarget();'
)
->
html
();
$this
->
_helper
->
HTMLAjaxResponse
(
$scripts
.
$content
);
}
}
protected
function
_initCalendarAndPreferences
()
{
$id_module
=
$this
->
_getParam
(
'id_module'
);
if
(
false
!==
strpos
(
$id_module
,
'library'
))
return
$this
->
_loadLibraryAgenda
((
int
)
filter_var
(
$id_module
,
FILTER_SANITIZE_NUMBER_INT
));
$module
=
Class_Profil
::
getCurrentProfil
()
->
getModuleAccueilPreferences
(
$id_module
,
'CALENDAR'
);
$module_calendrier
=
new
Class_Systeme_ModulesAccueil_Calendrier
();
$preferences
=
array_merge
(
$module_calendrier
->
getDefaultValues
(),
Class_Profil
::
getCurrentProfil
()
->
getModuleAccueilPreferences
(
$id_module
,
'CALENDAR'
)
);
$module
);
$preferences
[
'ID_MODULE'
]
=
$id_module
;
$preferences
[
'SELECT_ID_CAT'
]
=
$preferences
[
'display_cat_select'
]
?
$this
->
_getParam
(
'select_id_categorie'
)
...
...
@@ -249,6 +268,16 @@ class CmsController extends ZendAfi_Controller_Action {
}
protected
function
_loadLibraryAgenda
(
$id
)
{
$wrapper
=
new
Intonation_Library_View_Wrapper_Library_RichContent_Agenda
;
$wrapper
->
setModel
(
Class_Bib
::
find
(
$id
))
->
setView
(
$this
->
view
);
$this
->
view
->
preferences
=
$wrapper
->
getPreferences
();
$this
->
view
->
calendar
=
$wrapper
->
getCalendar
(
$this
->
_request
->
getParams
());
}
/**
* @param int $id_module
...
...
application/modules/opac/views/scripts/bib/agenda.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_Agenda
(
$this
->
library
);
application/modules/opac/views/scripts/bib/articles-pro.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_ProArticles
(
$this
->
library
,
$this
->
pro
);
application/modules/opac/views/scripts/bib/avis-pro.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_ProReviews
(
$this
->
library
,
$this
->
pro
);
application/modules/opac/views/scripts/bib/carte.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_Map
(
$this
->
library
);
application/modules/opac/views/scripts/bib/en-lire-plus.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library
(
$this
->
library
);
application/modules/opac/views/scripts/bib/equipe.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_Team
(
$this
->
library
);
application/modules/opac/views/scripts/bib/informations.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_Details
(
$this
->
library
);
application/modules/opac/views/scripts/bib/ouvertures.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_Openings
(
$this
->
library
);
application/modules/opac/views/scripts/bib/selections-pro.phtml
0 → 100644
View file @
b861d1dd
<?php
echo
$this
->
library_SelectionsPro
(
$this
->
library
,
$this
->
pro
);
doc/extern_libs.org
View file @
b861d1dd
...
...
@@ -45,5 +45,4 @@
| icon slideshow by Javier Cabezas | CCBY | | editeur d'articles | | https://thenounproject.com/term/slideshow/6517/ |
| PHP-Parser | BSD-3-Clauses | - | validation de fichiers php (formulaires de recherche) | | https://github.com/nikic/PHP-Parser |
| Jquery Notification | MIT ? | | barre bleue de notification | oui (barre en bas) | n'existe plus |
| leaflet.fullscreen | MIT | | bouton plein écran sur la carte des bibliothèques | | https://github.com/brunob/leaflet.fullscreen |
library/Class/Article.php
View file @
b861d1dd
...
...
@@ -36,6 +36,7 @@ class ArticleLoader extends Storm_Model_Loader {
/** @var bool */
protected
$_published
;
protected
$_display_mode
;
protected
$_all_articles
;
/**
* @return ArticleLoader
...
...
@@ -893,6 +894,11 @@ class Class_Article extends Storm_Model_Abstract {
}
public
function
getTypeDocLabel
()
{
return
Class_TypeDoc
::
getLabelFor
(
$this
->
getTypeDocId
());
}
/**
* @param string $str_date
* @return bool
...
...
library/Class/Bib.php
View file @
b861d1dd
...
...
@@ -330,7 +330,8 @@ class Class_Bib extends Storm_Model_Abstract {
'id_lieu'
=>
0
,
'rewrite_url'
=>
''
,
'link_to_profil_id'
=>
0
,
'gln'
=>
''
],
'gln'
=>
''
,
'url_web'
=>
''
],
$_file_uploaded
=
false
,
$_uploadHandler
;
...
...
@@ -1008,4 +1009,14 @@ class Class_Bib extends Storm_Model_Abstract {
return
$e
->
getMessage
();
}
}
public
function
getPictureUrl
()
{
if
(
!
$picture
=
$this
->
getPhoto
())
return
''
;
return
(
false
===
strpos
(
$picture
,
'userfiles'
))
?
USERFILESURL
.
static
::
BASE_PATH
.
$picture
:
BASE_URL
.
$picture
;
}
}
library/Class/Calendar.php
View file @
b861d1dd
...
...
@@ -79,7 +79,6 @@ class Class_Calendar {
$this
->
id_bib
=
Class_Profil
::
getCurrentProfil
()
->
getIdSite
();
$this
->
preferences
[
'nb_events'
]
=
(
int
)
$this
->
preferences
[
'nb_events'
];
if
(
!
array_isset
(
'display_cat_select'
,
$this
->
preferences
))
$this
->
preferences
[
'display_cat_select'
]
=
false
;
...
...
@@ -153,7 +152,9 @@ class Class_Calendar {
protected
function
_loadArticles
(
$extra_prefs
)
{
$prefs
=
array_merge
([
'display_order'
=>
$this
->
preferences
[
'display_order'
],
$prefs
=
array_merge
([
'display_order'
=>
(
isset
(
$this
->
preferences
[
'display_order'
])
?
$this
->
preferences
[
'display_order'
]
:
$this
->
preferences
[
'order'
]),
'id_categorie'
=>
$this
->
_getCategoriesIds
(),
'events_only'
=>
true
,
'event_date'
=>
$this
->
date
,
...
...
@@ -217,12 +218,12 @@ class Class_Calendar {
$articles
=
$this
->
_loadArticles
(
$prefs
);
if
(
count
(
$articles
)
<
$this
->
preferences
[
'nb_events'
]
if
(
count
(
$articles
)
<
$this
->
_getSize
()
&&
$this
->
preferences
[
'event_filter'
]
==
'none'
)
{
$next_articles
=
$this
->
_loadArticles
([
'event_start_after'
=>
$this
->
date
,
'event_date'
=>
''
,
'event_end_after'
=>
''
,
'limit'
=>
$this
->
preferences
[
'nb_events'
]
]);
'limit'
=>
$this
->
_getSize
()
]);
$articles
=
array_merge
(
$articles
,
Class_Article
::
filterByLocaleAndWorkflow
(
$next_articles
));
}
...
...
@@ -231,6 +232,17 @@ class Class_Calendar {
}
protected
function
_getSize
()
{
if
(
isset
(
$this
->
preferences
[
'size'
]))
return
(
int
)
$this
->
preferences
[
'size'
];
if
(
isset
(
$this
->
preferences
[
'nb_events'
]))
return
(
int
)
$this
->
preferences
[
'nb_events'
];
return
3
;
}
public
function
getAdminSelectedCategories
()
{
if
(
isset
(
$this
->
admin_selected_categories
))
return
$this
->
admin_selected_categories
;
...
...
@@ -252,7 +264,7 @@ class Class_Calendar {
?
$this
->
_loadArticles
([
'event_date'
=>
$this
->
day
])
:
$this
->
_getNextEvents
();
return
array_slice
(
$articles
,
0
,
$this
->
preferences
[
'nb_events'
]
);
return
array_slice
(
$articles
,
0
,
$this
->
_getSize
()
);
}
...
...
@@ -277,7 +289,9 @@ class Class_Calendar {
public
function
getDisplayFullPage
()
{
return
$this
->
preferences
[
'display_full_page'
];
return
isset
(
$this
->
preferences
[
'display_full_page'
])
?
$this
->
preferences
[
'display_full_page'
]
:
false
;
}
...
...
library/Class/Newsletter.php
View file @
b861d1dd
...
...
@@ -58,6 +58,23 @@ class NewsletterLoader extends Storm_Model_Loader {
return
Class_Newsletter
::
findAllBy
([
'draft'
=>
0
,
'order'
=>
'titre'
]);
}
public
function
getPublishedNewslettersForLibrary
(
$library
)
{
if
(
!
$groups
=
Class_UserGroup
::
findAllBy
([
'id_bib'
=>
$library
->
getId
()]))
return
[];
if
(
!
$newsletters
=
$this
->
getPublishedNewsletters
())
return
[];
$newsletters_for_library
=
[];
foreach
(
$newsletters
as
$newsletter
)
if
(
$newsletter
->
doesRecipientsGroupsContains
(
$groups
))
$newsletters_for_library
[]
=
$newsletter
;
return
$newsletters_for_library
;
}
}
...
...
@@ -181,6 +198,9 @@ class Class_Newsletter extends Storm_Model_Abstract {
public
function
isBlackListed
(
$user
)
{
if
(
!
$user
)
return
false
;
return
Class_Newsletter_Blacklist
::
isBlackListed
(
$user
->
getMail
(),
$this
->
getId
());
}
...
...
@@ -199,6 +219,22 @@ class Class_Newsletter extends Storm_Model_Abstract {
}
public
function
doesRecipientsGroupsContains
(
$groups
)
{
if
(
!
$recipients_groups
=
$this
->
getRecipientsGroups
())
return
false
;
$recipients_groups_ids
=
[];
foreach
(
$recipients_groups
as
$group
)
$recipients_groups_ids
[]
=
$group
->
getId
();
$goups_ids
=
[];
foreach
(
$groups
as
$group
)
$groups_ids
[]
=
$group
->
getId
();
return
!
empty
(
array_intersect
(
$recipients_groups_ids
,
$groups_ids
));
}
public
function
getReceivers
(
$recipient_size
)
{
return
Class_Users
::
getNewslettersReceivers
(
$this
->
getId
(),
$recipient_size
);
}
...
...
library/Class/PanierNotice.php
View file @
b861d1dd
...
...
@@ -135,6 +135,7 @@ class Class_PanierNotice extends Storm_Model_Abstract {
'unique'
=>
true
]],
$_default_attribute_values
=
[
'notices'
=>
''
,
'date_maj'
=>
''
,
'libelle'
=>
''
,
'integration_hash'
=>
''
];
...
...
library/Class/ScriptLoader.php
View file @
b861d1dd
...
...
@@ -163,6 +163,8 @@ class Class_ScriptLoader {
return
$this
->
addAdminScript
(
'leaflet-0.7.7/leaflet.js'
)
->
addOPACPluginScript
(
'leaflet-ajax-gh-pages/dist/leaflet.ajax.min.js'
)
->
addOPACPluginScript
(
'leaflet.fullscreen-master/Control.FullScreen.js'
)
->
addOPACPluginStyleSheet
(
'leaflet.fullscreen-master/Control.FullScreen.css'
)
->
addStyleSheet
(
URL_ADMIN_JS
.
'leaflet-0.7.7/leaflet.css'
);
}
...
...
library/Class/UserGroup.php
View file @
b861d1dd
...
...
@@ -287,6 +287,9 @@ class Class_UserGroup extends Storm_Model_Abstract {
public
function
hasUser
(
$user
)
{
if
(
!
$user
)
return
false
;
if
(
$this
->
isManual
())
return
in_array
(
$user
->
getId
(),
$this
->
getUsersIdsOptimized
());
...
...
library/Class/Users.php
View file @
b861d1dd
...
...
@@ -1926,6 +1926,20 @@ class Class_Users extends Storm_Model_Abstract {
}
public
function
numberOfPublishedArticles
()
{
return
count
(
$this
->
getPublishedArticles
());
}
public
function
getPublishedArticles
()
{
return
Class_Article
::
findAllBy
([
'id_user'
=>
$this
->
getId
(),
'status'
=>
Class_Article
::
STATUS_VALIDATED
,
'debut not'
=>
'null'
,
'events_fin not'
=>
'null'
,
'order'
=>
'events_debut desc'
]);
}
public
function
hasToBeDelete
()
{
return
static
::
STATUT_TO_BE_DELETED
==
$this
->
getStatut
();
}
...
...
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment