'."\n";
- $formconfirm.= '';
-
- $formconfirm.= "\n";
- }
- else
- {
- $formconfirm.= '\n";
- $formconfirm.= ' ';
- }
-
- $formconfirm.= "\n";
- return $formconfirm;
- }
-
-
- /**
- * Show a form to select a project
- *
- * @param int $page Page
- * @param int $socid Id third party
- * @param int $selected Id pre-selected project
- * @param string $htmlname Name of select field
- * @return void
- */
- function form_project($page, $socid, $selected='', $htmlname='projectid')
- {
- global $langs;
-
- require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php");
-
- $langs->load("project");
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $projet = new Project($this->db);
- $projet->fetch($selected);
- //print ''.$projet->title.'';
- print $projet->getNomUrl(0,'',1);
- }
- else
- {
- print " ";
- }
- }
- }
-
- /**
- * Show a form to select payment conditions
- *
- * @param page Page
- * @param selected Id condition pre-selectionne
- * @param htmlname Name of select html field
- * @param addempty Ajoute entree vide
- * @return void
- */
- function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
- {
- global $langs;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $this->load_cache_conditions_paiements();
- print $this->cache_conditions_paiements[$selected]['label'];
- } else {
- print " ";
- }
- }
- }
-
- /**
- * Show a form to select a delivery delay
- *
- * @param page Page
- * @param selected Id condition pre-selectionne
- * @param htmlname Name of select html field
- * @param addempty Ajoute entree vide
- * @return void
- */
- function form_availability($page, $selected='', $htmlname='availability', $addempty=0)
- {
- global $langs;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $this->load_cache_availability();
- print $this->cache_availability[$selected]['label'];
- } else {
- print " ";
- }
- }
- }
-
- /**
- * Show a select form to select origin
- *
- * @param page Page
- * @param selected Id condition pre-selectionne
- * @param htmlname Name of select html field
- * @param addempty Add empty entry
- * @return void
- */
- function form_demand_reason($page, $selected='', $htmlname='demandreason', $addempty=0)
- {
- global $langs;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $this->load_cache_demand_reason();
- foreach ($this->cache_demand_reason as $key => $val)
- {
- if ($val['id'] == $selected)
- {
- print $val['label'];
- break;
- }
- }
- } else {
- print " ";
- }
- }
- }
-
- /**
- * Show a form to select a date
- *
- * @param page Page
- * @param selected Date preselected
- * @param htmlname Name of input html field
- * @return void
- */
- function form_date($page, $selected='', $htmlname)
- {
- global $langs;
-
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $this->load_cache_types_paiements();
- print $this->cache_types_paiements[$selected]['label'];
- } else {
- print " ";
- }
- }
- }
-
-
- /**
- * Show a select form to choose a user
- *
- * @param page Page
- * @param selected Id of user preselected
- * @param htmlname Name of input html field
- * @param exclude List of users id to exclude
- * @param include List of users id to include
- * @return void
- */
- function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='')
- {
- global $langs;
-
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- require_once(DOL_DOCUMENT_ROOT ."/user/class/user.class.php");
- //$this->load_cache_contacts();
- //print $this->cache_contacts[$selected];
- $theuser=new User($this->db);
- $theuser->fetch($selected);
- print $theuser->getNomUrl(1);
- } else {
- print " ";
- }
- }
- }
-
-
- /**
- * Affiche formulaire de selection des modes de reglement
- *
- * @param page Page
- * @param selected Id mode pre-selectionne
- * @param htmlname Name of select html field
- * @return void
- */
- function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id')
- {
- global $langs;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- $this->load_cache_types_paiements();
- print $this->cache_types_paiements[$selected]['label'];
- } else {
- print " ";
- }
- }
- }
-
-
- /**
- * Show a select box with available absolute discounts
- *
- * @param string $page Page URL where form is shown
- * @param int $selected Value pre-selected
- * @param string $htmlname Nom du formulaire select. Si none, non modifiable
- * @param int $socid Third party id
- * @param float $amount Total amount available
- * @param string $filter SQL filter on discounts
- * @param int $maxvalue Max value for lines that can be selected
- * @param string $more More string to add
- * @return void
- */
- function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
- {
- global $conf,$langs;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- print $selected;
- }
- else
- {
- print "0";
- }
- }
- }
-
-
- /**
- * Affiche formulaire de selection des contacts
- *
- * @param page Page
- * @param selected Id contact pre-selectionne
- * @param htmlname Nom du formulaire select
- * @return void
- */
- function form_contacts($page, $societe, $selected='', $htmlname='contactidp')
- {
- global $langs;
-
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- require_once(DOL_DOCUMENT_ROOT ."/contact/class/contact.class.php");
- //$this->load_cache_contacts();
- //print $this->cache_contacts[$selected];
- $contact=new Contact($this->db);
- $contact->fetch($selected);
- print $contact->getFullName($langs);
- } else {
- print " ";
- }
- }
- }
-
-/**
- * Affiche formulaire de selection des tiers
- *
- * @param page Page
- * @param selected Id contact pre-selectionne
- * @param htmlname Nom du formulaire select
- * @return void
- */
- function form_thirdparty($page, $selected='', $htmlname='socid')
- {
- global $langs;
-
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- require_once(DOL_DOCUMENT_ROOT ."/societe/class/societe.class.php");
- $soc = new Societe($this->db);
- $soc->fetch($selected);
- print $soc->getNomUrl($langs);
- } else {
- print " ";
- }
- }
- }
-
- /**
- * Show form to select addresse
- *
- * @param page Page
- * @param selected Id condition pre-selectionne
- * @param htmlname Nom du formulaire select
- * @param origin Origine de l'appel pour pouvoir creer un retour
- * @param originid Id de l'origine
- * @return void
- * @deprecated
- */
- function form_address($page, $selected='', $socid, $htmlname='address_id', $origin='', $originid='')
- {
- global $langs,$conf;
- if ($htmlname != "none")
- {
- print '';
- }
- else
- {
- if ($selected)
- {
- require_once(DOL_DOCUMENT_ROOT ."/societe/class/address.class.php");
- $address=new Address($this->db);
- $result=$address->fetch_address($selected);
- print 'socid.'&id='.$address->id.'&action=edit&origin='.$origin.'&originid='.$originid.'>'.$address->label.'';
- }
- else
- {
- print " ";
- }
- }
- }
-
- /**
- * Retourne la liste des devises, dans la langue de l'utilisateur
- *
- * @param selected code devise pre-selectionne
- * @param htmlname nom de la liste deroulante
- * @return void
- */
- function select_currency($selected='',$htmlname='currency_id')
- {
- print $this->selectcurrency($selected,$htmlname);
- }
-
- /**
- * Retourne la liste des devises, dans la langue de l'utilisateur
- *
- * @param selected code devise pre-selectionne
- * @param htmlname nom de la liste deroulante
- */
- function selectcurrency($selected='',$htmlname='currency_id')
- {
- global $conf,$langs,$user;
-
- $langs->load("dict");
-
- $out='';
- $currencyArray=array();
- $label=array();
-
- if ($selected=='euro' || $selected=='euros') $selected='EUR'; // Pour compatibilite
-
- $sql = "SELECT code_iso, label";
- $sql.= " FROM ".MAIN_DB_PREFIX."c_currencies";
- $sql.= " WHERE active = 1";
- $sql.= " ORDER BY code_iso ASC";
-
- $resql=$this->db->query($sql);
- if ($resql)
- {
- $out.= '';
- if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
- return $out;
- }
- else
- {
- dol_print_error($this->db);
- }
- }
-
- /**
- * Output an HTML select vat rate
- *
- * @param htmlname Nom champ html
- * @param selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
- * @param societe_vendeuse Objet societe vendeuse
- * @param societe_acheteuse Objet societe acheteuse
- * @param idprod Id product
- * @param info_bits Miscellaneous information on line
- * @param type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined)
- * Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
- * Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle.
- * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
- * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu autre que transport neuf alors la TVA par defaut=TVA du produit vendu. Fin de regle.
- * Sinon la TVA proposee par defaut=0. Fin de regle.
- * @deprecated
- * @return void
- */
- function select_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='')
- {
- print $this->load_tva($htmlname, $selectedrate, $societe_vendeuse, $societe_acheteuse, $idprod, $info_bits, $type);
- }
-
-
- /**
- * Output an HTML select vat rate
- *
- * @param htmlname Nom champ html
- * @param selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
- * @param societe_vendeuse Objet societe vendeuse
- * @param societe_acheteuse Objet societe acheteuse
- * @param idprod Id product
- * @param info_bits Miscellaneous information on line (1 for NPR)
- * @param type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined)
- * Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle.
- * Si le (pays vendeur = pays acheteur) alors la TVA par defaut=TVA du produit vendu. Fin de regle.
- * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle.
- * Si (vendeur et acheteur dans Communaute europeenne) et bien vendu autre que transport neuf alors la TVA par defaut=TVA du produit vendu. Fin de regle.
- * Sinon la TVA proposee par defaut=0. Fin de regle.
- * @return void
- */
- function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='')
- {
- global $langs,$conf,$mysoc;
-
- $return='';
- $txtva=array();
- $libtva=array();
- $nprtva=array();
-
- // Define defaultnpr and defaultttx
- $defaultnpr=($info_bits & 0x01);
- $defaultnpr=(preg_match('/\*/',$selectedrate) ? 1 : $defaultnpr);
- $defaulttx=str_replace('*','',$selectedrate);
-
- // Check parameters
- if (is_object($societe_vendeuse) && ! $societe_vendeuse->country_code)
- {
- if ($societe_vendeuse->id == $mysoc->id)
- {
- $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").'';
- }
- else
- {
- $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").'';
- }
- return $return;
- }
-
- //var_dump($societe_acheteuse);
- //print "name=$name, selectedrate=$selectedrate, seller=".$societe_vendeuse->country_code." buyer=".$societe_acheteuse->country_code." buyer is company=".$societe_acheteuse->isACompany()." idprod=$idprod, info_bits=$info_bits type=$type";
- //exit;
-
- // Get list of all VAT rates to show
- // First we defined code_pays to use to find list
- if (is_object($societe_vendeuse))
- {
- $code_pays="'".$societe_vendeuse->country_code."'";
- }
- else
- {
- $code_pays="'".$mysoc->country_code."'"; // Pour compatibilite ascendente
- }
- if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on
- {
- if (! $societe_vendeuse->isInEEC() && $societe_acheteuse->isInEEC() && ! $societe_acheteuse->isACompany())
- {
- // We also add the buyer
- if (is_numeric($type))
- {
- if ($type == 1) // We know product is a service
- {
- $code_pays.=",'".$societe_acheteuse->country_code."'";
- }
- }
- else if (! $idprod) // We don't know type of product
- {
- $code_pays.=",'".$societe_acheteuse->country_code."'";
- }
- else
- {
- $prodstatic=new Product($this->db);
- $prodstatic->fetch($idprod);
- if ($prodstatic->type == 1) // We know product is a service
- {
- $code_pays.=",'".$societe_acheteuse->country_code."'";
- }
- }
- }
- }
- // Now we get list
- $sql = "SELECT DISTINCT t.taux, t.recuperableonly";
- $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
- $sql.= " WHERE t.fk_pays = p.rowid";
- $sql.= " AND t.active = 1";
- $sql.= " AND p.code in (".$code_pays.")";
- $sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
-
- $resql=$this->db->query($sql);
- if ($resql)
- {
- $num = $this->db->num_rows($resql);
- if ($num)
- {
- for ($i = 0; $i < $num; $i++)
- {
- $obj = $this->db->fetch_object($resql);
- $txtva[$i] = $obj->taux;
- $libtva[$i] = $obj->taux.'%';
- $nprtva[$i] = $obj->recuperableonly;
- }
- }
- else
- {
- $return.= ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry",$code_pays).'';
- }
- }
- else
- {
- $return.= ''.$this->db->error().'';
- }
-
- // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
- if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
- {
- $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$idprod);
- $defaultnpr=get_default_npr($societe_vendeuse,$societe_acheteuse,$idprod);
- }
-
- // Si taux par defaut n'a pu etre determine, on prend dernier de la liste.
- // Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
- if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
- {
- $defaulttx = $txtva[count($txtva)-1];
- }
-
- $nbdetaux = count($txtva);
- if ($nbdetaux > 0)
- {
- $return.= '';
- }
-
- return $return;
- }
-
-
- /**
- * Show a HTML widget to input a date or combo list for day, month, years and optionnaly hours and minutes
- * Fields are preselected with :
- * - set_time date (Local PHP server timestamps or date format YYYY-MM-DD or YYYY-MM-DD HH:MM)
- * - local date of PHP server if set_time is ''
- * - Empty (fields empty) if set_time is -1 (in this case, parameter empty must also have value 1)
- *
- * @param set_time Pre-selected date (must be a local PHP server timestamp)
- * @param prefix Prefix for fields name
- * @param h 1=Show also hours
- * @param m 1=Show also minutes
- * @param empty 0=Fields required, 1=Empty input is allowed
- * @param form_name Form name. Used by popup dates.
- * @param d 1=Show days, month, years
- * @param addnowbutton Add a button "Now"
- * @param nooutput Do not output html string but return it
- * @param disabled Disable input fields
- * @param fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
- * @return nothing or string if nooutput is 1
- */
- function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='')
- {
- global $conf,$langs;
-
- $retstring='';
-
- if($prefix=='') $prefix='re';
- if($h == '') $h=0;
- if($m == '') $m=0;
- if($empty == '') $empty=0;
-
- if (! $set_time && $empty == 0) $set_time = dol_now('tzuser');
-
- // Analysis of the pre-selection date
- if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/',$set_time,$reg))
- {
- // Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'
- $syear = $reg[1];
- $smonth = $reg[2];
- $sday = $reg[3];
- $shour = $reg[4];
- $smin = $reg[5];
- }
- elseif (strval($set_time) != '' && $set_time != -1)
- {
- // set_time est un timestamps (0 possible)
- $syear = dol_print_date($set_time, "%Y");
- $smonth = dol_print_date($set_time, "%m");
- $sday = dol_print_date($set_time, "%d");
- $shour = dol_print_date($set_time, "%H");
- $smin = dol_print_date($set_time, "%M");
- }
- else
- {
- // Date est '' ou vaut -1
- $syear = '';
- $smonth = '';
- $sday = '';
- $shour = '';
- $smin = '';
- }
-
- if ($d)
- {
- // Show date with popup
- if ($conf->use_javascript_ajax && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none"))
- {
- //print "e".$set_time." t ".$conf->format_date_short;
- if (strval($set_time) != '' && $set_time != -1)
- {
- //$formated_date=dol_print_date($set_time,$conf->format_date_short);
- $formated_date=dol_print_date($set_time,$langs->trans("FormatDateShort")); // FormatDateShort for dol_print_date/FormatDateShortJava that is same for javascript
- }
-
- // Calendrier popup version eldy
- if (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == "eldy")
- {
- // Zone de saisie manuelle de la date
- $retstring.='';
-
- // Icone calendrier
- if (! $disabled)
- {
- $retstring.='';
- }
- else $retstring.='';
-
- $retstring.=''."\n";
- $retstring.=''."\n";
- $retstring.=''."\n";
- }
- else
- {
- print "Bad value of calendar";
- }
- }
-
- // Show date with combo selects
- if (empty($conf->use_javascript_ajax) || $conf->global->MAIN_POPUP_CALENDAR == "none")
- {
- // Day
- $retstring.='";
-
- $retstring.='";
-
- // Year
- if ($empty || $set_time == -1)
- {
- $retstring.='';
- }
- else
- {
- $retstring.='\n";
- }
- }
- }
-
- if ($d && $h) $retstring.=' ';
-
- if ($h)
- {
- // Show hour
- $retstring.='";
- $retstring.="H\n";
- }
-
- if ($m)
- {
- // Show minutes
- $retstring.='";
- $retstring.="M\n";
- }
-
- // Add a "Now" button
- if ($conf->use_javascript_ajax && $addnowbutton)
- {
- // Script which will be inserted in the OnClick of the "Now" button
- $reset_scripts = "";
-
- // Generate the date part, depending on the use or not of the javascript calendar
- if (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == "eldy")
- {
- $base=DOL_URL_ROOT.'/core/lib/';
- $reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');';
- }
- else
- {
- $reset_scripts .= 'this.form.elements[\''.$prefix.'day\'].value=formatDate(new Date(), \'d\'); ';
- $reset_scripts .= 'this.form.elements[\''.$prefix.'month\'].value=formatDate(new Date(), \'M\'); ';
- $reset_scripts .= 'this.form.elements[\''.$prefix.'year\'].value=formatDate(new Date(), \'yyyy\'); ';
- }
- // Generate the hour part
- if ($h)
- {
- if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
- $reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
- if ($fullday) $reset_scripts .= ' } ';
- }
- // Generate the minute part
- if ($m)
- {
- if ($fullday) $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {";
- $reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
- if ($fullday) $reset_scripts .= ' } ';
- }
- // If reset_scripts is not empty, print the button with the reset_scripts in OnClick
- if ($reset_scripts)
- {
- $retstring.=' ';
- }
- }
-
- if (! empty($nooutput)) return $retstring;
-
- print $retstring;
- return;
- }
-
- /**
- * Function to show a form to select a duration on a page
- *
- * @param string $prefix prefix
- * @param int $iSecond Default preselected duration (number of seconds)
- * @param int $disabled Disable the combo box
- * @return void
- */
- function select_duration($prefix,$iSecond='',$disabled=0)
- {
- if ($iSecond)
- {
- require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
-
- $hourSelected = convertSecondToTime($iSecond,'hour');
- $minSelected = convertSecondToTime($iSecond,'min');
- }
-
- print '";
- print "H ";
- print '";
- print "M ";
- }
-
-
- /**
- * Show a select form from an array
- *
- * @param htmlname Name of html select area
- * @param array Array with key+value
- * @param id Preselected key
- * @param show_empty 1 si il faut ajouter une valeur vide dans la liste, 0 sinon
- * @param key_in_label 1 pour afficher la key dans la valeur "[key] value"
- * @param value_as_key 1 to use value as key
- * @param option Valeur de l'option en fonction du type choisi
- * @param translate Translate and encode value
- * @param maxlen Length maximum for labels
- * @param disabled Html select box is disabled
- * @return string HTML select string
- */
- function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0)
- {
- global $langs;
-
- $out='";
- return $out;
- }
-
- /**
- * Show a select form from an array
- *
- * @deprecated Use selectarray instead
- * @return void
- */
- function select_array($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0)
- {
- print $this->selectarray($htmlname, $array, $id, $show_empty, $key_in_label, $value_as_key, $option, $translate, $maxlen);
- }
-
-
- /**
- * Return an html string with a select combo box to choose yes or no
- *
- * @param string $name Name of html select field
- * @param string $value Pre-selected value
- * @param int $option 0 return yes/no, 1 return 1/0
- * @param bool $disabled true or false
- * @return mixed See option
- */
- function selectyesno($htmlname,$value='',$option=0,$disabled=false)
- {
- global $langs;
-
- $yes="yes"; $no="no";
-
- if ($option)
- {
- $yes="1";
- $no="0";
- }
-
- $disabled = ($disabled ? ' disabled="disabled"' : '');
-
- $resultyesno = ''."\n";
- return $resultyesno;
- }
-
-
-
- /**
- * Return list of export templates
- *
- * @param selected Id modele pre-selectionne
- * @param htmlname Nom de la zone select
- * @param type Type des modeles recherches
- * @param useempty Affiche valeur vide dans liste
- * @return void
- */
- function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
- {
-
- $sql = "SELECT rowid, label";
- $sql.= " FROM ".MAIN_DB_PREFIX."export_model";
- $sql.= " WHERE type = '".$type."'";
- $sql.= " ORDER BY rowid";
- $result = $this->db->query($sql);
- if ($result)
- {
- print '";
- }
- else {
- dol_print_error($this->db);
- }
- }
-
- /**
- * Return a HTML area with the reference of object and a navigation bar for a business object
- * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
- *
- * @param Object $object Object to show
- * @param int $paramid Name of parameter to use to name the id into the URL link
- * @param string $morehtml More html content to output just before the nav bar
- * @param int $shownav Show Condition (navigation is shown if value is 1)
- * @param int $fieldid Nom du champ en base a utiliser pour select next et previous
- * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
- * @param string $morehtmlref Code html supplementaire a afficher apres ref
- * @param string $moreparam More param to add in nav link url.
- * @return tring Portion HTML avec ref + boutons nav
- */
- function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='')
- {
- $ret='';
-
- //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
- $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid);
- $previous_ref = $object->ref_previous?'ref_previous).$moreparam.'">'.img_previous().'':'';
- $next_ref = $object->ref_next?'ref_next).$moreparam.'">'.img_next().'':'';
-
- //print "xx".$previous_ref."x".$next_ref;
- if ($previous_ref || $next_ref || $morehtml) {
- $ret.='