Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,13 +1,12 @@
<?php
/**
* @brief Custom Customer Field Node
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Nexus
* @since 16 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\nexus\Customer;
@@ -91,7 +90,7 @@ class _CustomField extends \IPS\CustomField
*/
public static $databaseColumnMap = array(
'content' => 'extra',
'not_null' => 'required',
'not_null' => 'reg_require'
);
/**
@@ -113,9 +112,15 @@ class _CustomField extends \IPS\CustomField
public function form( &$form )
{
parent::form( $form );
$form->addHeader( 'customer_field_registration' );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_reg_show', $this->reg_show ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_reg_require', $this->reg_require ) );
if ( ! \IPS\Settings::i()->quick_register )
{
/* Quick register is disabled */
$form->addHeader( 'customer_field_registration' );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_reg_show', $this->reg_show ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_reg_require', $this->reg_require ) );
}
$form->addHeader( 'customer_field_purchase' );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_purchase_show', $this->purchase_show ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'f_purchase_require', $this->purchase_require ) );
@@ -166,6 +171,14 @@ class _CustomField extends \IPS\CustomField
{
parent::delete();
static::recountCustomerFields();
if ( isset( static::$multitons[ $this->id ] ) )
{
unset( static::$multitons[ $this->id ] );
}
/* Do we need to do stuff with profile steps? */
\IPS\Member\ProfileStep::resync();
}
/**
@@ -180,4 +193,18 @@ class _CustomField extends \IPS\CustomField
\IPS\Settings::i()->customer_fields = $count;
unset( \IPS\Data\Store::i()->settings );
}
/**
* [Node] Format form values from add/edit form for save
*
* @param array $values Values from the form
* @return array
*/
public function formatFormValues( $values )
{
$values['allow_attachments'] = $values['pf_allow_attachments'];
unset( $values['pf_allow_attachments'] );
return parent::formatFormValues( $values );
}
}