This commit is contained in:
Laurent Destailleur 2012-03-12 15:09:46 +01:00
parent c040abe574
commit 36db79c249
8 changed files with 233 additions and 234 deletions

View File

@ -51,7 +51,7 @@ class AntiVir
* Scan a file with antivirus. * Scan a file with antivirus.
* This function runs the command defined in setup. This antivirus command must return 0 if OK. * This function runs the command defined in setup. This antivirus command must return 0 if OK.
* *
* @param file File to scan * @param string $file File to scan
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK * @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
*/ */
function dol_avscan_file($file) function dol_avscan_file($file)
@ -126,9 +126,10 @@ class AntiVir
/** /**
* \brief get full Command Line to run * Get full Command Line to run
* \param file File to scan *
* \return string Full command line to run * @param string $file File to scan
* @return string Full command line to run
*/ */
function getCliCommand($file) function getCliCommand($file)
{ {

View File

@ -24,8 +24,7 @@
/** /**
* \class Canvas * Class to manage canvas
* \brief Class to manage canvas
*/ */
class Canvas class Canvas
{ {
@ -126,6 +125,7 @@ class Canvas
/** /**
* Return the template to display canvas (if it exists) * Return the template to display canvas (if it exists)
* *
* @param string $action Action code
* @return int 0=Canvas template file does not exist, 1=Canvas template file exists * @return int 0=Canvas template file does not exist, 1=Canvas template file exists
*/ */
function displayCanvasExists($action) function displayCanvasExists($action)
@ -140,6 +140,7 @@ class Canvas
* Display a canvas page. This will include the template for output. * Display a canvas page. This will include the template for output.
* Variables used by templates may have been defined or loaded before into the assign_values function. * Variables used by templates may have been defined or loaded before into the assign_values function.
* *
* @param string $action Action code
* @return void * @return void
*/ */
function display_canvas($action) function display_canvas($action)

View File

@ -22,8 +22,7 @@
*/ */
/** /**
* \class DolEditor * Class to manage a WYSIWYG editor.
* \brief Class to manage a WYSIWYG editor.
* Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing'); * Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing');
* $doleditor->Create(); * $doleditor->Create();
*/ */

View File

@ -38,8 +38,7 @@
/** /**
* \class DolGraph * Parent class of graph classes
* \brief Parent class of graph classes
*/ */
class DolGraph class DolGraph
{ {

View File

@ -456,7 +456,7 @@ class Form
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
$sql.= " ORDER BY code ASC"; $sql.= " ORDER BY code ASC";
dol_syslog("Form::select_country sql=".$sql); dol_syslog(get_class($this)."::select_country sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -716,13 +716,14 @@ class Form
/** /**
* Return HTML combo list of absolute discounts * Return HTML combo list of absolute discounts
* *
* @param selected Id remise fixe pre-selectionnee * @param string $selected Id remise fixe pre-selectionnee
* @param htmlname Nom champ formulaire * @param string $htmlname Nom champ formulaire
* @param filter Criteres optionnels de filtre * @param string $filter Criteres optionnels de filtre
* @param maxvalue Max value for lines that can be selected * @param int $socid Id of thirdparty
* @param int $maxvalue Max value for lines that can be selected
* @return int Return number of qualifed lines in list * @return int Return number of qualifed lines in list
*/ */
function select_remises($selected='',$htmlname='remise_id',$filter='',$socid, $maxvalue=0) function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0)
{ {
global $langs,$conf; global $langs,$conf;
@ -734,7 +735,7 @@ class Form
if ($filter) $sql.= " AND ".$filter; if ($filter) $sql.= " AND ".$filter;
$sql.= " ORDER BY re.description ASC"; $sql.= " ORDER BY re.description ASC";
dol_syslog("Form::select_remises sql=".$sql); dol_syslog(get_class(this)."::select_remises sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -782,14 +783,14 @@ class Form
/** /**
* Return list of all contacts (for a third party or all) * Return list of all contacts (for a third party or all)
* *
* @param socid Id ot third party or 0 for all * @param int $socid Id ot third party or 0 for all
* @param selected Id contact pre-selectionne * @param string $selected Id contact pre-selectionne
* @param htmlname Name of HTML field ('none' for a not editable field) * @param string $htmlname Name of HTML field ('none' for a not editable field)
* @param show_empty 0=no empty value, 1=add an empty value * @param int $show_empty 0=no empty value, 1=add an empty value
* @param exclude List of contacts id to exclude * @param string $exclude List of contacts id to exclude
* @param limitto Disable answers that are not id in this array list * @param string $limitto Disable answers that are not id in this array list
* @param showfunction Add function into label * @param string $showfunction Add function into label
* @param moreclass Add more class to class style * @param string $moreclass Add more class to class style
* @return int <0 if KO, Nb of contact in list if OK * @return int <0 if KO, Nb of contact in list if OK
*/ */
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='') function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='')
@ -879,14 +880,15 @@ class Form
/** /**
* Return select list of users * Return select list of users
* *
* @param selected Id user preselected * @param string $selected Id user preselected
* @param htmlname Field name in form * @param string $htmlname Field name in form
* @param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @param exclude Array list of users id to exclude * @param array $exclude Array list of users id to exclude
* @param disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param include Array list of users id to include * @param array $include Array list of users id to include
* @param enableonly Array list of users id to be enabled. All other must be disabled * @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param force_entity Possibility to force entity * @param int $force_entity Possibility to force entity
* @return void
*/ */
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
{ {
@ -896,14 +898,15 @@ class Form
/** /**
* Return select list of users * Return select list of users
* *
* @param selected User id or user object of user preselected. If -1, we use id of current user. * @param string $selected User id or user object of user preselected. If -1, we use id of current user.
* @param htmlname Field name in form * @param string $htmlname Field name in form
* @param show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @param exclude Array list of users id to exclude * @param array $exclude Array list of users id to exclude
* @param disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param include Array list of users id to include * @param array $include Array list of users id to include
* @param enableonly Array list of users id to be enabled. All other must be disabled * @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param force_entity Possibility to force entity * @param int $force_entity Possibility to force entity
* @return string HTML select string
*/ */
function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) function select_dolusers($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0)
{ {
@ -940,7 +943,7 @@ class Form
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')"; if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
$sql.= " ORDER BY u.name ASC"; $sql.= " ORDER BY u.name ASC";
dol_syslog("Form::select_dolusers sql=".$sql); dol_syslog(get_class($this)."::select_dolusers sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1116,7 +1119,7 @@ class Form
$outselect=''; $outselect='';
$outjson=array(); $outjson=array();
dol_syslog("Form::select_produits_do search product sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::select_produits_do search product sql=".$sql, LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {
@ -1177,7 +1180,7 @@ class Form
$sql.= " ORDER BY date_price"; $sql.= " ORDER BY date_price";
$sql.= " DESC LIMIT 1"; $sql.= " DESC LIMIT 1";
dol_syslog("Form::select_produits_do search price for level '.$price_level.' sql=".$sql); dol_syslog(get_class($this)."::select_produits_do search price for level '.$price_level.' sql=".$sql);
$result2 = $this->db->query($sql); $result2 = $this->db->query($sql);
if ($result2) if ($result2)
{ {
@ -1265,7 +1268,7 @@ class Form
} }
/** /**
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_fournisseurs_do * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_do)
* *
* @param int $socid Id third party * @param int $socid Id third party
* @param string $selected Preselected product * @param string $selected Preselected product
@ -1293,7 +1296,7 @@ class Form
} }
/** /**
* Retourne la liste des produits de fournisseurs * Return list of suppliers products
* *
* @param socid Id societe fournisseur (0 pour aucun filtre) * @param socid Id societe fournisseur (0 pour aucun filtre)
* @param selected Produit pre-selectionne * @param selected Produit pre-selectionne
@ -1465,7 +1468,7 @@ class Form
$sql.= " AND p.rowid = ".$productid; $sql.= " AND p.rowid = ".$productid;
$sql.= " ORDER BY s.nom, pfp.ref_fourn DESC"; $sql.= " ORDER BY s.nom, pfp.ref_fourn DESC";
dol_syslog("Form::select_product_fourn_price sql=".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::select_product_fourn_price sql=".$sql,LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
@ -1546,7 +1549,7 @@ class Form
$sql .= " WHERE a.fk_soc = ".$socid; $sql .= " WHERE a.fk_soc = ".$socid;
$sql .= " ORDER BY a.label ASC"; $sql .= " ORDER BY a.label ASC";
dol_syslog("Form::select_address sql=".$sql); dol_syslog(get_class($this)."::select_address sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1596,7 +1599,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX.'c_payment_term'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_payment_term';
$sql.= " WHERE active=1"; $sql.= " WHERE active=1";
$sql.= " ORDER BY sortorder"; $sql.= " ORDER BY sortorder";
dol_syslog('Form::load_cache_conditions_paiements sql='.$sql,LOG_DEBUG); dol_syslog(get_class($this).'::load_cache_conditions_paiements sql='.$sql,LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1635,7 +1638,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX.'c_availability'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_availability';
$sql.= " WHERE active=1"; $sql.= " WHERE active=1";
$sql.= " ORDER BY rowid"; $sql.= " ORDER BY rowid";
dol_syslog('Form::load_cache_availability sql='.$sql,LOG_DEBUG); dol_syslog(get_class($this).'::load_cache_availability sql='.$sql,LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1662,10 +1665,11 @@ class Form
/** /**
* Retourne la liste des types de delais de livraison possibles * Retourne la liste des types de delais de livraison possibles
* *
* @param selected Id du type de delais pre-selectionne * @param int $selected Id du type de delais pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @param filtertype To add a filter * @param string $filtertype To add a filter
* @param addempty Add empty entry * @param int $addempty Add empty entry
* @return void
*/ */
function select_availability($selected='',$htmlname='availid',$filtertype='',$addempty=0) function select_availability($selected='',$htmlname='availid',$filtertype='',$addempty=0)
{ {
@ -1707,7 +1711,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX.'c_input_reason'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_input_reason';
$sql.= " WHERE active=1"; $sql.= " WHERE active=1";
$sql.= " ORDER BY rowid"; $sql.= " ORDER BY rowid";
dol_syslog('Form::load_cache_demand_reason sql='.$sql,LOG_DEBUG); dol_syslog(get_class($this)."::load_cache_demand_reason sql=".$sql,LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1739,10 +1743,11 @@ class Form
/** /**
* Return list of events that triggered an object creation * Return list of events that triggered an object creation
* *
* @param selected Id du type d'origine pre-selectionne * @param int $selected Id du type d'origine pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @param exclude To exclude a code value (Example: SRC_PROP) * @param string $exclude To exclude a code value (Example: SRC_PROP)
* @param addempty Add an empty entry * @param int $addempty Add an empty entry
* @return void
*/ */
function select_demand_reason($selected='',$htmlname='demandreasonid',$exclude='',$addempty=0) function select_demand_reason($selected='',$htmlname='demandreasonid',$exclude='',$addempty=0)
{ {
@ -1786,7 +1791,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement";
$sql.= " WHERE active > 0"; $sql.= " WHERE active > 0";
$sql.= " ORDER BY id"; $sql.= " ORDER BY id";
dol_syslog('Form::load_cache_types_paiements sql='.$sql,LOG_DEBUG); dol_syslog(get_class($this)."::load_cache_types_paiements sql=".$sql,LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -1816,10 +1821,11 @@ class Form
/** /**
* Retourne la liste des types de paiements possibles * Retourne la liste des types de paiements possibles
* *
* @param selected Id du type de paiement pre-selectionne * @param string $selected Id du type de paiement pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @param filtertype Pour filtre * @param string $filtertype Pour filtre
* @param addempty Ajoute entree vide * @param int $addempty Ajoute entree vide
* @return void
*/ */
function select_conditions_paiements($selected='',$htmlname='condid',$filtertype=-1,$addempty=0) function select_conditions_paiements($selected='',$htmlname='condid',$filtertype=-1,$addempty=0)
{ {
@ -1850,19 +1856,20 @@ class Form
/** /**
* Return list of payment methods * Return list of payment methods
* *
* @param selected Id du mode de paiement pre-selectionne * @param string $selected Id du mode de paiement pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @param filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz)) * @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
* @param format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
* @param empty 1=peut etre vide, 0 sinon * @param int $empty 1=peut etre vide, 0 sinon
* @param noadmininfo 0=Add admin info, 1=Disable admin info * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @param maxlength Max length of label * @param int $maxlength Max length of label
* @return void
*/ */
function select_types_paiements($selected='',$htmlname='paiementtype',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0) function select_types_paiements($selected='',$htmlname='paiementtype',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0)
{ {
global $langs,$user; global $langs,$user;
dol_syslog("Form::select_type_paiements $selected, $htmlname, $filtertype, $format",LOG_DEBUG); dol_syslog(get_class($this)."::select_type_paiements ".$selected.", ".$htmlname.", ".$filtertype.", ".$format,LOG_DEBUG);
$filterarray=array(); $filterarray=array();
if ($filtertype == 'CRDT') $filterarray=array(0,2); if ($filtertype == 'CRDT') $filterarray=array(0,2);
@ -1904,8 +1911,9 @@ class Form
/** /**
* Selection HT or TTC * Selection HT or TTC
* *
* @param selected Id pre-selectionne * @param string $selected Id pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @return void
*/ */
function select_PriceBaseType($selected='',$htmlname='price_base_type') function select_PriceBaseType($selected='',$htmlname='price_base_type')
{ {
@ -1916,8 +1924,9 @@ class Form
/** /**
* Selection HT or TTC * Selection HT or TTC
* *
* @param selected Id pre-selectionne * @param string $selected Id pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @return void
*/ */
function load_PriceBaseType($selected='',$htmlname='price_base_type') function load_PriceBaseType($selected='',$htmlname='price_base_type')
{ {
@ -1950,12 +1959,13 @@ class Form
/** /**
* Return a HTML select list of bank accounts * Return a HTML select list of bank accounts
* *
* @param selected Id account pre-selected * @param string $selected Id account pre-selected
* @param htmlname Name of select zone * @param string $htmlname Name of select zone
* @param statut Status of searched accounts (0=open, 1=closed) * @param int $statut Status of searched accounts (0=open, 1=closed)
* @param filtre To filter list * @param string $filtre To filter list
* @param useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param moreattrib To add more attribute on select * @param string $moreattrib To add more attribute on select
* @return void
*/ */
function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='') function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='')
{ {
@ -1970,7 +1980,7 @@ class Form
if ($filtre) $sql.=" AND ".$filtre; if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
dol_syslog("Form::select_comptes sql=".$sql); dol_syslog(get_class($this)."::select_comptes sql=".$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
@ -2014,11 +2024,11 @@ class Form
/** /**
* Return list of categories having choosed type * Return list of categories having choosed type
* *
* @param type Type de categories (0=product, 1=supplier, 2=customer, 3=member) * @param int $type Type de categories (0=product, 1=supplier, 2=customer, 3=member)
* @param selected Id of category preselected * @param string $selected Id of category preselected
* @param select_name HTML field name * @param string $select_name HTML field name
* @param maxlength Maximum length for labels * @param int $maxlength Maximum length for labels
* @param excludeafterid Exclude all categories after this leaf in category tree. * @param int $excludeafterid Exclude all categories after this leaf in category tree.
*/ */
function select_all_categories($type, $selected='', $select_name="", $maxlength=64, $excludeafterid=0) function select_all_categories($type, $selected='', $select_name="", $maxlength=64, $excludeafterid=0)
{ {
@ -2059,15 +2069,15 @@ class Form
/** /**
* Show a confirmation HTML form or AJAX popup * Show a confirmation HTML form or AJAX popup
* *
* @param page Url of page to call if confirmation is OK * @param string $page Url of page to call if confirmation is OK
* @param title title * @param string $title Title
* @param question question * @param string $question Question
* @param action action * @param string $action Action
* @param formquestion an array with forms complementary inputs * @param array $formquestion An array with forms complementary inputs
* @param selectedchoice "" or "no" or "yes" * @param string $selectedchoice "" or "no" or "yes"
* @param useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No
* @param height Force height of box * @param int $height Force height of box
* @return string 'ajax' if a confirm ajax popup is shown, 'html' if it's an html form * @return void
*/ */
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500)
{ {
@ -2328,10 +2338,10 @@ class Form
/** /**
* Show a form to select payment conditions * Show a form to select payment conditions
* *
* @param page Page * @param int $page Page
* @param selected Id condition pre-selectionne * @param string $selected Id condition pre-selectionne
* @param htmlname Name of select html field * @param string $htmlname Name of select html field
* @param addempty Ajoute entree vide * @param int $addempty Ajoute entree vide
* @return void * @return void
*/ */
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
@ -2400,10 +2410,10 @@ class Form
/** /**
* Show a select form to select origin * Show a select form to select origin
* *
* @param page Page * @param string $page Page
* @param selected Id condition pre-selectionne * @param string $selected Id condition pre-selectionne
* @param htmlname Name of select html field * @param string $htmlname Name of select html field
* @param addempty Add empty entry * @param int $addempty Add empty entry
* @return void * @return void
*/ */
function form_demand_reason($page, $selected='', $htmlname='demandreason', $addempty=0) function form_demand_reason($page, $selected='', $htmlname='demandreason', $addempty=0)
@ -2443,9 +2453,9 @@ class Form
/** /**
* Show a form to select a date * Show a form to select a date
* *
* @param page Page * @param string $page Page
* @param selected Date preselected * @param string $selected Date preselected
* @param htmlname Name of input html field * @param string $htmlname Name of input html field
* @return void * @return void
*/ */
function form_date($page, $selected='', $htmlname) function form_date($page, $selected='', $htmlname)
@ -2480,11 +2490,11 @@ class Form
/** /**
* Show a select form to choose a user * Show a select form to choose a user
* *
* @param page Page * @param string $page Page
* @param selected Id of user preselected * @param string $selected Id of user preselected
* @param htmlname Name of input html field * @param string $htmlname Name of input html field
* @param exclude List of users id to exclude * @param array $exclude List of users id to exclude
* @param include List of users id to include * @param array $include List of users id to include
* @return void * @return void
*/ */
function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='') function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='')
@ -2523,9 +2533,9 @@ class Form
/** /**
* Affiche formulaire de selection des modes de reglement * Affiche formulaire de selection des modes de reglement
* *
* @param page Page * @param string $page Page
* @param selected Id mode pre-selectionne * @param int $selected Id mode pre-selectionne
* @param htmlname Name of select html field * @param string $htmlname Name of select html field
* @return void * @return void
*/ */
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id') function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id')
@ -2621,9 +2631,9 @@ class Form
/** /**
* Affiche formulaire de selection des contacts * Affiche formulaire de selection des contacts
* *
* @param page Page * @param string $page Page
* @param selected Id contact pre-selectionne * @param int $selected Id contact pre-selectionne
* @param htmlname Nom du formulaire select * @param string $htmlname Nom du formulaire select
* @return void * @return void
*/ */
function form_contacts($page, $societe, $selected='', $htmlname='contactidp') function form_contacts($page, $societe, $selected='', $htmlname='contactidp')
@ -2706,8 +2716,8 @@ class Form
/** /**
* Retourne la liste des devises, dans la langue de l'utilisateur * Retourne la liste des devises, dans la langue de l'utilisateur
* *
* @param selected code devise pre-selectionne * @param string $selected preselected currency code
* @param htmlname nom de la liste deroulante * @param string $htmlname name of HTML select list
* @return void * @return void
*/ */
function select_currency($selected='',$htmlname='currency_id') function select_currency($selected='',$htmlname='currency_id')
@ -2716,9 +2726,9 @@ class Form
} }
/** /**
* Charge dans cache la liste des devises * Load into the cache all currencies
* *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko * @return int Nb of loaded lines, 0 if already loaded, <0 if KO
*/ */
function load_cache_currencies() function load_cache_currencies()
{ {
@ -2733,7 +2743,7 @@ class Form
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
$sql.= " ORDER BY code_iso ASC"; $sql.= " ORDER BY code_iso ASC";
dol_syslog('Form::load_cache_currencies sql='.$sql, LOG_DEBUG); dol_syslog(get_class($this).'::load_cache_currencies sql='.$sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -2764,8 +2774,9 @@ class Form
/** /**
* Retourne la liste des devises, dans la langue de l'utilisateur * Retourne la liste des devises, dans la langue de l'utilisateur
* *
* @param selected code devise pre-selectionne * @param string $selected preselected currency code
* @param htmlname nom de la liste deroulante * @param string $htmlname name of HTML select list
* @return void
*/ */
function selectcurrency($selected='',$htmlname='currency_id') function selectcurrency($selected='',$htmlname='currency_id')
{ {
@ -2802,20 +2813,20 @@ class Form
/** /**
* Output an HTML select vat rate * Output an HTML select vat rate
* *
* @param htmlname Nom champ html * @param string $htmlname Nom champ html
* @param selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage. * @param float $selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
* @param societe_vendeuse Objet societe vendeuse * @param Societe $societe_vendeuse Object societe vendeuse
* @param societe_acheteuse Objet societe acheteuse * @param Societe $societe_acheteuse Object societe acheteuse
* @param idprod Id product * @param int $idprod Id product
* @param info_bits Miscellaneous information on line * @param int $info_bits Miscellaneous information on line
* @param type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined) * @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 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 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 = 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. * 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. * Sinon la TVA proposee par defaut=0. Fin de regle.
* @deprecated
* @return void * @return void
* @deprecated
*/ */
function select_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='') function select_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='')
{ {
@ -2826,13 +2837,13 @@ class Form
/** /**
* Output an HTML select vat rate * Output an HTML select vat rate
* *
* @param htmlname Nom champ html * @param string $htmlname Nom champ html
* @param selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage. * @param float $selectedrate Forcage du taux tva pre-selectionne. Mettre '' pour aucun forcage.
* @param societe_vendeuse Objet societe vendeuse * @param Societe $societe_vendeuse Objet societe vendeuse
* @param societe_acheteuse Objet societe acheteuse * @param Societe $societe_acheteuse Objet societe acheteuse
* @param idprod Id product * @param int $idprod Id product
* @param info_bits Miscellaneous information on line (1 for NPR) * @param int $info_bits Miscellaneous information on line (1 for NPR)
* @param type ''=Unknown, 0=Product, 1=Service (Used if idprod not defined) * @param int $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 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 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 = 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.
@ -2992,18 +3003,18 @@ class Form
* - local date of PHP server if set_time is '' * - 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) * - 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 timestamp $set_time Pre-selected date (must be a local PHP server timestamp)
* @param prefix Prefix for fields name * @param string $prefix Prefix for fields name
* @param h 1=Show also hours * @param int $h 1=Show also hours
* @param m 1=Show also minutes * @param int $m 1=Show also minutes
* @param empty 0=Fields required, 1=Empty input is allowed * @param int $empty 0=Fields required, 1=Empty input is allowed
* @param form_name Form name. Used by popup dates. * @param string $form_name Form name. Used by popup dates.
* @param d 1=Show days, month, years * @param int $d 1=Show days, month, years
* @param addnowbutton Add a button "Now" * @param int $addnowbutton Add a button "Now"
* @param nooutput Do not output html string but return it * @param int $nooutput Do not output html string but return it
* @param disabled Disable input fields * @param int $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 * @param int $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 * @return mixed 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='') function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='')
{ {
@ -3296,16 +3307,16 @@ class Form
/** /**
* Show a select form from an array * Show a select form from an array
* *
* @param htmlname Name of html select area * @param string $htmlname Name of html select area
* @param array Array with key+value * @param array $array Array with key+value
* @param id Preselected key * @param int $id Preselected key
* @param show_empty 1 si il faut ajouter une valeur vide dans la liste, 0 sinon * @param int $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 int $key_in_label 1 pour afficher la key dans la valeur "[key] value"
* @param value_as_key 1 to use value as key * @param int $value_as_key 1 to use value as key
* @param option Valeur de l'option en fonction du type choisi * @param string $option Valeur de l'option en fonction du type choisi
* @param translate Translate and encode value * @param int $translate Translate and encode value
* @param maxlen Length maximum for labels * @param int $maxlen Length maximum for labels
* @param disabled Html select box is disabled * @param int $disabled Html select box is disabled
* @return string HTML select string * @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) function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $option='', $translate=0, $maxlen=0, $disabled=0)
@ -3355,17 +3366,6 @@ class Form
return $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 * Return an html string with a select combo box to choose yes or no
@ -3410,10 +3410,10 @@ class Form
/** /**
* Return list of export templates * Return list of export templates
* *
* @param selected Id modele pre-selectionne * @param string $selected Id modele pre-selectionne
* @param htmlname Nom de la zone select * @param string $htmlname Name of HTML select
* @param type Type des modeles recherches * @param string $type Type of searched templates
* @param useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return void * @return void
*/ */
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
@ -3673,7 +3673,7 @@ class Form
if (is_array($include) && $includeGroups) $sql.= " AND ug.rowid IN ('".$includeGroups."')"; if (is_array($include) && $includeGroups) $sql.= " AND ug.rowid IN ('".$includeGroups."')";
$sql.= " ORDER BY ug.nom ASC"; $sql.= " ORDER BY ug.nom ASC";
dol_syslog("Form::select_dolgroups sql=".$sql); dol_syslog(get_class($this)."::select_dolgroups sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -142,6 +142,7 @@ class Ldap
* false if failed. Takes an array of possible servers - if one doesn't work, * false if failed. Takes an array of possible servers - if one doesn't work,
* it tries the next and so on. * it tries the next and so on.
* *
* @return void
* @deprecated Utiliser connect_bind a la place * @deprecated Utiliser connect_bind a la place
*/ */
function connect() function connect()
@ -184,7 +185,7 @@ class Ldap
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword * Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
* After return, this->connection and $this->bind are defined * After return, this->connection and $this->bind are defined
* *
* @return int <0 si KO, 1 si bind anonymous, 2 si bind auth * @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
*/ */
function connect_bind() function connect_bind()
{ {

View File

@ -23,8 +23,7 @@
*/ */
/** /**
* \class Stats * Parent class of statistics class
* \brief Parent class of statistics class
*/ */
abstract class Stats abstract class Stats
{ {

View File

@ -85,8 +85,7 @@ function dol_quoted_printable_encode($input, $line_max=76)
/** /**
* \class vCard * Class to buld vCard files
* \brief Class to buld vCard files
*/ */
class vCard class vCard
{ {