CreatePage
class CreatePage extends FormPage (View source)
CreatePage class
Properties
protected string | $head | from Page | |
protected string | $title | from Page | |
protected string | $access_permission | from Page | |
protected array | $tabs | from Page | |
protected array | $main_subtitle | from Page | |
protected string | $tabs_picture | from Page | |
protected string | $tabs_title | from Page | |
protected string | $active_tab | from Page | |
protected boolean | $close_form | from Page | |
protected boolean | $close_table | from Page | |
protected boolean | $add_fiche_end | from Page | |
protected string | $rights_class | from Page | |
protected string | $modulepart | from Page | |
protected array | $assets | from Page | |
object | $form | from FormPage | |
protected string | $body | from FormPage | |
protected array | $fields | from FormPage | |
protected object | $extrafields |
Methods
Constructor
Add a subtitle
Opens a new html table
Include a template into the page.
Check specified field
Show a confirmation message
Check page extrafields
Add a table field
Add a table field with a text input
Add a table field with a text area
Add a table field with a number input
Add a table field with a date picker
Add a table field with a list
Add a table field with a radio input(s)
Add a table field with a checkbox input(s)
Add a table field with a color picker
Add extra fields
Generate form buttons
Details
at line 39
__construct($page_title, $access_perm = '')
Constructor
$this
setTitle($page_title)
Set page title.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setMainSubtitle($title, $picture = 'title_generic.png')
Set page main subtitle.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
loadLangs($lang_files_array, $from_module = false)
Load an array of language files
$this
appendToHead($content)
Append content to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addJsFile($js_file)
Add JS file to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addJsFiles($js_files_array)
Add an array of JS files.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addCssFile($css_file)
Add CSS file to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addCssFiles($css_files_array)
Add an array of CSS files.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addTab($title, $url, $is_active = false, $position = -1)
Add a tab to the page.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setTabsPicture($picture)
Set tabs picture.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setTabsTitle($title)
Set tabs title.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addSubTitle($title, $picture = 'title_generic.png', $morehtmlright = '')
Add a subtitle
$this
openForm($action = 'create', $enctype = '')
Open a form only if not already opened
$this
openTable($header_columns = array(), $attr = 'class="noborder allwidth"', $print_fiche_head = false, $summary = '')
Opens a new html table
$this
showTemplate($template_path, $path_is_absolute = false, $use_require_once = false, $template_params = array())
Include a template into the page.
Note: the template should be inside module tpl folder when $path_is_absolute parameter equal false.
redirect($url)
Redirect to a url (alias for dolibase_redirect function).
Note: this function should be called before any output, so before $page->begin() function.
end()
Generate page end.
Note: this function should be called after $page->begin() call.
boolean|int
checkField($field_name, $field_trans = '', $field_validation_rules = '', $return_err_number = false)
Check specified field
$this
askForConfirmation($url, $title, $question, $action, $question_param = '', $dialog_id_suffix = '')
Show a confirmation message
at line 54
boolean
checkExtraFields($object)
Check page extrafields
at line 75
$this
addField($field_name, $field_content, $is_required = false, $field_summary = '', $more_attr = '')
Add a table field
at line 100
$this
addTextField($field_name, $input_name, $input_value = '', $is_required = false, $field_summary = '', $input_size = 20)
Add a table field with a text input
at line 122
$this
addTextAreaField($field_name, $text_area_name, $text_area_value = '', $is_required = false, $field_summary = '', $toolbarname = 'dolibarr_details', $height = 100, $valign = 'top')
Add a table field with a text area
at line 145
$this
addNumberField($field_name, $input_name, $input_value = '', $is_required = false, $field_summary = '', $min, $max = 100)
Add a table field with a number input
at line 166
$this
addDateField($field_name, $input_name, $input_value = '', $is_required = false, $field_summary = '')
Add a table field with a date picker
at line 187
$this
addListField($field_name, $list_name, $list_choices, $selected_choice = '', $is_required = false, $field_summary = '', $show_empty)
Add a table field with a list
at line 208
$this
addRadioListField($field_name, $radio_name, $radio_list, $selected = '', $is_required = false, $field_summary = '', $valign = 'middle')
Add a table field with a radio input(s)
at line 231
$this
addCheckListField($field_name, $check_name, $check_list, $selected = '', $is_required = false, $field_summary = '', $valign = 'middle')
Add a table field with a checkbox input(s)
at line 252
$this
addColorField($field_name, $input_name, $input_value = '', $is_required = false, $field_summary = '')
Add a table field with a color picker
at line 267
$this
addExtraFields($object)
Add extra fields
at line 290
$this
generateFormButtons()
Generate form buttons