Commit 07077ca1 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

api compatibility

parent 086f8334
......@@ -32,7 +32,7 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_DocType extends ZendAfi_Contr
'index' => ['title' => 'Types de documents']
],
'after_edit' => function($model) {$this->_redirect('/admin/type-docs');},
'form' => ZendAfi_Form_TypeDocs_Edit::newWith($this->_getParam('id'))];
'form' => ZendAfi_Form_TypeDocs_Edit::newWithId($this->_getParam('id'))];
}
}
?>
\ No newline at end of file
......@@ -16,18 +16,18 @@
*
* 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
*/
class ZendAfi_Form_TypeDocs_Edit extends ZendAfi_Form {
use Trait_Translator;
public static function newWith($id_type_doc) {
public static function newWithId($id_type_doc) {
$form = new self();
if (!$id_type_doc)
return $form;
$type_doc= Class_TypeDoc::find($id_type_doc);
if (!$type_doc->isRessourceNumerique())
return $form;
......@@ -61,7 +61,7 @@ class ZendAfi_Form_TypeDocs_Edit extends ZendAfi_Form {
->setAttrib('id', 'typedoc_edit')
->setAttrib('class', 'zend_form')
->addElement('text', 'label', ['label' => $this->_('Libellé')])
->addElement('select', 'famille_id', ['label' => $this->_('Famille du document'),
->addElement('select', 'famille_id', ['label' => $this->_('Famille du document'),
'multiOptions' => Class_CodifTypeDoc::getFamillesLibelles(),
'required' => true ]
)
......
Markdown is supported
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