Skip to content
Snippets Groups Projects
Commit ef8a3952 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#15767_use_Bokeh_for_validation_email' into 'hotline_6.50'

Hotline#15767 use bokeh for validation email

Use Bokeh instead of AFI-OPAC for article validation email.

See merge request !351
parents 8e4e6f22 93ef0ee7
Branches
Tags
5 merge requests!366Master,!365Master,!364Master,!363Master,!361Hotline 6.50
......@@ -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
*/
class Admin_CmsController extends ZendAfi_Controller_Action {
use Trait_Translator;
......@@ -29,7 +29,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$identity = Class_Users::getIdentity();
$this->_bib = (ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB >= $identity->getRoleLevel()) ?
$identity->getBib() :
$identity->getBib() :
$this->_bib = Class_Bib::getPortail();
}
......@@ -56,11 +56,11 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
return ['bib'=> $bib,
'containers' => $bib->getArticleCategories(),
'add_link' => $this->view->tagAnchor($this->view->url(
array_merge($add_link_options,
array_merge($add_link_options,
['id_bib' => $bib->getId()])),
$add_link_label)];
},
$bibs);
$this->view->categories = $categories;
......@@ -116,7 +116,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$category->setBib($this->_bib);
$this->view->category = $category;
$this->view->combo_cat = $this->view->comboParentCategorie($category);
$this->view->combo_cat = $this->view->comboParentCategorie($category);
$this->view->id_categorie = (int)$this->_getParam('id');
$this->view->titre = "Modifier une catégorie d'articles";
}
......@@ -152,10 +152,10 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->_redirect('admin/cms');
}
public function newsduplicateAction() {
$new_article = Class_Article::find($this->_getParam('id'))->copy();
$this->view->article = $new_article;
$this->view->titre = $this->_('Dupliquer l\'article: ').$new_article->getTitre();
$this->view->combo_lieu_options = $this->comboLieuOptions();
......@@ -194,7 +194,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$article->setDomaineIds($domaine->getId());
if ($this->_isArticleSaved($article)) {
if($id_module = $this->_getParam('id_module'))
if($id_module = $this->_getParam('id_module'))
$this->updateConfigBoiteNews($id_module,$article);
$this->_notifyArticleChanged($article);
$this->_helper->notify('Article ajouté');
......@@ -207,14 +207,14 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->view->combo_lieu_options = $this->comboLieuOptions();
}
protected function updateConfigBoiteNews($id_module, $article){
$profil = Class_Profil::getCurrentProfil();
$module_config = $profil->getModuleAccueilConfig($id_module, 'NEWS');
$id_items= array_filter(explode('-',$module_config['preferences']['id_items']));
array_unshift($id_items,$article->getId());
$module_config['preferences']['id_items'] = implode('-',$id_items);
$profil->updateModuleConfigAccueil($id_module, $module_config);
$profil->updateModuleConfigAccueil($id_module, $module_config);
$profil->save();
return $this;
}
......@@ -270,7 +270,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
protected function _isArticleSaved($article) {
if ($this->_request->isPost()) {
$post = $this->_request->getPost();
unset($post['id_items']);
foreach(array('debut', 'fin', 'events_debut', 'events_fin') as $date_field) {
if (array_key_exists($date_field, $post))
......@@ -306,7 +306,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$this->_sendMailToAuteur($article);
}
}
protected function _sendMailWhenUpdatedStatusToValidationPending($article) {
if ($this->_article_old_status != Class_Article::STATUS_VALIDATION_PENDING &&
......@@ -332,13 +332,13 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$article->getTitre(),
$body);
$body = str_replace('URL_ARTICLE',
$this->view->absoluteUrl($article->getUrl(), null, true),
$this->view->absoluteUrl($article->getUrl(), null, true),
$body);
$mail
->setFrom('no-reply@no-reply-afi.fr')
->addTo($mail_address)
->setSubject(quoted_printable_decode('[AFI-OPAC] Refus de l\'article '.$article->getTitre()))
->setSubject(quoted_printable_decode('[Bokeh] Refus de l\'article '.$article->getTitre()))
->setBodyText($body,'utf-8',Zend_Mime::ENCODING_8BIT);
if($this->_sendMail($mail))
$this->_helper->notify('Mail envoyé à: '.$mail_address);
......@@ -363,13 +363,13 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
$article->getTitre(),
$body);
$body = str_replace('URL_ARTICLE',
$this->view->absoluteUrl($article->getUrl(), null, true),
$this->view->absoluteUrl($article->getUrl(), null, true),
$body);
$mail
->setFrom('no-reply@no-reply-afi.fr')
->addTo($mail_address)
->setSubject('[AFI-OPAC] Validation d\'article en attente: '.$article->getTitre())
->setSubject('[Bokeh] Validation d\'article en attente: '.$article->getTitre())
->setBodyText($body);
if($this->_sendMail($mail))
......@@ -446,7 +446,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
['url' => $this->_getUrlForActionAndIdName('catedit'),
'icon' => 'ico/edit.gif',
'label' => 'Modifier'],
['url' => $this->_getUrlForActionAndIdName('catdel'),
'icon' => 'ico/del.gif',
'label' => 'Supprimer',
......@@ -508,7 +508,7 @@ class Admin_CmsController extends ZendAfi_Controller_Action {
return null;
}
public function categoriesAction() {
$this->_helper->viewRenderer->setNoRender();
$this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8');
......
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