Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -188,6 +188,20 @@ class _Department extends \IPS\Node\Model
|
||||
{
|
||||
return !( $node instanceof \IPS\nexus\Package\Group );
|
||||
} ) ) );
|
||||
|
||||
if ( \IPS\Settings::i()->nexus_subs_enabled )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Node( 'dpt_subscriptions', $this->subscriptions ? array_filter( array_map( function ( $val ) {
|
||||
try
|
||||
{
|
||||
return \IPS\nexus\Subscription\Package::load( $val );
|
||||
} catch ( \OutOfRangeException $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}, explode( ',', $this->subscriptions ) ) ) : 0, FALSE, array('zeroVal' => 'do_not_associate_sub_requests', 'multiple' => TRUE, 'class' => 'IPS\nexus\Subscription\Package', 'zeroValTogglesOff' => array('dpt_require_package') ) ) );
|
||||
}
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'dpt_require_package', $this->require_package, FALSE, array(), NULL, NULL, NULL, 'dpt_require_package' ) );
|
||||
|
||||
$form->addHeader( 'department_staff' );
|
||||
@@ -203,7 +217,7 @@ class _Department extends \IPS\Node\Model
|
||||
$admins[ 'dpt_staff_member' ][ 'm' . $row['row_id'] ] = \IPS\Member::load( $row['row_id'] )->name;
|
||||
}
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'dpt_staff', ( $this->id and $this->staff !== '*' ) ? explode( ',', $this->staff ) : '*', TRUE, array( 'options' => $admins, 'multiple' => TRUE, 'unlimited' => '*' ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'dpt_staff', ( $this->id and $this->staff !== '*' ) ? explode( ',', $this->staff ) : '*', TRUE, array( 'options' => $admins, 'multiple' => TRUE, 'unlimited' => '*', 'parse' => 'normal' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,6 +269,15 @@ class _Department extends \IPS\Node\Model
|
||||
}, array_keys( $values['dpt_packages'] ) ) ) : 0;
|
||||
}
|
||||
|
||||
if ( array_key_exists( 'dpt_subscriptions', $values ) )
|
||||
{
|
||||
$values['dpt_subscriptions'] = is_array( $values['dpt_subscriptions'] ) ? implode( ',', array_keys( $values['dpt_subscriptions'] ) ) : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$values['dpt_subscriptions'] = 0;
|
||||
}
|
||||
|
||||
if ( ( array_key_exists( 'dpt_require_package', $values ) AND is_null( $values['dpt_require_package'] ) ) or $values['dpt_packages'] == 0 )
|
||||
{
|
||||
$values['dpt_require_package'] = 0;
|
||||
@@ -393,11 +416,12 @@ class _Department extends \IPS\Node\Model
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string name Name
|
||||
*/
|
||||
public function apiOutput()
|
||||
public function apiOutput( \IPS\Member $authorizedMember = NULL )
|
||||
{
|
||||
return array(
|
||||
'id' => $this->_id,
|
||||
|
||||
Reference in new issue
Block a user