<commit_before><?php

/**
 * Organization form.
 *
 * @package    freerms
 * @subpackage form
 * @author     Your name here
 */
class OrganizationForm extends BaseOrganizationForm
{
  public function configure()
  {
    unset( $this['updated_at'] );

    $this->widgetSchema['alt_name']->setLabel('Alternate name');
    $this->widgetSchema['ip_reg_method_id']->setLabel('IP registration method');
    $this->widgetSchema['ip_reg_force_manual']->setLabel('Always do manual IP registration');
    $this->widgetSchema['ip_reg_uri']->setLabel('IP registration URI');
    $this->widgetSchema['ip_reg_username']->setLabel('IP registration username');
    $this->widgetSchema['ip_reg_password']->setLabel('IP registration password');
    $this->widgetSchema['ip_reg_contact_id']->setLabel('IP registration contact');

    $decorator = new freermsWidgetFormatterDiv($this->widgetSchema);
    $this->widgetSchema->addFormFormatter('div', $decorator);
    $this->widgetSchema->setFormFormatterName('div');
  }
}<commit_msg>limit ip_reg_contact_id in OrganizationForm to Contacts for the current Organization:<commit_after><?php

/**
 * Organization form.
 *
 * @package    freerms
 * @subpackage form
 * @author     Your name here
 */
class OrganizationForm extends BaseOrganizationForm
{
  public function configure()
  {
    unset( $this['updated_at'] );

    $this->widgetSchema['alt_name']->setLabel('Alternate name');
    $this->widgetSchema['ip_reg_method_id']->setLabel('IP registration method');
    $this->widgetSchema['ip_reg_force_manual']->setLabel('Always do manual IP registration');
    $this->widgetSchema['ip_reg_uri']->setLabel('IP registration URI');
    $this->widgetSchema['ip_reg_username']->setLabel('IP registration username');
    $this->widgetSchema['ip_reg_password']->setLabel('IP registration password');

    $contact_criteria = new Criteria();
    $contact_criteria->add( ContactPeer::ORG_ID, $this->getObject()->getId() );

    $this->widgetSchema['ip_reg_contact_id'] = new sfWidgetFormPropelChoice( array(
      'model'     => 'Contact',
      'add_empty' => true,
      'criteria'  => $contact_criteria,
      'label'     => 'IP registration contact',
    ) );

    $decorator = new freermsWidgetFormatterDiv($this->widgetSchema);
    $this->widgetSchema->addFormFormatter('div', $decorator);
    $this->widgetSchema->setFormFormatterName('div');
  }
}
{'fraction_non_alphanumeric': 0.15565839293226758, 'fraction_numerical': 0.0, 'mean_word_length': 5.241469816272966, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '3934406', 'n_tokens_mistral': 706, 'n_tokens_neox': 697, 'n_words': 122}