class FormContract (View source)

Class to manage generation of HTML components for contract module

Properties

DoliDB $db
string $error

Methods

__construct(DoliDB $db)

Constructor

int|string
select_contract(int $socid = -1, int $selected = 0, string $htmlname = 'contrattid', int $maxlength = 16, int $showempty = 1, int $showRef = 0, $noouput = 0, $morecss = 'minwidth150')

Show a combo list with contracts qualified for a third party

formSelectContract($page, int $socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $nooutput = 0)

Show a form to select a contract

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

int|string select_contract(int $socid = -1, int $selected = 0, string $htmlname = 'contrattid', int $maxlength = 16, int $showempty = 1, int $showRef = 0, $noouput = 0, $morecss = 'minwidth150')

Show a combo list with contracts qualified for a third party

Parameters

int $socid

Id third party (-1=all, 0=only contracts not linked to a third party, id=contracts not linked or linked to third party id)

int $selected

Id contract preselected

string $htmlname

Nom de la zone html

int $maxlength

Maximum length of label

int $showempty

Show empty line

int $showRef

Show customer and supplier reference on each contract (when found) @param int $noouput 1=Return the output instead of display @param string $morecss More CSS

$noouput
$morecss

Return Value

int|string

If nooutput = 0: Nbr of contract if OK, <0 if KO, If nooutput = 1: The HTML select string

formSelectContract($page, int $socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $nooutput = 0)

Show a form to select a contract

@param string $page Page

Parameters

$page
int $socid

Id third party (-1=all, 0=only contracts not linked to a third party, id=contracts not linked or linked to third party id) @param int $selected Id contract preselected @param string $htmlname Nom de la zone html @param int $maxlength Maximum length of label @param int $showempty Show empty line @param int $showRef Show customer and supplier reference on each contract (when found) @param int<0,1> $nooutput 1=Return the output instead of display @return string|void html string

$selected
$htmlname
$maxlength
$showempty
$showRef
$nooutput