64 public function selectProposalStatus($selected =
'', $short = 0, $excludedraft = 0, $showempty = 1, $mode =
'customer', $htmlname =
'propal_statut', $morecss =
'')
69 $listofstatus = array();
70 if ($mode ==
'supplier') {
71 $prefix =
'SupplierProposalStatus';
73 $langs->load(
"supplier_proposal");
74 $listofstatus = array(
75 0=>array(
'id'=>0,
'code'=>
'PR_DRAFT'),
76 1=>array(
'id'=>1,
'code'=>
'PR_OPEN'),
77 2=>array(
'id'=>2,
'code'=>
'PR_SIGNED'),
78 3=>array(
'id'=>3,
'code'=>
'PR_NOTSIGNED'),
79 4=>array(
'id'=>4,
'code'=>
'PR_CLOSED')
82 $prefix =
"PropalStatus";
84 $sql =
"SELECT id, code, label, active FROM ".$this->db->prefix().
"c_propalst";
85 $sql .=
" WHERE active = 1";
86 dol_syslog(get_class($this).
"::selectProposalStatus", LOG_DEBUG);
93 $obj = $this->
db->fetch_object(
$resql);
94 $listofstatus[$obj->id] = array(
'id'=>$obj->id,
'code'=>$obj->code,
'label'=>$obj->label);
103 print
'<select id="'.$htmlname.
'" name="'.$htmlname.
'" class="flat'.($morecss ?
' '.$morecss :
'').
'">';
105 print
'<option value="-1"> </option>';
109 foreach ($listofstatus as $key => $obj) {
111 if ($obj[
'code'] ==
'Draft' || $obj[
'code'] ==
'PR_DRAFT') {
116 if ($selected !=
'' && $selected == $obj[
'id']) {
117 print
'<option value="'.$obj[
'id'].
'" selected>';
119 print
'<option value="'.$obj[
'id'].
'">';
122 if ($langs->trans($prefix.$key.($short ?
'Short' :
'')) != $prefix.$key.($short ?
'Short' :
'')) {
123 print $langs->trans($prefix.$key.($short ?
'Short' :
''));
125 $conv_to_new_code = array(
'PR_DRAFT'=>
'Draft',
'PR_OPEN'=>
'Validated',
'PR_CLOSED'=>
'Closed',
'PR_SIGNED'=>
'Signed',
'PR_NOTSIGNED'=>
'NotSigned',
'PR_FAC'=>
'Billed');
126 if (!empty($conv_to_new_code[$obj[
'code']])) {
127 $key = $conv_to_new_code[$obj[
'code']];
130 print ($langs->trans($prefix.$key.($short ?
'Short' :
'')) != $prefix.$key.($short ?
'Short' :
'')) ? $langs->trans($prefix.$key.($short ?
'Short' :
'')) : ($obj[
'label'] ? $obj[
'label'] : $obj[
'code']);
137 print
ajax_combobox($htmlname, array(), 0, 0,
'resolve', ($showempty < 0 ? (
string) $showempty :
'-1'), $morecss);
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $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_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db
API class for accounts.