dolibarr  7.0.0-beta
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 <http://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  print Form::selectarray($hmlname, $options, $selected, 1);
66  }
67 
77  public function selectInputMethod($selected='',$htmlname='source_id',$addempty=0)
78  {
79  global $langs;
80 
81  $listofmethods=array();
82 
83  $sql = "SELECT rowid, code, libelle as label";
84  $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
85  $sql.= " WHERE active = 1";
86 
87  dol_syslog(get_class($this)."::selectInputMethod", LOG_DEBUG);
88  $resql=$this->db->query($sql);
89 
90  if (!$resql) {
91  dol_print_error($this->db);
92  return -1;
93  }
94 
95  while ($obj = $this->db->fetch_object($resql)) {
96  $listofmethods[$obj->rowid] = $langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : $obj->label;
97  }
98 
99  print Form::selectarray($htmlname,$listofmethods,$selected,$addempty);
100 
101  return 1;
102  }
103 
104 }
105 
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.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
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.
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
Class to manage HTML output components for orders Before adding component here, check they are not in...
Class to manage predefined suppliers products.
print
Draft customers invoices.
Definition: index.php:91
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->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)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status')
Return combo list of differents status of a orders.