63 public function select_interventions($socid = -1, $selected =
'', $htmlname =
'interventionid', $maxlength = 16, $showempty = 1)
66 global $db, $user, $conf, $langs;
70 $hideunselectables =
false;
73 $sql =
'SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut';
74 $sql .=
' FROM '.MAIN_DB_PREFIX.
'fichinter as f';
75 $sql .=
" WHERE f.entity = ".$conf->entity;
78 if ($socid ==
'0') $sql .=
" AND (f.fk_soc = 0 OR f.fk_soc IS NULL)";
79 else $sql .=
" AND f.fk_soc = ".$socid;
82 dol_syslog(get_class($this).
"::select_intervention", LOG_DEBUG);
86 $out .=
'<select id="interventionid" class="flat" name="'.$htmlname.
'">';
87 if ($showempty) $out .=
'<option value="0"> </option>';
94 $obj = $this->
db->fetch_object(
$resql);
96 if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->rights->societe->lire)
101 if (!empty($selected) && $selected == $obj->rowid && $obj->statut > 0)
103 $out .=
'<option value="'.$obj->rowid.
'" selected>'.$labeltoshow.
'</option>';
106 if (!$obj->fk_statut > 0)
109 $labeltoshow .=
' ('.$langs->trans(
"Draft").
')';
111 if ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid))
114 $labeltoshow .=
' - '.$langs->trans(
"LinkedToAnotherCompany");
117 if ($hideunselectables && $disabled)
121 $resultat =
'<option value="'.$obj->rowid.
'"';
122 if ($disabled) $resultat .=
' disabled';
123 $resultat .=
'>'.$labeltoshow;
124 $resultat .=
'</option>';
$conf db
API class for accounts.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc= 'right', $stringencoding= 'UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.