<commit_before><?php

class DRMDetailEntreesForm extends acCouchdbObjectForm {

    public function configure() {
        $configurationDetail = $this->getObject()->getParent()->getConfig();
        $certif = $this->getObject()->getParent()->getCertification()->getkey();
        $appellation = $this->getObject()->getParent()->getAppellation()->getkey();
        $drm = $this->getObject()->getDocument();
        foreach ($configurationDetail->getEntreesSorted() as $key => $value) {
            if ($value->readable) {
                if (!$value->writable
                   || (preg_match('/AOC|IGP/', $certif) && ($key == 'declassement'))
 || ( preg_match('/AUTRES/', $certif) && ($key != 'recolte') && ($key != 'revendication'))
                   || (preg_match('/USAGESINDUSTRIELS/', $appellation) && (!$value->restriction_lies))
		              ||  (preg_match('/VINSSIG/', $certif) && ($key == 'repli'))) {
                    $this->setWidget($key, new bsWidgetFormInputFloat(array(), array('readonly' => 'readonly')));
                } else {
                    $this->setWidget($key, new bsWidgetFormInputFloat());
                }
                $this->setValidator($key, new sfValidatorNumber(array('required' => false, 'min' => 0), array('min' => "La saisie d'un nombre négatif est interdite")));
            }
        }
        $this->widgetSchema->setNameFormat('drm_detail_entrees[%s]');
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

}
<commit_msg>ouverture de transfertsrecolte en entrée pour catégorie autres<commit_after><?php

class DRMDetailEntreesForm extends acCouchdbObjectForm {

    public function configure() {
        $configurationDetail = $this->getObject()->getParent()->getConfig();
        $certif = $this->getObject()->getParent()->getCertification()->getkey();
        $appellation = $this->getObject()->getParent()->getAppellation()->getkey();
        $drm = $this->getObject()->getDocument();
        foreach ($configurationDetail->getEntreesSorted() as $key => $value) {
            if ($value->readable) {
                if (!$value->writable
                   || (preg_match('/AOC|IGP/', $certif) && ($key == 'declassement'))
 || ( preg_match('/AUTRES/', $certif) && ($key != 'recolte') && ($key != 'revendication') && ($key != 'transfertsrecolte'))
                   || (preg_match('/USAGESINDUSTRIELS/', $appellation) && (!$value->restriction_lies))
		              ||  (preg_match('/VINSSIG/', $certif) && ($key == 'repli'))) {
                    $this->setWidget($key, new bsWidgetFormInputFloat(array(), array('readonly' => 'readonly')));
                } else {
                    $this->setWidget($key, new bsWidgetFormInputFloat());
                }
                $this->setValidator($key, new sfValidatorNumber(array('required' => false, 'min' => 0), array('min' => "La saisie d'un nombre négatif est interdite")));
            }
        }
        $this->widgetSchema->setNameFormat('drm_detail_entrees[%s]');
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

}

{'fraction_non_alphanumeric': 0.18758043758043758, 'fraction_numerical': 0.0006435006435006435, 'mean_word_length': 2.866915422885572, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '4334071', 'n_tokens_mistral': 943, 'n_tokens_neox': 904, 'n_words': 147}