CardPage
class CardPage extends FormPage (View source)
CardPage 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 string | $edit_permission | ||
protected string | $delete_permission | ||
protected boolean | $close_buttons_div | ||
protected boolean | $show_documents | ||
protected string | $const_name_prefix | ||
protected string | $sub_permission | ||
protected string | $mail_subject | ||
protected string | $mail_template | ||
protected array | $mail_substitutions | ||
protected boolean | $enable_mail_delivery_receipt | ||
protected object | $extrafields |
Methods
Constructor
Add a subtitle
Opens a new html table
Include a template into the page.
Generate page beginning
Generate page end
Check specified field
Show a confirmation message
Return if the current user can edit the page or not
Return if the current user can delete the object or not
Set mail subject
Set mail template
Enables mail delivery receipt
Set mail substitutions
Open buttons div (if not already opened)
Close buttons div (if opened)
Add a button to the page
Add a confirmation button to the page
Add a list button to the page
Add save as button to the page
Show a table field
Show reference/Ref. field
Show extra fields
Update extra fields
Show banner
Edit a 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
Print related objects block.
Print documents block
Print mail form
Details
at line 87
__construct($page_title, $access_perm = '', $edit_perm = '', $delete_perm = '', $show_documents = false, $enable_save_as = false, $const_name_prefix = '', $sub_permission = '')
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.
at line 791
$this
begin()
Generate page beginning
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.
at line 806
end($object = null)
Generate page end
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 127
boolean
canEdit()
Return if the current user can edit the page or not
at line 137
boolean
canDelete()
Return if the current user can delete the object or not
at line 148
$this
setMailSubject($mail_subject)
Set mail subject
at line 161
$this
setMailTemplate($mail_template)
Set mail template
at line 173
$this
enableMailDeliveryReceipt()
Enables mail delivery receipt
at line 186
$this
setMailSubstitutions($mail_substitutions_array)
Set mail substitutions
at line 197
protected
openButtonsDiv()
Open buttons div (if not already opened)
at line 211
protected
closeButtonsDiv()
Close buttons div (if opened)
at line 229
$this
addButton($name, $href = '#', $target = '_self', $class = 'butAction', $close_parent_div = false)
Add a button to the page
at line 255
$this
addConfirmButton($name, $id, $href = '#', $target = '_self', $class = 'butAction', $close_parent_div = false)
Add a confirmation button to the page
at line 286
$this
addListButton($name, $buttons = array(), $class = 'butAction', $close_parent_div = false)
Add a list button to the page
at line 329
$this
addSaveAsButton($close_parent_div = false)
Add save as button to the page
at line 351
$this
showField($field_name, $field_content, $is_editable = false, $edit_link = '', $attr = '')
Show a table field
at line 376
$this
showRefField($field_name, $object, $list_link = '')
Show reference/Ref. field
at line 394
$this
showExtraFields($object)
Show extra fields
at line 420
int
updateExtraFields($object)
Update extra fields
at line 450
$this
showBanner($object, $list_link = '', $morehtmlleft = '')
Show banner
at line 471
$this
editField($field_name, $field_content, $action_name)
Edit a field
at line 502
$this
editTextField($field_name, $input_name, $input_value = '', $input_size = 20, $action_prefix = 'set_')
Add a table field with a text input
at line 522
$this
editTextAreaField($field_name, $text_area_name, $text_area_value = '', $toolbarname = 'dolibarr_details', $height = 100, $action_prefix = 'set_')
Add a table field with a text area
at line 542
$this
editNumberField($field_name, $input_name, $input_value = '', $min, $max = 100, $action_prefix = 'set_')
Add a table field with a number input
at line 562
$this
editDateField($field_name, $input_name, $input_value = '', $action_prefix = 'set_date_')
Add a table field with a date picker
at line 582
$this
editListField($field_name, $list_name, $list_choices, $selected_choice = '', $show_empty, $action_prefix = 'set_')
Add a table field with a list
at line 601
$this
editRadioListField($field_name, $radio_name, $radio_list, $selected = '', $action_prefix = 'set_')
Add a table field with a radio input(s)
at line 620
$this
editCheckListField($field_name, $check_name, $check_list, $selected = '', $action_prefix = 'set_')
Add a table field with a checkbox input(s)
at line 638
$this
editColorField($field_name, $input_name, $input_value = '', $action_prefix = 'set_')
Add a table field with a color picker
at line 653
protected
printRelatedObjects($object)
Print related objects block.
Note: To enable the linking feature, you must define a constant in each module as 'your_module_right_class_in_capital_letters'.'_ENABLE_EXPANDED_LINKS'
at line 693
protected
printDocuments($object)
Print documents block
at line 731
protected
printMailForm($object)
Print mail form