This commit is contained in:
Laurent Destailleur 2012-01-27 15:17:36 +01:00
parent 4909504b0a
commit 1f10e4e1e3
8 changed files with 94 additions and 89 deletions

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (c) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* *
@ -25,8 +25,7 @@
/** /**
* \class FormActions * Class to manage building of HTML components
* \brief Class to manage building of HTML components
*/ */
class FormActions class FormActions
{ {
@ -37,12 +36,11 @@ class FormActions
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function FormActions($DB) function FormActions($db)
{ {
$this->db = $DB; $this->db = $db;
return 1; return 1;
} }
@ -50,10 +48,11 @@ class FormActions
/** /**
* Show list of action status * Show list of action status
* *
* @param formname Name of form where select in included * @param string $formname Name of form where select in included
* @param selected Preselected value * @param string $selected Preselected value
* @param canedit 1=can edit, 0=read only * @param int $canedit 1=can edit, 0=read only
* @param htmlname Name of html prefix for html fields (selectX and valX) * @param string $htmlname Name of html prefix for html fields (selectX and valX)
* @return void
*/ */
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete') function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
{ {
@ -102,9 +101,10 @@ class FormActions
/** /**
* Show list of actions for element * Show list of actions for element
* @param object Object *
* @param typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' * @param Object $object Object
* @param socid socid of user * @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
* @param int $socid socid of user
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
function showactions($object,$typeelement,$socid=0) function showactions($object,$typeelement,$socid=0)
@ -160,8 +160,10 @@ class FormActions
/** /**
* Output list of type of event * Output list of type of event
* @param selected Type pre-selectionne *
* @param htmlname Nom champ formulaire * @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire
* @return void
*/ */
function select_type_actions($selected='',$htmlname='actioncode') function select_type_actions($selected='',$htmlname='actioncode')
{ {

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* *
@ -25,8 +25,7 @@
/** /**
* \class FormAdmin * Class to generate html code for admin pages
* \brief Class to generate html code for admin pages
*/ */
class FormAdmin class FormAdmin
{ {
@ -42,7 +41,6 @@ class FormAdmin
function FormAdmin($db) function FormAdmin($db)
{ {
$this->db = $db; $this->db = $db;
return 1; return 1;
} }
@ -279,7 +277,7 @@ class FormAdmin
/** /**
* Retourne la liste deroulante des menus disponibles (eldy) * Return a HTML select list of timezones
* *
* @param string $selected Menu pre-selectionnee * @param string $selected Menu pre-selectionnee
* @param string $htmlname Nom de la zone select * @param string $htmlname Nom de la zone select

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,8 +24,7 @@
/** /**
* \class Form * Class to manage barcode HTML
* \brief Classe permettant la generation de composants html
*/ */
class FormBarCode class FormBarCode
{ {
@ -41,7 +40,6 @@ class FormBarCode
function FormBarCode($db) function FormBarCode($db)
{ {
$this->db = $db; $this->db = $db;
return 1; return 1;
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,9 +23,8 @@
/** /**
* \class FormCompany * Class to build HTML component for third parties management
* \brief Class to build HTML component for third parties management * Only common components are here.
* \remarks Only common components must be here.
*/ */
class FormCompany class FormCompany
{ {

View File

@ -25,8 +25,7 @@
/** /**
* \class FormFile * Class to offer components to list and upload files
* \brief Class to offer components to list and upload files
*/ */
class FormFile class FormFile
{ {

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
@ -25,11 +25,11 @@
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
/** \class FormMail /**
* \brief Classe permettant la generation du formulaire html d'envoi de mail unitaire * Classe permettant la generation du formulaire html d'envoi de mail unitaire
* \remarks Utilisation: $formail = new FormMail($db) * Usage: $formail = new FormMail($db)
* \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs * $formmail->proprietes=1 ou chaine ou tableau de valeurs
* \remarks $formmail->show_form() affiche le formulaire * $formmail->show_form() affiche le formulaire
*/ */
class FormMail class FormMail
{ {
@ -69,12 +69,13 @@ class FormMail
/** /**
* \brief Constructeur * Constructor
* \param DB handler d'acces base de donnee *
* @param DoliDB $DB Database handler
*/ */
function FormMail($DB) function FormMail($db)
{ {
$this->db = $DB; $this->db = $db;
$this->withform=1; $this->withform=1;
@ -103,6 +104,8 @@ class FormMail
/** /**
* Clear list of attached files in send mail form (stored in session) * Clear list of attached files in send mail form (stored in session)
*
* @return void
*/ */
function clear_attached_files() function clear_attached_files()
{ {
@ -125,6 +128,7 @@ class FormMail
* @param string $path Full absolute path on filesystem of file, including file name * @param string $path Full absolute path on filesystem of file, including file name
* @param string $file Only filename * @param string $file Only filename
* @param string $type Mime type * @param string $type Mime type
* @return void
*/ */
function add_attached_files($path,$file,$type) function add_attached_files($path,$file,$type)
{ {
@ -148,7 +152,8 @@ class FormMail
/** /**
* Remove a file from the list of attached files (stored in SECTION array) * Remove a file from the list of attached files (stored in SECTION array)
* *
* @param $keytodelete Key in file array * @param string $keytodelete Key in file array
* @return void
*/ */
function remove_attached_files($keytodelete) function remove_attached_files($keytodelete)
{ {
@ -190,8 +195,9 @@ class FormMail
* Show the form to input an email * Show the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
* *
* @param addfileaction Name of action when posting file attachments * @param string $addfileaction Name of action when posting file attachments
* @param removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return void
*/ */
function show_form($addfileaction='addfile',$removefileaction='removefile') function show_form($addfileaction='addfile',$removefileaction='removefile')
{ {
@ -202,8 +208,9 @@ class FormMail
* Get the form to input an email * Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
* *
* @param addfileaction Name of action when posting file attachments * @param string $addfileaction Name of action when posting file attachments
* @param removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return string Form to show
*/ */
function get_form($addfileaction='addfile',$removefileaction='removefile') function get_form($addfileaction='addfile',$removefileaction='removefile')
{ {

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,9 +23,8 @@
/** /**
* \class FormOrder * Classe permettant la generation de composants html
* \brief Classe permettant la generation de composants html * Only common components are here.
* \remarks Only common components must be here.
*/ */
class FormOrder class FormOrder
{ {
@ -35,23 +34,23 @@ class FormOrder
/** /**
* \brief Constructeur * Constructor
* \param DB handler d'acces base de donnee *
* @param DoliDB $db Database handler
*/ */
function FormOrder($DB) function FormOrder($db)
{ {
$this->db = $DB; $this->db = $db;
return 1; return 1;
} }
/** /**
* Renvoie la liste des sources de commandes * Return list of way to order
* *
* @param selected Id de la source pre-selectionnee * @param string $selected Id of preselected order origin
* @param htmlname Nom de la liste deroulante * @param string $htmlname Name of HTML select list
* @param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @return array Tableau des sources de commandes * @return array Tableau des sources de commandes
*/ */
function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0) function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0)
@ -74,8 +73,12 @@ class FormOrder
/** /**
* Return list of way to order
* *
* * @param string $selected Id of preselected input method
* @param string $htmlname Name of HTML select list
* @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @return array Tableau des sources de commandes
*/ */
function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0) function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0)
{ {
@ -89,7 +92,7 @@ class FormOrder
$sql.= " FROM ".MAIN_DB_PREFIX."c_input_method"; $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method";
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
dol_syslog("Form::select_methodes_commande sql=".$sql); dol_syslog(get_class($this)."::select_methodes_commande sql=".$sql);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
@ -32,9 +32,8 @@
/** /**
* \class FormOther * Classe permettant la generation de composants html autre
* \brief Classe permettant la generation de composants html autre * Only common components are here.
* \remarks Only common components must be here.
*/ */
class FormOther class FormOther
{ {
@ -210,12 +209,12 @@ class FormOther
/** /**
* Return a HTML select list to select a percent * Return a HTML select list to select a percent
* *
* @param selected pourcentage pre-selectionne * @param string $selected pourcentage pre-selectionne
* @param htmlname nom de la liste deroulante * @param string $htmlname nom de la liste deroulante
* @param increment increment value * @param int $increment increment value
* @param start start value * @param int $start start value
* @param end end value * @param int $end end value
* @return return combo * @return string HTML select string
*/ */
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100) function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100)
{ {
@ -243,10 +242,10 @@ class FormOther
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
* @param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
* @param selected Preselected value * @param string $selected Preselected value
* @param htmlname Name of combo list * @param string $htmlname Name of combo list
* @return return Html combo list code * @return string Html combo list code
*/ */
function select_categories($type,$selected=0,$htmlname='search_categ') function select_categories($type,$selected=0,$htmlname='search_categ')
{ {
@ -279,10 +278,10 @@ class FormOther
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
* @param selected Preselected value * @param string $selected Preselected value
* @param htmlname Name of combo list * @param string $htmlname Name of combo list
* @param user Object user * @param User $user Object user
* @return return Html combo list code * @return string Html combo list code
*/ */
function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user) function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user)
{ {
@ -373,11 +372,11 @@ class FormOther
/** /**
* Output a HTML code to select a color * Output a HTML code to select a color
* *
* @param set_color Pre-selected color * @param string $set_color Pre-selected color
* @param prefix Name of HTML field * @param string $prefix Name of HTML field
* @param form_name Name of form * @param string $form_name Name of form
* @param showcolorbox 1=Show color code and color box, 0=Show only color code * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code
* @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
* @return void * @return void
*/ */
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')