28require_once DOL_DOCUMENT_ROOT .
'/comm/propal/class/propal.class.php';
38 public $module =
'webportal';
54 protected $propal_static =
null;
99 public $fields = array(
100 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'css' =>
'left',
'comment' =>
"Id",),
101 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => -2,
'notnull' => 1,
'position' => 15,
'index' => 1,),
102 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 20,
'notnull' => 1,
'visible' => 2,
'index' => 1,
'searchall' => 1,
'showoncombobox' => 1,
'validate' => 1,
'comment' =>
"Reference of object",),
103 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 2,
'position' => 60,),
104 'fin_validite' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 2,
'position' => 65,),
105 'total_ht' => array(
'type' =>
'price',
'label' =>
'TotalHT',
'enabled' => 1,
'visible' => 2,
'position' => 125,
'isameasure' => 1,),
106 'total_tva' => array(
'type' =>
'price',
'label' =>
'VAT',
'enabled' => 1,
'visible' => 2,
'position' => 130,
'isameasure' => 1,),
107 'total_ttc' => array(
'type' =>
'price',
'label' =>
'TotalTTC',
'enabled' => 1,
'visible' => 2,
'position' => 145,
'isameasure' => 1,),
108 'multicurrency_total_ht' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountHT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 245,
'isameasure' => 1,),
109 'multicurrency_total_tva' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountVAT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 250,
'isameasure' => 1,),
110 'multicurrency_total_ttc' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountTTC',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 255,
'isameasure' => 1,),
111 'fk_statut' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 2,
'notnull' => 1,
'position' => 500,
'arrayofkeyval' => self::ARRAY_STATUS_LABEL,),
138 if (!$this->propal_static) {
139 $this->propal_static =
new Propal($this->db);
142 return $this->propal_static;
152 global $conf, $langs;
156 $this->isextrafieldmanaged = 0;
169 global $conf, $langs;
174 return [
'optimize' => $langs->trans(
"WebPortalPropal")];
176 $datas[
'picto'] =
img_picto(
'', $this->picto) .
' <u>' . $langs->trans(
"WebPortalPropal") .
'</u>';
177 if (isset($this->
status)) {
180 $datas[
'ref'] .=
'<br><b>' . $langs->trans(
'Ref') .
':</b> ' . $this->ref;
196 public function getNomUrl($withpicto = 0, $option =
'', $get_params =
'', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = -1)
198 global $conf, $hookmanager;
200 if (!empty($conf->dol_no_mouse_hover)) {
207 'objecttype' => $this->element,
211 $classfortooltip =
'classfortooltip';
214 $classfortooltip =
'classforajaxtooltip';
226 $linkstart =
'<a href="' . $url .
'"';
227 $linkstart .= $linkclose .
'>';
230 if ($option ===
'nolink') {
235 $result .= $linkstart;
237 $result .=
img_object(($notooltip ?
'' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') : $dataparams .
' class="' . (($withpicto != 2) ?
'paddingright ' :
'') . $classfortooltip .
'"'), 0, 0, $notooltip ? 0 : 1);
239 if ($withpicto != 2) {
240 $result .= $this->ref;
245 $hookmanager->initHooks(array($this->element .
'dao'));
246 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
247 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
249 $result = $hookmanager->resPrint;
251 $result .= $hookmanager->resPrint;
265 global $conf, $langs;
267 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
269 $return =
'<div class="box-flex-item box-flex-grow-zero">';
270 $return .=
'<div class="info-box info-box-sm">';
271 $return .=
'<span class="info-box-icon bg-infobox-action">';
273 $return .=
'</span>';
274 $return .=
'<div class="info-box-content">';
275 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref) .
'</span>';
276 if ($selected >= 0) {
277 $return .=
'<input id="cb' . $this->
id .
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->
id .
'"' . ($selected ?
' checked="checked"' :
'') .
'>';
279 if (property_exists($this,
'label')) {
280 $return .=
' <div class="inline-block opacitymedium valignmiddle tdoverflowmax100">' . $this->label .
'</div>';
282 if (property_exists($this,
'amount')) {
284 $return .=
'<span class="info-box-label amount">' .
price($this->amount, 0, $langs, 1, -1, -1, $conf->currency) .
'</span>';
286 if (method_exists($this,
'getLibStatut')) {
287 $return .=
'<br><div class="info-box-status margintoponly">' . $this->
getLibStatut(3) .
'</div>';
304 return $this->
LibStatut($this->fk_statut, $mode);
315 return $this->
LibStatut($this->fk_statut, $mode);
Class to manage Dolibarr database access.
Class to manage proposals.
const STATUS_DRAFT
Draft status.
const STATUS_SIGNED
Signed quote.
const STATUS_NOTSIGNED
Not signed quote.
const STATUS_BILLED
Billed or processed quote.
const STATUS_VALIDATED
Validated status.
Class for WebPortalPropal.
const ARRAY_STATUS_LABEL
Status list (short label)
getPropalStatic()
Get propal for static method.
getLabelStatus($mode=0)
Return the label of the status.
getTooltipContentArray($params)
getTooltipContentArray
__construct(DoliDB $db)
Constructor.
getKanbanView($option='', $arraydata=null)
Return a thumb for kanban views.
getNomUrl($withpicto=0, $option='', $get_params='', $notooltip=0, $save_lastsearch_value=-1, $addlinktonotes=-1)
Return a link to the object card (with optionally the picto)
getLibStatut($mode=0)
Return the label of the status.
LibStatut($status, $mode=0)
Return the label of a given status.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...