<commit_before><?php

abstract class DRMESDetailsItemForm extends acCouchdbObjectForm {

    protected $isTeledeclarationMode = null;

    public function __construct(acCouchdbJson $object, $options = array(), $CSRFSecret = null) {
        $this->isTeledeclarationMode = $options['isTeledeclarationMode'];
        parent::__construct($object, $options, $CSRFSecret);
    }

    public function configure() {

      $this->setWidget('identifiant', new bsWidgetFormChoice(array('choices' => $this->getIdentifiantChoices()), array('class' => 'autocomplete')));
      $this->setWidget('volume', new bsWidgetFormInputFloat(array(), array('autocomplete' => 'off')));


      $this->setWidget('numero_document', new bsWidgetFormInput());
      $this->setWidget('type_document', new bsWidgetFormChoice(array('choices' => array_merge(array("" => ""), $this->getTypeDocumentsChoices()))));


      $this->setValidator('identifiant', new sfValidatorChoice(array('required' => true, 'choices' => array_keys($this->getIdentifiantChoices()))));
      $this->setValidator('volume', new sfValidatorNumber(array('required' => true, 'min' => 0), array('min' => "La saisie d'un nombre négatif est interdite")));

      $this->setValidator('numero_document', new sfValidatorString(array('required' => false)));
      $this->setValidator('type_document', new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->getTypeDocumentsChoices()))));

      $post_validator_class = $this->getPostValidatorClass();
      $this->validatorSchema->setPostValidator(new $post_validator_class());
      $this->widgetSchema->setNameFormat(sprintf("%s[%%s]", $this->getFormName()));
      $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

    public function updateDefaultsFromObject() {
        parent::updateDefaultsFromObject();
    }

    public function doUpdateObject($values) {
        parent::doUpdateObject($values);
        $date = new DateTime($this->getObject()->getDocument()->getDate());
        $this->getObject()->date_enlevement = $date->format('Y-m-d');
    }<commit_msg>Date d'enlevement non obligatoire dans une popup de détail<commit_after><?php

abstract class DRMESDetailsItemForm extends acCouchdbObjectForm {

    protected $isTeledeclarationMode = null;

    public function __construct(acCouchdbJson $object, $options = array(), $CSRFSecret = null) {
        $this->isTeledeclarationMode = $options['isTeledeclarationMode'];
        parent::__construct($object, $options, $CSRFSecret);
    }

    public function configure() {

      $this->setWidget('identifiant', new bsWidgetFormChoice(array('choices' => $this->getIdentifiantChoices()), array('class' => 'autocomplete')));
      $this->setWidget('volume', new bsWidgetFormInputFloat(array(), array('autocomplete' => 'off')));


      $this->setWidget('numero_document', new bsWidgetFormInput());
      $this->setWidget('type_document', new bsWidgetFormChoice(array('choices' => array_merge(array("" => ""), $this->getTypeDocumentsChoices()))));


      $this->setValidator('identifiant', new sfValidatorChoice(array('required' => true, 'choices' => array_keys($this->getIdentifiantChoices()))));
      $this->setValidator('volume', new sfValidatorNumber(array('required' => true, 'min' => 0), array('min' => "La saisie d'un nombre négatif est interdite")));

      $this->setValidator('numero_document', new sfValidatorString(array('required' => false)));
      $this->setValidator('type_document', new sfValidatorChoice(array('required' => false, 'choices' => array_keys($this->getTypeDocumentsChoices()))));

      $post_validator_class = $this->getPostValidatorClass();
      $this->validatorSchema->setPostValidator(new $post_validator_class());
      $this->widgetSchema->setNameFormat(sprintf("%s[%%s]", $this->getFormName()));
      $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

    public function updateDefaultsFromObject() {
        parent::updateDefaultsFromObject();
    }

    public function doUpdateObject($values) {
        parent::doUpdateObject($values);
        if($this->getObject()->exist('date_enlevement')) {
            $date = new DateTime($this->getObject()->getDocument()->getDate());
            $this->getObject()->date_enlevement = $date->format('Y-m-d');
        }
    }
{'fraction_non_alphanumeric': 0.16897506925207756, 'fraction_numerical': 0.0004616805170821791, 'mean_word_length': 5.316326530612245, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1374298', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1225, 'n_words': 201}