This commit is contained in:
Laurent Destailleur
2012-02-04 15:20:32 +01:00
parent ffac9689f4
commit dc80f74d2f
3 changed files with 109 additions and 103 deletions

View File

@@ -1796,14 +1796,15 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
/** /**
* Show logo action * Show logo action
* *
* @param string $alt Text for image alt and title * @param string $alt Text for image alt and title ('default', ...)
* @param int $numaction Action to show * @param int $numaction Action to show
* @return string Return an img tag * @return string Return an img tag
*/ */
function img_action($alt = "default", $numaction) function img_action($alt, $numaction)
{ {
global $conf,$langs; global $conf,$langs;
if ($alt=="default") { if ($alt=="default")
{
if ($numaction == -1) $alt=$langs->transnoentitiesnoconv("ChangeDoNotContact"); if ($numaction == -1) $alt=$langs->transnoentitiesnoconv("ChangeDoNotContact");
if ($numaction == 0) $alt=$langs->transnoentitiesnoconv("ChangeNeverContacted"); if ($numaction == 0) $alt=$langs->transnoentitiesnoconv("ChangeNeverContacted");
if ($numaction == 1) $alt=$langs->transnoentitiesnoconv("ChangeToContact"); if ($numaction == 1) $alt=$langs->transnoentitiesnoconv("ChangeToContact");
@@ -1830,8 +1831,8 @@ function img_pdf($alt = "default",$size=3)
/** /**
* Show logo + * Show logo +
* *
* @param alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @return string Retourne tag img * @return string Return tag img
*/ */
function img_edit_add($alt = "default") function img_edit_add($alt = "default")
{ {
@@ -1842,7 +1843,7 @@ function img_edit_add($alt = "default")
/** /**
* Show logo - * Show logo -
* *
* @param alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_edit_remove($alt = "default") function img_edit_remove($alt = "default")
@@ -1855,9 +1856,9 @@ function img_edit_remove($alt = "default")
/** /**
* Show logo editer/modifier fiche * Show logo editer/modifier fiche
* *
* @param alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @param float Si il faut y mettre le style "float: right" * @param float $float Si il faut y mettre le style "float: right"
* @param other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_edit($alt = "default", $float=0, $other='') function img_edit($alt = "default", $float=0, $other='')
@@ -1874,9 +1875,9 @@ function img_edit($alt = "default", $float=0, $other='')
/** /**
* Show logo view card * Show logo view card
* *
* @param alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @param float Si il faut y mettre le style "float: right" * @param float $float Si il faut y mettre le style "float: right"
* @param other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_view($alt = "default", $float=0, $other='') function img_view($alt = "default", $float=0, $other='')
@@ -1893,8 +1894,8 @@ function img_view($alt = "default", $float=0, $other='')
/** /**
* Show delete logo * Show delete logo
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text on alt image
* @param other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_delete($alt = "default", $other='') function img_delete($alt = "default", $other='')
@@ -1908,8 +1909,8 @@ function img_delete($alt = "default", $other='')
/** /**
* Show help logo with cursor "?" * Show help logo with cursor "?"
* *
* @param usehelpcursor * @param string $usehelpcursor Use help cursor
* @param usealttitle Texte to use as alt title * @param string $usealttitle Text to use as alt title
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_help($usehelpcursor=1,$usealttitle=1) function img_help($usehelpcursor=1,$usealttitle=1)
@@ -1931,8 +1932,8 @@ function img_help($usehelpcursor=1,$usealttitle=1)
/** /**
* Affiche logo info * Affiche logo info
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_info($alt = "default") function img_info($alt = "default")
{ {
@@ -1942,11 +1943,11 @@ function img_info($alt = "default")
} }
/** /**
* Affiche logo warning * Show logo warning
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param float Si il faut afficher le style "float: right" * @param int $float If we must add style "float: right"
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_warning($alt = "default",$float=0) function img_warning($alt = "default",$float=0)
{ {
@@ -1958,8 +1959,8 @@ function img_warning($alt = "default",$float=0)
/** /**
* Affiche logo error * Affiche logo error
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_error($alt = "default") function img_error($alt = "default")
{ {
@@ -1971,9 +1972,9 @@ function img_error($alt = "default")
/** /**
* Affiche logo telephone * Affiche logo telephone
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param option Choose of logo * @param int $option Option
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_phone($alt = "default",$option=0) function img_phone($alt = "default",$option=0)
{ {
@@ -1989,8 +1990,8 @@ function img_phone($alt = "default",$option=0)
/** /**
* Affiche logo suivant * Affiche logo suivant
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_next($alt = "default") function img_next($alt = "default")
{ {
@@ -2004,8 +2005,8 @@ function img_next($alt = "default")
/** /**
* Affiche logo precedent * Affiche logo precedent
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_previous($alt = "default") function img_previous($alt = "default")
{ {
@@ -2017,9 +2018,9 @@ function img_previous($alt = "default")
/** /**
* Show logo down arrow * Show logo down arrow
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param selected Affiche version "selected" du logo * @param int $selected Selected
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_down($alt = "default", $selected=0) function img_down($alt = "default", $selected=0)
{ {
@@ -2032,9 +2033,9 @@ function img_down($alt = "default", $selected=0)
/** /**
* Show logo top arrow * Show logo top arrow
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param selected Affiche version "selected" du logo * @param int $selected Selected
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_up($alt = "default", $selected=0) function img_up($alt = "default", $selected=0)
{ {
@@ -2047,9 +2048,9 @@ function img_up($alt = "default", $selected=0)
/** /**
* Affiche logo gauche * Affiche logo gauche
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param selected Affiche version "selected" du logo * @param int $selected Selected
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_left($alt = "default", $selected=0) function img_left($alt = "default", $selected=0)
{ {
@@ -2062,9 +2063,9 @@ function img_left($alt = "default", $selected=0)
/** /**
* Affiche logo droite * Affiche logo droite
* *
* @param alt Texte sur le alt de l'image * @param string $alt Text to show on alt image
* @param selected Affiche version "selected" du logo * @param int $selected Selected
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_right($alt = "default", $selected=0) function img_right($alt = "default", $selected=0)
{ {
@@ -2077,9 +2078,9 @@ function img_right($alt = "default", $selected=0)
/** /**
* Affiche le logo tick si allow * Affiche le logo tick si allow
* *
* @param allow Authorise ou non * @param string $allow Allow
* @param alt Alt text for img * @param string $alt Text to show on alt image
* @return string Retourne tag img * @return string Return img tag
*/ */
function img_allow($allow,$alt='default') function img_allow($allow,$alt='default')
{ {
@@ -2670,7 +2671,7 @@ function dol_print_error($db='',$error='')
/** /**
* Show email to contact if technical error * Show email to contact if technical error
* *
* @reutnr void * @return void
*/ */
function dol_print_error_email() function dol_print_error_email()
{ {
@@ -2782,11 +2783,13 @@ function print_titre($title)
/** /**
* Show a title with picto * Show a title with picto
* @param titre Title to show *
* @param mesg Added message to show on right * @param string $titre Title to show
* @param picto Icon to use before title (should be a 32x32 transparent png file) * @param string $mesg Added message to show on right
* @param pictoisfullpath 1=Icon name is a full absolute url of image * @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param id To force an id on html objects * @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param int $id To force an id on html objects
* @return void
*/ */
function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='') function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='')
{ {
@@ -2796,11 +2799,12 @@ function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpat
/** /**
* Load a title with picto * Load a title with picto
* *
* @param titre Title to show * @param string $titre Title to show
* @param mesg Added message to show on right * @param string $mesg Added message to show on right
* @param picto Icon to use before title (should be a 32x32 transparent png file) * @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param pictoisfullpath 1=Icon name is a full absolute url of image * @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param id To force an id on html objects * @param int $id To force an id on html objects
* @return void
*/ */
function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='') function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='')
{ {
@@ -2829,17 +2833,17 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
/** /**
* Print a title with navigation controls for pagination * Print a title with navigation controls for pagination
* *
* @param titre Title to show (required) * @param string $titre Title to show (required)
* @param page Numero of page (required) * @param string $page Numero of page (required)
* @param file Url of page (required) * @param string $file Url of page (required)
* @param options parametres complementaires lien ('' par defaut) * @param string $options parametres complementaires lien ('' par defaut)
* @param sortfield champ de tri ('' par defaut) * @param string $sortfield champ de tri ('' par defaut)
* @param sortorder ordre de tri ('' par defaut) * @param string $sortorder ordre de tri ('' par defaut)
* @param center chaine du centre ('' par defaut) * @param string $center chaine du centre ('' par defaut)
* @param num number of records found by select with limit+1 * @param int $num number of records found by select with limit+1
* @param totalnboflines Total number of records/lines for all pages (if known) * @param int $totalnboflines Total number of records/lines for all pages (if known)
* @param picto Icon to use before title (should be a 32x32 transparent png file) * @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param pictoisfullpath 1=Icon name is a full absolute url of image * @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @return void * @return void
*/ */
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0) function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0)
@@ -3256,9 +3260,9 @@ function get_product_vat_for_country($idprod, $countrycode)
/** /**
* Return localtax rate of a product in a particular selling country * Return localtax rate of a product in a particular selling country
* *
* @param idprod Id of product * @param int $idprod Id of product
* @package local 1 for localtax1, 2 for localtax 2 * @param int $local 1 for localtax1, 2 for localtax 2
* @param countrycode Country code (FR, US, IT, ...) * @param string $countrycode Country code (FR, US, IT, ...)
* @return int <0 if KO, Vat rate if OK * @return int <0 if KO, Vat rate if OK
* TODO May be this should be better as a method of product class * TODO May be this should be better as a method of product class
*/ */
@@ -3410,9 +3414,10 @@ function get_default_localtax($societe_vendeuse, $societe_acheteuse, $local, $id
/** /**
* Return yes or no in current language * Return yes or no in current language
* *
* @param yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') * @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
* @param case 1=Yes/No, 0=yes/no * @param string $case 1=Yes/No, 0=yes/no
* @param color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
* @return string HTML string
*/ */
function yn($yesno, $case=1, $color=0) function yn($yesno, $case=1, $color=0)
{ {
@@ -3741,9 +3746,9 @@ function dol_nboflines($s,$maxchar=0)
/** /**
* Return nb of lines of a formated text with \n and <br> * Return nb of lines of a formated text with \n and <br>
* *
* @param text Text * @param string $text Text
* @param maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut) * @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut)
* @param charset Give the charset used to encode the $text variable in memory. * @param string $charset Give the charset used to encode the $text variable in memory.
* @return int Number of lines * @return int Number of lines
*/ */
function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8')
@@ -4315,7 +4320,7 @@ function picto_from_langcode($codelang)
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @param Object $object Object object * @param Object $object Object object
* @param array $head Object head * @param array &$head Object head
* @param int &$h New position to fill * @param int &$h New position to fill
* @param string $type Value for object where objectvalue can be * @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view * 'thirdparty' to add a tab in third party view

View File

@@ -43,10 +43,10 @@ function dol_getDefaultFormat()
/** /**
* Output content of a file $filename in version of current language (otherwise may use an alternate language) * Output content of a file $filename in version of current language (otherwise may use an alternate language)
* *
* @param langs Object language to use for output * @param Translate $langs Object language to use for output
* @param filename Relative filename to output * @param string $filename Relative filename to output
* @param searchalt 1=Search also in alternative languages * @param int $searchalt 1=Search also in alternative languages
* @return boolean * @return boolean true if OK, false if KO
*/ */
function dol_print_file($langs,$filename,$searchalt=0) function dol_print_file($langs,$filename,$searchalt=0)
{ {
@@ -93,7 +93,7 @@ function dol_print_file($langs,$filename,$searchalt=0)
/** /**
* Show informations on an object * Show informations on an object
* *
* @param object Objet to show * @param Object $object Objet to show
* @return void * @return void
*/ */
function dol_print_object_info($object) function dol_print_object_info($object)
@@ -756,9 +756,9 @@ function check_value($mask,$value)
/** /**
* Convert a binary data to string that represent hexadecimal value * Convert a binary data to string that represent hexadecimal value
* *
* @param bin Value to convert * @param string $bin Value to convert
* @param pad Add 0 * @param boolean $pad Add 0
* @param upper Convert to tupper * @param boolean $upper Convert to tupper
* @return string x * @return string x
*/ */
function binhex($bin, $pad=false, $upper=false) function binhex($bin, $pad=false, $upper=false)
@@ -912,7 +912,7 @@ function weight_convert($weight,&$from_unit,$to_unit)
* *
* @param DoliDB $db Handler database * @param DoliDB $db Handler database
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param User $user Object user * @param User &$user Object user
* @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder * @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* *
@@ -1135,6 +1135,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
/** /**
* This function evaluates a string that should be a valid IPv4 * This function evaluates a string that should be a valid IPv4
* *
* @param string $ip IP Address
* @return It returns 0 if $ip is not a valid IPv4 * @return It returns 0 if $ip is not a valid IPv4
* It returns 1 if $ip is a valid IPv4 and is a public IP * It returns 1 if $ip is a valid IPv4 and is a public IP
* It returns 2 if $ip is a valid IPv4 and is a private lan IP * It returns 2 if $ip is a valid IPv4 and is a private lan IP

View File

@@ -412,7 +412,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
{ {
// So search if task has a subtask legitimate to show // So search if task has a subtask legitimate to show
$foundtaskforuserdeeper=0; $foundtaskforuserdeeper=0;
SearchTaskInChild($foundtaskforuserdeeper,$lines[$i]->id,$lines,$taskrole); searchTaskInChild($foundtaskforuserdeeper,$lines[$i]->id,$lines,$taskrole);
//print '$foundtaskforuserpeeper='.$foundtaskforuserdeeper.'<br>'; //print '$foundtaskforuserpeeper='.$foundtaskforuserdeeper.'<br>';
if ($foundtaskforuserdeeper > 0) if ($foundtaskforuserdeeper > 0)
{ {
@@ -532,7 +532,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
* @param string &$taskrole Array of task filtered on a particular user * @param string &$taskrole Array of task filtered on a particular user
* @return int 1 if there is * @return int 1 if there is
*/ */
function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole) function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
{ {
//print 'Search in line with parent id = '.$parent.'<br>'; //print 'Search in line with parent id = '.$parent.'<br>';
$numlines=count($lines); $numlines=count($lines);
@@ -549,7 +549,7 @@ function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
return $inc; return $inc;
} }
SearchTaskInChild($inc, $lines[$i]->id, $lines, $taskrole); searchTaskInChild($inc, $lines[$i]->id, $lines, $taskrole);
//print 'Found inc='.$inc.'<br>'; //print 'Found inc='.$inc.'<br>';
if ($inc > 0) return $inc; if ($inc > 0) return $inc;