function GroundEditControl(SiteSettings $o_settings) { # set up element $this->SetDataObjectClass('Ground'); $this->o_address_edit = new PostalAddressEditControl(); parent::__construct($o_settings); }
/** * Creates a new PersonEditControl * * @param SiteSettings $o_settings */ public function __construct(SiteSettings $o_settings) { # set up element $this->SetDataObjectClass('User'); parent::__construct($o_settings); $this->roles_editor = new RelatedIdEditor($this->GetSettings(), $this, "roles", "Roles", array("Role"), "Role", false, "getRoleId", "setRoleId", "setRoleName"); }
/** * @return void * @desc Create DataValidator objects to validate the edit control */ public function CreateValidators() { # Validate existing rows only if 'add' or 'delete' not clicked, # because those buttons should only affect the row those buttons relate to. $i_rows_posted = count($this->a_rows_posted); if (!$this->controlling_editor->IsInternalPostback() and $i_rows_posted) { $i_last_item = $this->a_rows_posted[$i_rows_posted - 1]; foreach ($this->a_rows_posted as $i) { if ($i == $i_last_item and $this->Adding()) { continue; } # ignore last one if it's the new row $this->CreateValidatorsForItem($i); } } # Validate the new row, unless 'delete' was clicked on another row in this control, # because then only the deleted row should be affected, or unless any internal # button in another control was clicked. if (!$this->DeleteClicked() and !$this->IsUnrelatedInternalPostback()) { $this->CreateValidatorsForItem(); } # If saving, and this control doesn't have its minimum number of items, force a validation error $i_total_items = $this->DataObjects()->GetCount(); if ($i_total_items < $this->i_min_items and !$this->controlling_editor->IsInternalPostback()) { $force_invalid = new RequiredFieldValidator('ForceInvalid', 'Please add at least one item in \'' . strtolower($this->table->GetCaption()) . '\''); $force_invalid->SetValidIfNotFound(false); $this->AddValidator($force_invalid); } }
/** * Creates a new EditSchoolControl * * @param SiteSettings $settings */ public function __construct(SiteSettings $settings) { # set up element $this->SetDataObjectClass('School'); parent::__construct($settings); $this->is_admin = AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_TEAMS); }
public function __construct(SiteSettings $settings, User $user, AuthenticationManager $authentication_manager) { $this->user = $user; $this->authentication_manager = $authentication_manager; $this->SetDataObjectClass('User'); parent::__construct($settings); }
public function __construct(SiteSettings $settings, User $o_person) { $this->o_person = $o_person; $this->SetDataObjectClass('User'); $this->SetButtonText('Reset password'); parent::__construct($settings); }
public function __construct(SiteSettings $settings, CategoryCollection $categories) { # set up element $this->SetDataObjectClass('Competition'); parent::__construct($settings); # store params $this->categories = $categories; }
function CategoryEditControl(SiteSettings $o_settings, CategoryCollection $o_categories) { # check input and store $this->o_categories = $o_categories; # set up element $this->SetDataObjectClass('Category'); parent::__construct($o_settings); }
public function __construct(SiteSettings $settings) { # set up element $this->SetDataObjectClass('Match'); parent::__construct($settings); $this->SetAllowCancel(true); # check permissions $this->b_user_is_match_admin = AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_MATCHES); }
/** * Creates a TournamentSeasonsControl * * @param SiteSettings $o_settings * @param Match $match * @param bool $b_entire_form */ public function __construct(SiteSettings $o_settings, Match $match = null, $b_entire_form = true) { $this->SetDataObjectClass('Match'); if (!is_null($match)) { $match->SetMatchType(MatchType::TOURNAMENT); $this->SetDataObject($match); } parent::__construct($o_settings, $b_entire_form); $this->seasons = new Collection(); $this->SetAllowCancel(true); # Change Save button to "Save tournament" $this->SetButtonText('Save tournament'); }
function __construct($o_settings, $a_addresses) { if (!is_array($a_addresses) or !count($a_addresses)) { die('Must supply at least one contact address for the email form'); } # set up element $this->SetDataObjectClass('Zend_Mail'); $this->SetButtonText('Send email'); $this->a_addresses = $a_addresses; $this->a_addresses_md5 = array(); foreach ($this->a_addresses as $s_addr => $s_text) { $this->a_addresses_md5[md5($s_addr)] = $s_addr; } parent::__construct($o_settings); }
/** * Creates a SeasonEditControl * * @param SiteSettings $o_settings */ public function __construct(SiteSettings $o_settings) { # set up element $this->SetDataObjectClass('Season'); parent::__construct($o_settings); # set up aggregated editors $this->match_types_editor = new RelatedIdEditor($o_settings, $this, 'MatchType', 'Match types', array('Type of match'), 'IdValue', false, 'GetId', 'SetId', 'GetValue'); $this->match_types_editor->SetMinimumItems(1); $this->match_types_editor->SetPossibleDataObjects(array(new IdValue(MatchType::CUP, ucfirst(MatchType::Text(MatchType::CUP))), new IdValue(MatchType::FRIENDLY, ucfirst(MatchType::Text(MatchType::FRIENDLY))), new IdValue(MatchType::LEAGUE, ucfirst(MatchType::Text(MatchType::LEAGUE))), new IdValue(MatchType::PRACTICE, ucfirst(MatchType::Text(MatchType::PRACTICE))), new IdValue(MatchType::TOURNAMENT, ucfirst(MatchType::Text(MatchType::TOURNAMENT))))); #$this->match_types_editor->SetValuesToExclude(array(MatchType::TournamentMatch())); # Tournament match is implied by Tournament $this->adjustments_editor = new PointsAdjustmentsEditor($o_settings, $this, 'Points', 'Points adjustments', array('Points', 'Awarded or deducted', 'Team', 'Reason')); $this->teams_editor = new TeamsInSeasonEditor($o_settings, $this, 'Team', 'Teams', array('Team', 'Withdrawn')); # initialise arrays $this->result_types = array(new MatchResult(MatchResult::HOME_WIN), new MatchResult(MatchResult::AWAY_WIN), new MatchResult(MatchResult::HOME_WIN_BY_FORFEIT), new MatchResult(MatchResult::AWAY_WIN_BY_FORFEIT), new MatchResult(MatchResult::TIE), new MatchResult(MatchResult::POSTPONED), new MatchResult(MatchResult::CANCELLED), new MatchResult(MatchResult::ABANDONED)); }
/** * Creates a MatchFixtureEditControl * * @param SiteSettings $o_settings * @param Match $o_match * @param bool $b_entire_form */ public function __construct(SiteSettings $o_settings, Match $o_match = null, $b_entire_form = true) { $this->SetDataObjectClass('Match'); if (!is_null($o_match)) { $this->SetDataObject($o_match); } parent::__construct($o_settings, $b_entire_form); $this->a_teams = array(); $this->a_grounds = array(); $this->SetButtonText('Save match'); $this->i_match_type = MatchType::FRIENDLY; $this->seasons = new Collection(); if (AuthenticationManager::GetUser()->Permissions()->HasPermission(PermissionType::MANAGE_MATCHES)) { $this->b_user_is_admin = true; } }
/** * Creates a new RoleEditControl * * @param SiteSettings $settings */ public function __construct(SiteSettings $settings) { $this->SetDataObjectClass('Role'); parent::__construct($settings); $this->permissions_editor = new PermissionsEditor($this->GetSettings(), $this, "permissions", "Permissions"); }
/** * Adds a data edit control to the aggregated edit controls * * @param DataEditControl $o_control */ public function AddControl($o_control) { if (!$o_control instanceof DataEditControl) { return; } $o_control->SetNamingPrefix($o_control->GetDataObjectClass() . $o_control->GetDataObject()->GetId()); $o_control->SetShowValidationErrors(false); $this->a_controls_to_render[] = $o_control; }
/** * Creates a ClubEditControl * @param SiteSettings $settings * @return ClubEditControl */ public function __construct(SiteSettings $settings) { # set up element $this->SetDataObjectClass('Club'); parent::__construct($settings); }
/** * Creates a PlayerEditor * @param SiteSettings $settings * @return void */ public function __construct(SiteSettings $settings) { $this->SetDataObjectClass('Player'); parent::__construct($settings); }
/** * Creates a new MatchResultEditControl * @param SiteSettings $o_settings * @param Match $o_match * @return void */ public function __construct(SiteSettings $o_settings, Match $o_match = null) { $this->SetDataObjectClass('Match'); $this->SetDataObject($o_match); parent::__construct($o_settings, false); }
/** * Add audit data after save button */ function OnPreRender() { parent::OnPreRender(); # Show audit data $team = $this->GetDataObject(); if ($team->GetLastAudit() != null) { require_once "data/audit-control.class.php"; $this->AddControl(new AuditControl($team->GetLastAudit(), "team")); } }
function __construct(SiteSettings $settings) { $this->SetDataObjectClass('Zend_Mail'); $this->SetButtonText('Send email'); parent::__construct($settings); }