dolibarr  13.0.2
html.formorder.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2016 Marcos GarcĂ­a <marcosgdf@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
26 
31 class FormOrder extends Form
32 {
33 
42  public function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status')
43  {
44  $options = array();
45 
46  // 7 is same label than 6. 8 does not exists (billed is another field)
47  $statustohow = array(
48  '0' => '0',
49  '1' => '1',
50  '2' => '2',
51  '3' => '3',
52  '4' => '4',
53  '5' => '5',
54  '6' => '6,7',
55  '9' => '9'
56  );
57 
58  $tmpsupplierorder = new CommandeFournisseur($this->db);
59 
60  foreach ($statustohow as $key => $value) {
61  $tmpsupplierorder->statut = $key;
62  $options[$value] = $tmpsupplierorder->getLibStatut($short);
63  }
64 
65  if (is_array($selected)) $selectedarray = $selected;
66  else $selectedarray = explode(',', $selected);
67 
68  print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
69  }
70 
80  public function selectInputMethod($selected = '', $htmlname = 'source_id', $addempty = 0)
81  {
82  global $langs;
83 
84  $listofmethods = array();
85 
86  $sql = "SELECT rowid, code, libelle as label";
87  $sql .= " FROM ".MAIN_DB_PREFIX."c_input_method";
88  $sql .= " WHERE active = 1";
89 
90  dol_syslog(get_class($this)."::selectInputMethod", LOG_DEBUG);
91  $resql = $this->db->query($sql);
92 
93  if (!$resql) {
94  dol_print_error($this->db);
95  return -1;
96  }
97 
98  while ($obj = $this->db->fetch_object($resql)) {
99  $listofmethods[$obj->rowid] = $langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : $obj->label;
100  }
101 
102  print Form::selectarray($htmlname, $listofmethods, $selected, $addempty);
103 
104  return 1;
105  }
106 }
static selectarray($htmlname, $array, $id= '', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam= '', $translate=0, $maxlen=0, $disabled=0, $sort= '', $morecss= '', $addjscombo=0, $moreparamonempty= '', $disablebademail=0, $nohtmlescape=0)
Return a HTML select string, built from an array of key+value.
$conf db
API class for accounts.
Definition: inc.php:54
Class to manage generation of HTML components Only common components must be here.
Class to manage HTML output components for orders Before adding component here, check they are not in...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Class to manage predefined suppliers products.
selectSupplierOrderStatus($selected= '', $short=0, $hmlname= 'order_status')
Return combo list of differents status of a orders.
print
Draft customers invoices.
Definition: index.php:89
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.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
static multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss= '', $translate=0, $width=0, $moreattrib= '', $elemtype= '', $placeholder= '', $addjscombo=-1)
Show a multiselect form from an array.
selectInputMethod($selected= '', $htmlname= 'source_id', $addempty=0)
Return list of input method (mode used to receive order, like order received by email, fax, online) List found into table c_input_method.