diff --git a/library/ZendAfi/Form/SendMail.php b/library/ZendAfi/Form/SendMail.php index 6261f389040724c082085832aae8dc7a5c700fb6..6f13a9e375901560ce10f0dc8b198103647dcc4e 100644 --- a/library/ZendAfi/Form/SendMail.php +++ b/library/ZendAfi/Form/SendMail.php @@ -30,12 +30,14 @@ class ZendAfi_Form_SendMAil extends ZendAfi_Form { ->addElement('email', 'recipient', ['label' => $this->_('Destinataire'), + 'size' => '80', 'required' => true, 'allowEmpty' => false]) ->addElement('text', 'subject', ['label' => $this->_('Objet du mail'), + 'size' => '80', 'required' => true, 'allowEmpty' => false]) diff --git a/library/ZendAfi/View/Helper/ModelFusionLink.php b/library/ZendAfi/View/Helper/ModeleFusion/Link.php similarity index 75% rename from library/ZendAfi/View/Helper/ModelFusionLink.php rename to library/ZendAfi/View/Helper/ModeleFusion/Link.php index 7e78013b2069e9df4713b693bf72bb0780bdca9a..077555eac9cbb8f3dab92e913c03857aff450ee9 100644 --- a/library/ZendAfi/View/Helper/ModelFusionLink.php +++ b/library/ZendAfi/View/Helper/ModeleFusion/Link.php @@ -20,9 +20,9 @@ */ -class ZendAfi_View_Helper_ModelFusionLink extends ZendAfi_View_Helper_BaseHelper { +class ZendAfi_View_Helper_ModeleFusion_Link extends ZendAfi_View_Helper_BaseHelper { - public function modelFusionLink($instance) { + public function ModeleFusion_Link($instance) { if(!$instance) return ''; @@ -35,18 +35,27 @@ class ZendAfi_View_Helper_ModelFusionLink extends ZendAfi_View_Helper_BaseHelpe if(!$model_fusion) return ''; - $ids = array_map( - function($model) { - return $model->getId(); - }, - $instance->getModels()); + $ids = $instance->getIds() + ? $this->_getIds($instance->getIds()) + : array_map( + function($model) { + return $model->getId(); + }, + $instance->getModels()); return $this->view->tagAnchor($this->view->url( ['action' => $instance->getAction(), - 'ids' => implode(';',$ids), + 'ids' => $ids, 'strategy' => $instance->getStrategy(), 'modele_fusion' => $model_fusion->getId()]), $instance->getLink(), $instance->getAttribs()); } + + + protected function _getIds($data) { + if(is_callable($data)) + return call_user_func($data); + return $data; + } } ?> \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Search/Header.php b/library/ZendAfi/View/Helper/Search/Header.php index 5ccc6229adab0414a47f4610a469895d1f681be9..f84286f82306a30b069ed4a7e23339a497929734 100644 --- a/library/ZendAfi/View/Helper/Search/Header.php +++ b/library/ZendAfi/View/Helper/Search/Header.php @@ -75,6 +75,7 @@ class ZendAfi_View_Helper_Search_Header extends ZendAfi_View_Helper_BaseHelper { protected function _tagSearchActions() { $instance = (new Class_Entity()) ->setModels($this->_search_result->fetchRecords()) + ->setIds(implode(';', array_slice($this->_search_result->fetchAllRecordsIds(), 0, 200))) ->setStrategy('Notice_List'); $actions = [$this->_tag('span', diff --git a/library/ZendAfi/View/Helper/TagPrintLink.php b/library/ZendAfi/View/Helper/TagPrintLink.php index 388b93ca00c7918d864ad708a8139816e1bf8f84..4e1c36440b002f38e7341220173592abea6457eb 100644 --- a/library/ZendAfi/View/Helper/TagPrintLink.php +++ b/library/ZendAfi/View/Helper/TagPrintLink.php @@ -20,7 +20,7 @@ */ -class ZendAfi_View_Helper_TagPrintLink extends ZendAfi_View_Helper_ModelFusionLink { +class ZendAfi_View_Helper_TagPrintLink extends ZendAfi_View_Helper_ModeleFusion_Link { public function tagPrintLink($instance) { $instance @@ -28,7 +28,7 @@ class ZendAfi_View_Helper_TagPrintLink extends ZendAfi_View_Helper_ModelFusionL ->setLink($this->_('Imprimer')) ->setAttribs(['target' => '_blank']); - return $this->modelFusionLink($instance); + return $this->ModeleFusion_Link($instance); } } ?> \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/TagSendMail.php b/library/ZendAfi/View/Helper/TagSendMail.php index 53cd24c68cad22fde91e0b1988f3057408ccf205..791a6d2b9795eba381d5720c68868bd1f35ba256 100644 --- a/library/ZendAfi/View/Helper/TagSendMail.php +++ b/library/ZendAfi/View/Helper/TagSendMail.php @@ -20,7 +20,7 @@ */ -class ZendAfi_View_Helper_TagSendMail extends ZendAfi_View_Helper_ModelFusionLink { +class ZendAfi_View_Helper_TagSendMail extends ZendAfi_View_Helper_ModeleFusion_Link { public function tagSendMail($instance) { $instance @@ -28,7 +28,7 @@ class ZendAfi_View_Helper_TagSendMail extends ZendAfi_View_Helper_ModelFusionLi ->setLink($this->_('Partager par email')) ->setAttribs(['data-popup' => 'true']); - return $this->modelFusionLink($instance); + return $this->ModeleFusion_Link($instance); } } ?> \ No newline at end of file