Пример #1
0
 /**
  * @param APPLICATION $context Main application.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new ENUMERATED_FIELD();
     $field->id = 'publication_state';
     $field->caption = 'Notifications';
     $field->add_value(History_item_default);
     $field->add_value(History_item_silent);
     $field->add_value(History_item_needs_send);
     $this->add_field($field);
     $field = new MUNGER_TITLE_FIELD();
     $field->id = 'history_item_title';
     $field->caption = 'Title';
     $field->description = 'This will be used as the notification title; if none is given, a default is selected based on the changes made.';
     $this->add_field($field);
     $field = new MUNGER_TEXT_FIELD();
     $field->id = 'history_item_description';
     $field->caption = 'Description';
     $field->description = 'This is a quick description of why the change was made.';
     $this->add_field($field);
     $field = new DATE_TIME_FIELD();
     $field->id = 'time_modified';
     $field->caption = 'Last modified';
     $field->visible = false;
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'update_modifier_on_change';
     $field->caption = 'Update Modifier';
     $field->description = 'Store currently logged-in user as last modifier; turn off to maintain the existing user as modifier.';
     $field->visible = false;
     $this->add_field($field);
 }
 /**
  * @param APPLICATION $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new ENUMERATED_FIELD();
     $field->id = 'sub_history_item_publication_state';
     $field->caption = 'Notifications';
     $field->add_value(History_item_needs_send);
     $field->add_value(History_item_silent);
     $this->add_field($field);
 }
 /**
  * @param APPLICATION $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new ENUMERATED_FIELD();
     $field->id = 'copy_mode';
     $field->caption = '';
     $field->add_value(Security_copy_none);
     $field->add_value(Security_copy_current);
     $field->add_value(Security_create_admin);
     $this->add_field($field);
 }
Пример #4
0
 /**
  * @param PROJECT $folder Project to edit or project in which to add.
  */
 public function __construct($folder)
 {
     parent::__construct($folder);
     $field = new BOOLEAN_FIELD();
     $field->id = 'defines_options';
     $field->caption = 'Defines options';
     $this->add_field($field);
     include_once 'projects/obj/project_options.php';
     // include the constants used below
     $field = new ENUMERATED_FIELD();
     $field->id = 'assignee_group_type';
     $field->caption = 'Assignees';
     $field->add_value(Project_user_all);
     $field->add_value(Project_user_registered_only);
     $field->add_value(Project_user_group);
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'assignee_group_id';
     $field->caption = 'Assignee group id';
     $field->min_value = 1;
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'reporter_group_type';
     $field->caption = 'Reporters';
     $field->add_value(Project_user_all);
     $field->add_value(Project_user_registered_only);
     $field->add_value(Project_user_group);
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'reporter_group_id';
     $field->caption = 'Reporter group id';
     $field->min_value = 1;
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'seconds_until_deadline';
     $field->caption = 'Releases';
     $field->description = 'Show a warning for releases with a deadline within this many days.';
     $field->min_value = 0;
     $this->add_field($field);
     // only shown for existing objects
     $field = new INTEGER_FIELD();
     $field->id = 'trunk_id';
     $field->caption = 'Trunk';
     $field->description = 'Default branch for new jobs and changes.';
     $field->min_value = 1;
     $this->add_field($field);
     // only shown for new objects
     $field = new TITLE_FIELD();
     $field->id = 'branch_title';
     $field->caption = 'Branch title';
     $field->description = 'Fill in the name of the default branch for this project.';
     $this->add_field($field);
 }
 /**
  * @param APPLICATION $context
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new ENUMERATED_FIELD();
     $field->id = 'sub_history_item_publication_state';
     $field->caption = 'Notifications';
     $field->add_value(History_item_needs_send);
     $field->add_value(History_item_silent);
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'replacement_component_id';
     $field->caption = 'Replace with';
     $field->description = 'Replace all references with this component.';
     $this->add_field($field);
 }
Пример #6
0
 function __construct($context)
 {
     parent::__construct($context);
     $field = new INTEGER_FIELD();
     $field->id = 'radio';
     $field->caption = 'Radio';
     $this->add_field($field);
     $field = new TEXT_FIELD();
     $field->id = 'name';
     $field->caption = 'Name';
     $field->required = true;
     $this->add_field($field);
     $this->set_value('name', 'Filler text');
     $field = new MUNGER_TEXT_FIELD();
     $field->id = 'description';
     $field->caption = 'Description';
     $this->add_field($field);
     $this->set_value('description', 'Filler text that demonstrates which font is being used in longer, wrapping text.');
     $field = new DATE_TIME_FIELD();
     $field->id = 'date';
     $field->caption = 'Date';
     $this->add_field($field);
     $this->set_value('date', new DATE_TIME());
     $field = new BOOLEAN_FIELD();
     $field->id = 'bool1';
     $field->set_value(1);
     $field->caption = 'Option 1';
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'bool2';
     $field->caption = 'Option 2';
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'select';
     $field->caption = 'Select';
     $field->add_value(0);
     $field->add_value(1);
     $field->add_value(2);
     $field->add_value(3);
     $field->required = true;
     $this->add_field($field);
 }
 /**
  * @param APPLICATION $context Main application.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new TEXT_FIELD();
     $field->id = 'recipients';
     $field->caption = 'Recipients';
     $field->description = 'Type each email on its own line.';
     $field->required = true;
     $field->tag_validator_type = Tag_validator_none;
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'email_type';
     $field->caption = 'Email Options';
     $field->description = '*May time out if many emails are specified.';
     $field->add_value('single_mail');
     $field->add_value('multiple_mail');
     $this->add_field($field);
     $field = $this->field_at('send_to');
     $field->required = false;
 }
 /**
  * @param PROJECT $folder Project in which to add or edit the PROJECT_ENTRY.
  */
 public function __construct($folder)
 {
     parent::__construct($folder);
     $field = new MUNGER_TEXT_FIELD();
     $field->id = 'extra_description';
     $field->caption = 'Description';
     $field->description = 'This information is not shown in job lists or change logs, ' . ' but is always available when a job is viewed alone. If it\'s' . ' a bug, store the stack trace or log output here. If it\'s a' . ' new feature, store examples and a more in-depth description here.';
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'kind';
     $field->caption = 'Kind';
     $field->required = true;
     $field->sticky = true;
     $kinds = $this->app->display_options->entry_kinds();
     if (sizeof($kinds)) {
         foreach ($kinds as $kind) {
             $field->add_value($kind->value);
         }
     }
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'component_id';
     $field->caption = 'Component';
     $field->sticky = true;
     $this->add_field($field);
     $branch_query = $folder->branch_query();
     $this->branches = $branch_query->objects();
     $this->default_branch_id = $folder->trunk_id;
     foreach ($this->branches as $branch) {
         $this->_add_fields_for_branch($branch);
     }
     $field = new INTEGER_FIELD();
     $field->id = "main_branch_id";
     $field->caption = "Main Branch";
     $field->min_value = 1;
     $this->add_field($field);
     $field = $this->field_at('description');
     $field->caption = 'Summary';
     $field->description = 'A short description that is shown in change logs and job lists.' . ' Longer text that should not appear in summaries should go in' . ' the \'Extra Information\' field below.';
 }
Пример #9
0
 /**
  * @param APPLICATION $context Main application.
  */
 public function __construct($context)
 {
     parent::__construct($context);
     $field = new TEXT_FIELD();
     $field->id = 'name';
     $field->caption = 'Original name';
     $field->visible = false;
     $this->add_field($field);
     $field = new TEXT_FIELD();
     $field->id = 'password1';
     $field->caption = 'Password';
     $field->min_length = $this->app->user_options->minimum_password_length;
     $field->max_length = 100;
     $this->add_field($field);
     $field = new TEXT_FIELD();
     $field->id = 'password2';
     $field->caption = 'Confirm Password';
     $field->min_length = $this->app->user_options->minimum_password_length;
     $field->max_length = 100;
     $this->add_field($field);
     $field = new EMAIL_FIELD();
     $field->id = 'orig_email';
     $field->caption = 'Original email address';
     $field->visible = false;
     $this->add_field($field);
     $field = new EMAIL_FIELD();
     $field->id = 'email';
     $field->caption = 'Email address';
     $field->description = 'Allows you to sign up for subscriptions.';
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->add_value(User_email_hidden);
     $field->add_value(User_email_scrambled);
     $field->add_value(User_email_visible);
     $field->id = 'email_visibility';
     $field->caption = '';
     $this->add_field($field);
     $field = new TITLE_FIELD();
     $field->id = 'real_first_name';
     $field->caption = 'First name';
     $this->add_field($field);
     $field = new TITLE_FIELD();
     $field->id = 'real_last_name';
     $field->caption = 'Last name';
     $this->add_field($field);
     $field = new URI_FIELD();
     $field->id = 'home_page_url';
     $field->caption = 'Home page';
     $this->add_field($field);
     $field = new URI_FIELD();
     $field->id = 'picture_url';
     $field->caption = 'Picture';
     $this->add_field($field);
     $field = new URI_FIELD();
     $field->id = 'icon_url';
     $field->caption = 'Icon URL';
     $this->add_field($field);
     $field = new MUNGER_TEXT_FIELD();
     $field->id = 'signature';
     $field->caption = 'Signature';
     $this->add_field($field);
     $field = $this->_fields['title'];
     $field->caption = 'Name';
 }
 /**
  * Initialize the form with a search object.
  * If the search is <c>null</c>, the form will be shown in "quick search"
  * mode. This shows only the text search and a drop-down to select the type
  * of object to search.
  * @param APPLICATION $context Main application.
  * @param SEARCH $search Build the form based on this search object.
  */
 public function __construct($context, $search)
 {
     parent::__construct($context);
     $this->_search = $search;
     $entry_type_infos = $this->app->entry_type_infos();
     $type = $entry_type_infos[0]->id;
     if (isset($this->_search)) {
         $search->fields->add_fields($this);
     } else {
         $this->action_anchor = '';
         $field = new TEXT_FIELD();
         $field->id = 'search_text';
         $field->caption = '';
         $this->add_field($field);
         $search_template = $this->app->make_search($type);
         $search_template->fields->add_fields($this, false);
     }
     $field = new BOOLEAN_FIELD();
     $field->id = 'quick_search';
     $field->caption = 'Quick Search';
     $field->visible = false;
     $field->set_value(true);
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'type';
     $field->caption = '';
     $field->visible = !isset($this->_search);
     /* Fill with all the registered search types. */
     $type_infos = $this->app->search_type_infos();
     foreach ($type_infos as $t) {
         $field->add_value($t->id);
     }
     $this->add_field($field);
     /* Set the first entry type as the default search. */
     if (!empty($entry_type_infos)) {
         $this->set_value('type', $type);
     }
 }
Пример #11
0
 /**
  * @param ALBUM $folder Album to edit or create.
  */
 public function __construct($folder)
 {
     parent::__construct($folder);
     $field = new URI_FIELD();
     $field->id = 'url_root';
     $field->caption = 'Root URL';
     $field->required = true;
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'show_times';
     $field->caption = 'Show times';
     $field->description = 'Shows times with albums, picture and journals for finer detail.';
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'show_celsius';
     $field->caption = 'Show celsius';
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'max_picture_height';
     $field->caption = 'Maximum picture height';
     $field->min_value = 0;
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'max_picture_width';
     $field->caption = 'Maximum picture width';
     $field->min_value = 0;
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'date_style';
     $field->caption = '';
     $field->add_value(Album_is_single_day);
     $field->add_value(Album_is_span);
     $field->add_value(Album_is_journal);
     $field->add_value(Album_is_adjusted);
     $field->required = true;
     $this->add_field($field);
     $field = new DATE_FIELD();
     $field->id = 'first_day';
     $field->caption = 'First day';
     $this->add_field($field);
     $field = new DATE_FIELD();
     $field->id = 'last_day';
     $field->caption = 'Last day';
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'constrain_picture_size';
     $field->caption = 'Display pictures as';
     $field->description = 'Constrain larger pictures to this initial size.';
     $this->add_field($field);
     $field = new INTEGER_FIELD();
     $field->id = 'main_picture_id';
     $field->caption = 'Key photo';
     $field->min_value = 0;
     $field->visible = false;
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = 'location';
     $field->caption = 'Location';
     $field->required = true;
     $field->add_value(Album_location_type_local);
     $field->add_value(Album_location_type_remote);
     $this->add_field($field);
     $field = new BOOLEAN_FIELD();
     $field->id = 'url_root_enabled';
     $field->caption = '';
     $field->description = 'Check to change the Root URL. For advanced users only -- pictures are not moved when the root is changed.';
     $this->add_field($field);
 }
Пример #12
0
 /**
  * Add fields for search properties to this form.
  * @param FORM $form
  * @param boolean $extra_visibility Default visibility for extra search fields.
  */
 public function add_fields($form, $extra_visibility = true)
 {
     parent::add_fields($form);
     $field = new ENUMERATED_FIELD();
     $field->id = 'user_kind';
     $field->caption = 'Kind';
     $field->description = 'Restrict to certain types of users.';
     $field->add_value('all');
     $field->add_value(Privilege_kind_anonymous);
     $field->add_value(Privilege_kind_registered);
     $form->add_field($field);
 }
Пример #13
0
 /**
  * Create the per-branch fields for this form.
  * @param BRANCH $branch
  * @access private
  */
 protected function _add_fields_for_branch($branch)
 {
     parent::_add_fields_for_branch($branch);
     $field = new ENUMERATED_FIELD();
     $field->id = "branch_{$branch->id}_status";
     $field->caption = "Status";
     $field->enabled = isset($_REQUEST[$field->id]);
     $field->sticky = true;
     /** @var $display_options PROJECT_APPLICATION_DISPLAY_OPTIONS */
     $display_options = $this->app->display_options;
     $statuses = $display_options->job_statuses();
     if (sizeof($statuses)) {
         foreach ($statuses as $status) {
             $field->add_value($status->value);
         }
     }
     $this->add_field($field);
     $field = new ENUMERATED_FIELD();
     $field->id = "branch_{$branch->id}_priority";
     $field->caption = "Priority";
     $field->enabled = isset($_REQUEST[$field->id]);
     $field->sticky = true;
     $priorities = $display_options->job_priorities();
     if (sizeof($priorities)) {
         foreach ($priorities as $priority) {
             $field->add_value($priority->value);
         }
     }
     $this->add_field($field);
 }