Open Journal Systems  3.3.0
UserGroupForm Class Reference
Inheritance diagram for UserGroupForm:
Form

Public Member Functions

 __construct ($contextId, $userGroupId=null)
 
 _assignStagesToUserGroup ($userGroupId, $userAssignedStages)
 
 _setUserGroupLocaleFields ($userGroup, $request)
 
 execute (... $functionParams)
 
 fetch ($request, $template=null, $display=false)
 
 getContextId ()
 
 getLocaleFieldNames ()
 
 getPermitSelfRegistrationRoles ()
 
 getRecommendOnlyRoles ()
 
 getUserGroupId ()
 
 initData ()
 
 readInputData ()
 
- Public Member Functions inherited from Form
 __construct ($template=null, $callHooks=true, $requiredLocale=null, $supportedLocales=null)
 
 _decomposeArray ($name, $value, $stack)
 
 addCheck ($formValidator)
 
 addError ($field, $message)
 
 addErrorField ($field)
 
 addSupportedFormLocale ($supportedLocale)
 
 display ($request=null, $template=null)
 
 getData ($key)
 
 getDefaultFormLocale ()
 
 getErrorsArray ()
 
 getRequiredLocale ()
 
 getTemplate ()
 
 isValid ()
 
 readUserVars ($vars)
 
 setData ($key, $value=null)
 
 setDefaultFormLocale ($defaultLocale)
 
 setTemplate ($template)
 
 validate ($callHooks=true)
 

Data Fields

 $_contextId
 
 $_userGroupId
 
- Data Fields inherited from Form
 $_checks
 
 $_data
 
 $_errors
 
 $_template
 
 $cssValidation
 
 $defaultLocale
 
 $errorFields
 
 $errorsArray
 
 $formSectionErrors
 
 $requiredLocale
 
 $supportedLocales
 

Detailed Description

Form to add/edit user group.

Definition at line 19 of file UserGroupForm.inc.php.

Constructor & Destructor Documentation

◆ __construct()

UserGroupForm::__construct (   $contextId,
  $userGroupId = null 
)

Constructor.

Parameters
$contextIdContext id.
$userGroupIdUser group id.

Definition at line 39 of file UserGroupForm.inc.php.

References Form\addCheck(), getUserGroupId(), and AppLocale\requireComponents().

Member Function Documentation

◆ _assignStagesToUserGroup()

UserGroupForm::_assignStagesToUserGroup (   $userGroupId,
  $userAssignedStages 
)

Setup the stages assignments to a user group in database.

Parameters
$userGroupIdint User group id that will receive the stages.
$userAssignedStagesarray of stages currently assigned to a user.

Definition at line 235 of file UserGroupForm.inc.php.

References fatalError(), getContextId(), DAORegistry\getDAO(), Form\getData(), and WorkflowStageDAO\getWorkflowStageTranslationKeys().

Referenced by execute().

◆ _setUserGroupLocaleFields()

UserGroupForm::_setUserGroupLocaleFields (   $userGroup,
  $request 
)

Set locale fields on a User Group object.

Parameters
UserGroup
Request
Returns
UserGroup

Definition at line 272 of file UserGroupForm.inc.php.

References Form\$supportedLocales, Form\getData(), and AppLocale\getLocale().

Referenced by execute().

◆ execute()

UserGroupForm::execute (   $functionParams)

Execute the form's action. (Note that it is assumed that the form has already been validated.)

Parameters
mixed$functionArgs,...Arguments from the caller to be passed to the hook consumer
Returns
mixed Result from the consumer to be passed to the caller. Send a true-ish result if you want the caller to do something with the return value.

Reimplemented from Form.

Definition at line 167 of file UserGroupForm.inc.php.

References _assignStagesToUserGroup(), _setUserGroupLocaleFields(), PKPApplication\get(), getContextId(), DAORegistry\getDAO(), Form\getData(), UserGroupDAO\getNotChangeMetadataEditPermissionRoles(), getUserGroupId(), and WorkflowStageDAO\getWorkflowStageTranslationKeys().

◆ fetch()

UserGroupForm::fetch (   $request,
  $template = null,
  $display = false 
)

Returns a string of the rendered form

Parameters
$requestPKPRequest
$templatestring the template to be rendered, mandatory if no template has been specified on class instantiation.
$displayboolean
Returns
string the rendered form

Reimplemented from Form.

Definition at line 131 of file UserGroupForm.inc.php.

References DAORegistry\getDAO(), PKPTemplateManager\getManager(), UserGroupDAO\getNotChangeMetadataEditPermissionRoles(), getPermitSelfRegistrationRoles(), getRecommendOnlyRoles(), Application\getRoleNames(), and getUserGroupId().

◆ getContextId()

UserGroupForm::getContextId ( )

Get the context id.

Returns
int contextId

Definition at line 70 of file UserGroupForm.inc.php.

References $_contextId.

Referenced by _assignStagesToUserGroup(), execute(), and initData().

◆ getLocaleFieldNames()

UserGroupForm::getLocaleFieldNames ( )

Get all locale field names

Reimplemented from Form.

Definition at line 80 of file UserGroupForm.inc.php.

◆ getPermitSelfRegistrationRoles()

UserGroupForm::getPermitSelfRegistrationRoles ( )

Get a list of roles optionally permitting user self-registration.

Returns
array

Definition at line 152 of file UserGroupForm.inc.php.

Referenced by fetch().

◆ getRecommendOnlyRoles()

UserGroupForm::getRecommendOnlyRoles ( )

Get a list of roles optionally permitting recommendOnly option.

Returns
array

Definition at line 160 of file UserGroupForm.inc.php.

Referenced by fetch().

◆ getUserGroupId()

UserGroupForm::getUserGroupId ( )

Get the user group id.

Returns
int userGroupId

Definition at line 62 of file UserGroupForm.inc.php.

References $_userGroupId.

Referenced by __construct(), execute(), fetch(), and initData().

◆ initData()

UserGroupForm::initData ( )

Initialize form data for a new form.

Reimplemented from Form.

Definition at line 87 of file UserGroupForm.inc.php.

References getContextId(), DAORegistry\getDAO(), getUserGroupId(), WorkflowStageDAO\getWorkflowStageTranslationKeys(), and Form\setData().

◆ readInputData()

UserGroupForm::readInputData ( )

Assign form data to user-submitted data. Can be overridden from subclasses.

Reimplemented from Form.

Definition at line 124 of file UserGroupForm.inc.php.

References Form\readUserVars().

Field Documentation

◆ $_contextId

The UserGroupForm::$_contextId

context of the user group being edited

Definition at line 31 of file UserGroupForm.inc.php.

Referenced by getContextId().

◆ $_userGroupId

Id UserGroupForm::$_userGroupId

of the user group being edited

Definition at line 25 of file UserGroupForm.inc.php.

Referenced by getUserGroupId().


The documentation for this class was generated from the following file: