This commit is contained in:
Laurent Destailleur 2012-02-04 14:39:47 +01:00
parent ac1c91b740
commit ffac9689f4
23 changed files with 401 additions and 407 deletions

View File

@ -1,76 +0,0 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/lib/accountancy.lib.php
* \brief Library of accountancy functions
*/
/**
* @param $db
* @param $year
* @param $socid
*/
function get_ca_propal ($db, $year, $socid)
{
$sql = "SELECT sum(f.price - f.remise) as sum FROM ".MAIN_DB_PREFIX."propal as f WHERE fk_statut in (1,2,4) AND date_format(f.datep, '%Y') = '".$year."'";
if ($socid)
{
$sql .= " AND f.fk_soc = $socid";
}
$result = $db->query($sql);
if ($result)
{
$res = $db->fetch_object($result);
return $res->sum;
}
else
{
return 0;
}
}
function get_ca ($db, $year, $socid)
{
global $conf;
$sql = "SELECT sum(f.amount) as sum FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.fk_statut in (1,2)";
if ($conf->global->COMPTA_MODE != 'CREANCES-DETTES')
{
$sql .= " AND f.paye = 1";
}
$sql .= " AND date_format(f.datef , '%Y') = '".$year."'";
if ($socid)
{
$sql .= " AND f.fk_soc = $socid";
}
$result = $db->query($sql);
if ($result)
{
$res = $db->fetch_object($result);
return $res->sum;
}
else
{
return 0;
}
}

View File

@ -420,7 +420,8 @@ function actions_prepare_head($object)
/** /**
* Define head array for tabs of agenda setup pages * Define head array for tabs of agenda setup pages
* *
* @return Array of head * @param string $param Parameters to add to url
* @return array Array of head
*/ */
function calendars_prepare_head($param) function calendars_prepare_head($param)
{ {

View File

@ -26,15 +26,15 @@
/** /**
* Get value of an HTML field, do Ajax process and show result * Get value of an HTML field, do Ajax process and show result
* *
* @param selected Preselecte value * @param string $selected Preselecte value
* @param htmlname HTML name of input field * @param string $htmlname HTML name of input field
* @param url Url for request: /chemin/fichier.php * @param string $url Url for request: /chemin/fichier.php
* @param option More parameters on URL request * @param string $option More parameters on URL request
* @param minLength Minimum number of chars to trigger that Ajax search * @param int $minLength Minimum number of chars to trigger that Ajax search
* @param autoselect Automatic selection if just one value * @param int $autoselect Automatic selection if just one value
* @return string script complet * @return string Script
*/ */
function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2,$autoselect=0) function ajax_autocompleter($selected,$htmlname,$url,$option='',$minLength=2,$autoselect=0)
{ {
if (empty($minLength)) $minLength=1; if (empty($minLength)) $minLength=1;
@ -84,13 +84,13 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='',$minLength=2,
/** /**
* Get value of field, do Ajax process and return result * Get value of field, do Ajax process and return result
* *
* @param htmlname nom et id du champ * @param string $htmlname Name of field
* @param fields other fields to autocomplete * @param string $fields other fields to autocomplete
* @param url chemin du fichier de reponse : /chemin/fichier.php * @param string $url Chemin du fichier de reponse : /chemin/fichier.php
* @param option More parameters on URL request * @param string $option More parameters on URL request
* @param minLength Minimum number of chars to trigger that Ajax search * @param int $minLength Minimum number of chars to trigger that Ajax search
* @param autoselect Automatic selection if just one value * @param int $autoselect Automatic selection if just one value
* @return string script complet * @return string Script
*/ */
function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,$autoselect=0) function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,$autoselect=0)
{ {
@ -163,10 +163,12 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,
/** /**
* Show an ajax dialog * Show an ajax dialog
* @param title Title of dialog box *
* @param message Message of dialog box * @param string $title Title of dialog box
* @param w Width of dialog box * @param string $message Message of dialog box
* @param h height of dialog box * @param int $w Width of dialog box
* @param int $h height of dialog box
* @return void
*/ */
function ajax_dialog($title,$message,$w=350,$h=150) function ajax_dialog($title,$message,$w=350,$h=150)
{ {
@ -199,8 +201,8 @@ function ajax_dialog($title,$message,$w=350,$h=150)
/** /**
* Convert a select html field into an ajax combobox * Convert a select html field into an ajax combobox
* *
* @param htmlname Name of html field * @param string $htmlname Name of html field
* @return string Return html string to convert a select field into a combo * @return string Return html string to convert a select field into a combo
*/ */
function ajax_combobox($htmlname) function ajax_combobox($htmlname)
{ {

View File

@ -84,8 +84,9 @@ function bank_prepare_head($object)
/** /**
* Check account number informations for a bank account * Check account number informations for a bank account
* @param account A bank account *
* @return int True if informations are valid, false otherwise * @param Account $account A bank account
* @return int True if informations are valid, false otherwise
*/ */
function checkBanForAccount($account) function checkBanForAccount($account)
{ {
@ -131,7 +132,7 @@ function checkBanForAccount($account)
{ {
$CCC = strtolower(trim($account->number)); $CCC = strtolower(trim($account->number));
$rib = strtolower(trim($account->code_banque).trim($account->code_guichet)); $rib = strtolower(trim($account->code_banque).trim($account->code_guichet));
$cle_rib=strtolower(CheckES($rib,$CCC)); $cle_rib=strtolower(checkES($rib,$CCC));
if ($cle_rib == strtolower($account->cle)) if ($cle_rib == strtolower($account->cle))
{ {
return true; return true;
@ -159,9 +160,12 @@ function checkBanForAccount($account)
/** /**
* Returns the key for Spanish Banks Accounts * Returns the key for Spanish Banks Accounts
* @return string Key *
* @param string $IentOfi IentOfi
* @param string $InumCta InumCta
* @return string Key
*/ */
function CheckES($IentOfi,$InumCta) function checkES($IentOfi,$InumCta)
{ {
if (empty($IentOfi)||empty($InumCta)||strlen($IentOfi)!=8||strlen($InumCta)!=10) if (empty($IentOfi)||empty($InumCta)||strlen($IentOfi)!=8||strlen($InumCta)!=10)
{ {

View File

@ -58,14 +58,15 @@ else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
/** /**
* barcode_print(code [, encoding [, scale [, mode ]]] ); * Print barcode
* *
* encodes and prints a barcode * @param string $code Code
* @param string $encoding Encoding
* @param string $scale Scale
* @param string $mode 'png' or 'jpg' ...
* *
* return: *
* array[encoding] : the encoding which has been used * @return array $bars array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
* array[bars] : the bars
* array[text] : text-positioning info
*/ */
function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png") function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
{ {
@ -90,9 +91,7 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
} }
/** /**
* barcode_encode(code, encoding) * Encodes $code with $encoding using genbarcode OR built-in encoder if you don't have genbarcode only EAN-13/ISBN is possible
* encodes $code with $encoding using genbarcode OR built-in encoder
* if you don't have genbarcode only EAN-13/ISBN is possible
* *
* You can use the following encodings (when you have genbarcode): * You can use the following encodings (when you have genbarcode):
* ANY choose best-fit (default) * ANY choose best-fit (default)
@ -109,10 +108,9 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png")
* MSI MSI (by Leonid A. Broukhis) * MSI MSI (by Leonid A. Broukhis)
* PLS Plessey (by Leonid A. Broukhis) * PLS Plessey (by Leonid A. Broukhis)
* *
* return: * @param string $code Code
* array[encoding] : the encoding which has been used * @param string $encoding Encoding
* array[bars] : the bars * @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
* array[text] : text-positioning info
*/ */
function barcode_encode($code,$encoding) function barcode_encode($code,$encoding)
{ {
@ -159,25 +157,10 @@ function barcode_encode($code,$encoding)
/** /**
* Built-In Encoders * Calculate EAN sum
* Part of PHP-Barcode 0.3pl1
* *
* (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de> * @param string $ean EAN to encode
* * @return string Sum
* The newest version can be found at http://www.ashberg.de/bar
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
function barcode_gen_ean_sum($ean) function barcode_gen_ean_sum($ean)
{ {
@ -192,13 +175,11 @@ function barcode_gen_ean_sum($ean)
} }
/** /**
* barcode_encode_ean(code [, encoding]) * Encode EAN
* encodes $ean with EAN-13 using builtin functions
* *
* return: * @param string $ean Code
* array[encoding] : the encoding which has been used (EAN-13) * @param string $encoding Encoding
* array[bars] : the bars * @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
* array[text] : text-positioning info
*/ */
function barcode_encode_ean($ean, $encoding = "EAN-13") function barcode_encode_ean($ean, $encoding = "EAN-13")
{ {
@ -254,13 +235,11 @@ function barcode_encode_ean($ean, $encoding = "EAN-13")
} }
/** /**
* barcode_encode_genbarcode(code, encoding) * Encode result of genbarcode command
* encodes $code with $encoding using genbarcode
* *
* return: * @param string $code Code
* array[encoding] : the encoding which has been used * @param string $encoding Encoding
* array[bars] : the bars * @return array array('encoding': the encoding which has been used, 'bars': the bars, 'text': text-positioning info)
* array[text] : text-positioning info
*/ */
function barcode_encode_genbarcode($code,$encoding) function barcode_encode_genbarcode($code,$encoding)
{ {

View File

@ -26,6 +26,7 @@
* Prepare array with list of tabs * Prepare array with list of tabs
* *
* @param Object $object Object related to tabs * @param Object $object Object related to tabs
* @param string $type Type of category
* @return array Array of tabs to shoc * @return array Array of tabs to shoc
*/ */
function categories_prepare_head($object,$type) function categories_prepare_head($object,$type)

View File

@ -379,11 +379,12 @@ function getFormeJuridiqueLabel($code)
/** /**
* Show html area for list of projects * Show html area for list of projects
* *
* @param conf Object conf * @param Conf $conf Object conf
* @param langs Object langs * @param Translate $langs Object langs
* @param db Database handler * @param DoliDB $db Database handler
* @param object Third party object * @param Object $object Third party object
* @param backtopage Url to go once contact is created * @param string $backtopage Url to go once contact is created
* @return void
*/ */
function show_projects($conf,$langs,$db,$object,$backtopage='') function show_projects($conf,$langs,$db,$object,$backtopage='')
{ {
@ -482,6 +483,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param Object $object Third party object * @param Object $object Third party object
* @param string $backtopage Url to go once contact is created * @param string $backtopage Url to go once contact is created
* @return void
*/ */
function show_contacts($conf,$langs,$db,$object,$backtopage='') function show_contacts($conf,$langs,$db,$object,$backtopage='')
{ {
@ -594,12 +596,14 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
/** /**
* Show html area with actions to do * Show html area with actions to do
* @param conf Object conf *
* @param langs Object langs * @param Conf $conf Object conf
* @param db Object db * @param Translate $langs Object langs
* @param object Object third party * @param DoliDB $db Object db
* @param objcon Object contact * @param Object $object Object third party
* @param noprint Return string but does not output it * @param Contact $objcon Object contact
* @param int $noprint Return string but does not output it
* @return void
*/ */
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
@ -741,12 +745,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
/** /**
* Show html area with actions done * Show html area with actions done
* *
* @param conf Object conf * @param Conf $conf Object conf
* @param langs Object langs * @param Translate $langs Object langs
* @param db Object db * @param DoliDB $db Object db
* @param object Object third party * @param Object $object Object third party
* @param objcon Object contact * @param Contact $objcon Object contact
* @param noprint Return string but does not output it * @param int $noprint Return string but does not output it
* @return void
*/ */
function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
@ -974,10 +979,12 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
/** /**
* Show html area for list of subsidiaries * Show html area for list of subsidiaries
* @param conf Object conf *
* @param langs Object langs * @param Conf $conf Object conf
* @param db Database handler * @param Translate $langs Object langs
* @param object Third party object * @param DoliDB $db Database handler
* @param Societe $object Third party object
* @return void
*/ */
function show_subsidiaries($conf,$langs,$db,$object) function show_subsidiaries($conf,$langs,$db,$object)
{ {

View File

@ -115,12 +115,13 @@ function dol_time_plus_duree($time,$duration_value,$duration_unit)
} }
/** Convert hours and minutes into seconds /**
* Convert hours and minutes into seconds
* *
* @param int $iHours Heures * @param int $iHours Hours
* @param int $iMinutes Minutes * @param int $iMinutes Minutes
* @param int $iSeconds Secondes * @param int $iSeconds Seconds
* @return int $iResult Temps en secondes * @return int Time into seconds
*/ */
function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
{ {

View File

@ -23,13 +23,19 @@
*/ */
function ecm_prepare_head($obj) /**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$obj->id; $head[$h][0] = DOL_URL_ROOT.'/ecm/docmine.php?section='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -37,13 +43,19 @@ function ecm_prepare_head($obj)
return $head; return $head;
} }
function ecm_file_prepare_head($obj) /**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_file_prepare_head($object)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$obj->section_id.'&urlfile='.urlencode($obj->label); $head[$h][0] = DOL_URL_ROOT.'/ecm/docfile.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -51,7 +63,13 @@ function ecm_file_prepare_head($obj)
return $head; return $head;
} }
function ecm_prepare_head_fm($fac) /**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function ecm_prepare_head_fm($object)
{ {
global $langs, $conf; global $langs, $conf;
$h = 0; $h = 0;

View File

@ -350,7 +350,7 @@ function dol_dir_is_emtpy($folder)
if (is_dir($newfolder)) if (is_dir($newfolder))
{ {
$handle = opendir($newfolder); $handle = opendir($newfolder);
while ((gettype( $name = readdir($handle)) != "boolean")) while ((gettype($name = readdir($handle)) != "boolean"))
{ {
$name_array[] = $name; $name_array[] = $name;
} }
@ -423,11 +423,12 @@ function dol_filemtime($pathoffile)
/** /**
* Copy a file to another file * Copy a file to another file
* @param $srcfile Source file (can't be a directory) *
* @param $destfile Destination file (can't be a directory) * @param string $srcfile Source file (can't be a directory)
* @param $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK) * @param string $destfile Destination file (can't be a directory)
* @param $overwriteifexists Overwrite file if exists (1 by default) * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
* @return boolean True if OK, false if KO * @param int $overwriteifexists Overwrite file if exists (1 by default)
* @return boolean True if OK, false if KO
*/ */
function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1) function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
{ {
@ -682,10 +683,11 @@ function dol_delete_dir($dir,$nophperrors=0)
/** /**
* Remove a directory $dir and its subdirectories * Remove a directory $dir and its subdirectories
* @param dir Dir to delete *
* @param count Counter to count nb of deleted elements * @param string $dir Dir to delete
* @param nophperrors Disable all PHP output errors * @param int $count Counter to count nb of deleted elements
* @return int Number of files and directory removed * @param int $nophperrors Disable all PHP output errors
* @return int Number of files and directory removed
*/ */
function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0) function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0)
{ {
@ -978,8 +980,9 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* Convert an image file into antoher format. * Convert an image file into antoher format.
* This need Imagick php extension. * This need Imagick php extension.
* *
* @param string $file Input file name * @param string $file Input file name
* @param string $ext Extension of target file * @param string $ext Extension of target file
* @return int <0 if KO, >0 if OK
*/ */
function dol_convert_file($file,$ext='png') function dol_convert_file($file,$ext='png')
{ {
@ -1012,9 +1015,10 @@ function dol_convert_file($file,$ext='png')
/** /**
* Compress a file * Compress a file
* *
* @param string $inputfile Source file name * @param string $inputfile Source file name
* @param string $outputfile Target file name * @param string $outputfile Target file name
* @param string $mode 'gz' or 'bz' * @param string $mode 'gz' or 'bz'
* @return int <0 if KO, >0 if OK
*/ */
function dol_compress_file($inputfile, $outputfile, $mode="gz") function dol_compress_file($inputfile, $outputfile, $mode="gz")
{ {

View File

@ -2498,10 +2498,12 @@ function restrictedArea($user, $features='societe', $objectid=0, $dbtablename=''
/** /**
* Show a message to say access is forbidden and stop program * Show a message to say access is forbidden and stop program
* Calling this function terminate execution of PHP. * Calling this function terminate execution of PHP.
* @param message Force error message *
* @param printheader Show header before * @param string $message Force error message
* @param printfooter Show footer after * @param int $printheader Show header before
* @param showonlymessage Show only message parameter. Otherwise add more information. * @param int $printfooter Show footer after
* @param int $showonlymessage Show only message parameter. Otherwise add more information.
* @return void
*/ */
function accessforbidden($message='',$printheader=1,$printfooter=1,$showonlymessage=0) function accessforbidden($message='',$printheader=1,$printfooter=1,$showonlymessage=0)
{ {
@ -2552,9 +2554,11 @@ function dolibarr_print_error($db='',$error='')
* On doit appeler cette fonction quand une erreur technique bloquante est rencontree. * On doit appeler cette fonction quand une erreur technique bloquante est rencontree.
* Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant * Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant
* renvoyer leur erreur par l'intermediaire de leur propriete "error". * renvoyer leur erreur par l'intermediaire de leur propriete "error".
* @param db Database handler *
* @param error String or array of errors strings to show * @param DoliDB $db Database handler
* @see dol_htmloutput_errors * @param string $error String or array of errors strings to show
* @return void
* @see dol_htmloutput_errors
*/ */
function dol_print_error($db='',$error='') function dol_print_error($db='',$error='')
{ {
@ -2665,6 +2669,8 @@ function dol_print_error($db='',$error='')
/** /**
* Show email to contact if technical error * Show email to contact if technical error
*
* @reutnr void
*/ */
function dol_print_error_email() function dol_print_error_email()
{ {
@ -2677,14 +2683,15 @@ function dol_print_error_email()
/** /**
* Show title line of an array * Show title line of an array
* *
* @param name Label of field * @param string $name Label of field
* @param file Url used when we click on sort picto * @param string $file Url used when we click on sort picto
* @param field Field to use for new sorting * @param string $field Field to use for new sorting
* @param begin ("" by defaut) * @param string $begin ("" by defaut)
* @param moreparam Add more parameters on sort url links ("" by default) * @param string $moreparam Add more parameters on sort url links ("" by default)
* @param td Options of attribute td ("" by defaut) * @param string $td Options of attribute td ("" by defaut)
* @param sortfield Current field used to sort * @param string $sortfield Current field used to sort
* @param sortorder Current sort order * @param string $sortorder Current sort order
* @return void
*/ */
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="") function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="")
{ {
@ -2694,15 +2701,16 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
/** /**
* Get title line of an array * Get title line of an array
* *
* @param name Label of field * @param string $name Label of field
* @param thead For thead format * @param int $thead For thead format
* @param file Url used when we click on sort picto * @param string $file Url used when we click on sort picto
* @param field Field to use for new sorting * @param string $field Field to use for new sorting
* @param begin ("" by defaut) * @param string $begin ("" by defaut)
* @param moreparam Add more parameters on sort url links ("" by default) * @param string $moreparam Add more parameters on sort url links ("" by default)
* @param moreattrib Add more attributes on th ("" by defaut) * @param string $moreattrib Add more attributes on th ("" by defaut)
* @param sortfield Current field used to sort * @param string $sortfield Current field used to sort
* @param sortorder Current sort order * @param string $sortorder Current sort order
* @return void
*/ */
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="") function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="")
{ {
@ -2763,11 +2771,13 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
/** /**
* Show a title (deprecated. use print_fiche_titre instrad) * Show a title (deprecated. use print_fiche_titre instrad)
* @param titre Title to show *
* @param string $title Title to show
* @return string Title to show
*/ */
function print_titre($titre) function print_titre($title)
{ {
print '<div class="titre">'.$titre.'</div>'; print '<div class="titre">'.$title.'</div>';
} }
/** /**
@ -3429,10 +3439,11 @@ function yn($yesno, $case=1, $color=0)
* Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/" * Examples: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/"
* Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/" * Examples: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/"
* *
* @param $num Id to develop * @param string $num Id to develop
* @param $level Level of development (1, 2 or 3 level) * @param int $level Level of development (1, 2 or 3 level)
* @param $alpha Use alpha ref * @param int $alpha Use alpha ref
* @param withoutslash 0=With slash at end, 1=without slash at end * @param int $withoutslash 0=With slash at end, 1=without slash at end
* @return string Dir to use
*/ */
function get_exdir($num,$level=3,$alpha=0,$withoutslash=0) function get_exdir($num,$level=3,$alpha=0,$withoutslash=0)
{ {
@ -4092,7 +4103,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* or descending output and uses optionally natural case insensitive sorting (which * or descending output and uses optionally natural case insensitive sorting (which
* can be optionally case sensitive as well). * can be optionally case sensitive as well).
* *
* @param array $array Array to sort * @param array &$array Array to sort
* @param string $index Key in array to use for sorting criteria * @param string $index Key in array to use for sorting criteria
* @param int $order Sort order * @param int $order Sort order
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard sort (asort) * @param int $natsort 1=use "natural" sort (natsort), 0=use "standard sort (asort)
@ -4305,7 +4316,7 @@ function picto_from_langcode($codelang)
* @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
* 'intervention' to add a tab in intervention view * 'intervention' to add a tab in intervention view

View File

@ -94,6 +94,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 Objet to show
* @return void
*/ */
function dol_print_object_info($object) function dol_print_object_info($object)
{ {
@ -218,8 +219,8 @@ function dol_print_object_info($object)
/** /**
* Return true if email has a domain name that can't be resolved * Return true if email has a domain name that can't be resolved
* *
* @param mail adresse email (Ex: "toto@titi.com", "John Do <johndo@titi.com>") * @param string $mail Email address (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean true if domain email is OK, false if KO * @return boolean True if domain email is OK, False if KO
*/ */
function isValidMailDomain($mail) function isValidMailDomain($mail)
{ {
@ -239,14 +240,14 @@ function isValidMailDomain($mail)
* Url string validation * Url string validation
* <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor] * <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor]
* *
* @param url Url * @param string $url Url
* @param http 1: verify http, 0: not verify http * @param int $http 1: verify http, 0: not verify http
* @param pass 1: verify user and pass, 0: not verify user and pass * @param int $pass 1: verify user and pass, 0: not verify user and pass
* @param port 1: verify port, 0: not verify port * @param int $port 1: verify port, 0: not verify port
* @param path 1: verify path, 0: not verify path * @param int $path 1: verify path, 0: not verify path
* @param query 1: verify query, 0: not verify query * @param int $query 1: verify query, 0: not verify query
* @param anchor 1: verify anchor, 0: not verify anchor * @param int $anchor 1: verify anchor, 0: not verify anchor
* @return int 1=Check is OK, 0=Check is KO * @return int 1=Check is OK, 0=Check is KO
*/ */
function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
{ {
@ -288,9 +289,9 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0)
/** /**
* Clean an url string * Clean an url string
* *
* @param url Url * @param string $url Url
* @param http 1: keep http://, 0: remove also http:// * @param string $http 1: keep http://, 0: remove also http://
* @return string Cleaned url * @return string Cleaned url
*/ */
function clean_url($url,$http=1) function clean_url($url,$http=1)
{ {
@ -328,8 +329,14 @@ function clean_url($url,$http=1)
/** /**
* Return lines of an html table from an array * Return lines of an html table from an array
* Used by array2table function only * Used by array2table function only
*
* @param array $data Array of data
* @param string $troptions Options for tr
* @param string $tdoptions Options for td
* @return string
*/ */
function array2tr($data,$troptions='',$tdoptions=''){ function array2tr($data,$troptions='',$tdoptions='')
{
$text = '<tr '.$troptions.'>' ; $text = '<tr '.$troptions.'>' ;
foreach($data as $key => $item){ foreach($data as $key => $item){
$text.= '<td '.$tdoptions.'>'.$item.'</td>' ; $text.= '<td '.$tdoptions.'>'.$item.'</td>' ;
@ -340,8 +347,15 @@ function array2tr($data,$troptions='',$tdoptions=''){
/** /**
* Return an html table from an array * Return an html table from an array
*
* @param array $data Array of data
* @param int $tableMarkup Table markup
* @param string $troptions Options for tr
* @param string $tdoptions Options for td
* @return string
*/ */
function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdoptions=''){ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdoptions='')
{
$text='' ; $text='' ;
if($tableMarkup) $text = '<table '.$tableoptions.'>' ; if($tableMarkup) $text = '<table '.$tableoptions.'>' ;
foreach($data as $key => $item){ foreach($data as $key => $item){
@ -362,15 +376,15 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/** /**
* Return next value for a mask * Return next value for a mask
* *
* @param $db Database handler * @param DoliSB $db Database handler
* @param $mask Mask to use * @param string $mask Mask to use
* @param $table Table containing field with counter * @param string $table Table containing field with counter
* @param $field Field containing already used values of counter * @param string $field Field containing already used values of counter
* @param $where To add a filter on selection (for exemple to filter on invoice types) * @param string $where To add a filter on selection (for exemple to filter on invoice types)
* @param $objsoc The company that own the object we need a counter for * @param Societe $objsoc The company that own the object we need a counter for
* @param $date Date to use for the {y},{m},{d} tags. * @param string $date Date to use for the {y},{m},{d} tags.
* @param $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string New value * @return string New value
*/ */
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next') function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next')
{ {
@ -761,8 +775,8 @@ function binhex($bin, $pad=false, $upper=false)
/** /**
* Convert an hexadecimal string into a binary string * Convert an hexadecimal string into a binary string
* *
* @param hexa Hexadecimal string to convert (example: 'FF') * @param string $hexa Hexadecimal string to convert (example: 'FF')
* @return string bin * @return string bin
*/ */
function hexbin($hexa) function hexbin($hexa)
{ {
@ -779,8 +793,8 @@ function hexbin($hexa)
/** /**
* Retourne le numero de la semaine par rapport a une date * Retourne le numero de la semaine par rapport a une date
* *
* @param time Date au format 'timestamp' * @param string $time Date au format 'timestamp'
* @return int Numero de semaine * @return int Number of week
*/ */
function numero_semaine($time) function numero_semaine($time)
{ {
@ -861,10 +875,10 @@ function numero_semaine($time)
/** /**
* Convertit une masse d'une unite vers une autre unite * Convertit une masse d'une unite vers une autre unite
* *
* @param weight float Masse a convertir * @param float $weight Masse a convertir
* @param from_unit int Unite originale en puissance de 10 * @param int &$from_unit Unite originale en puissance de 10
* @param to_unit int Nouvelle unite en puissance de 10 * @param int $to_unit Nouvelle unite en puissance de 10
* @return float Masse convertie * @return float Masse convertie
*/ */
function weight_convert($weight,&$from_unit,$to_unit) function weight_convert($weight,&$from_unit,$to_unit)
{ {
@ -896,11 +910,11 @@ function weight_convert($weight,&$from_unit,$to_unit)
/** /**
* Save personnal parameter * Save personnal parameter
* *
* @param db Handler database * @param DoliDB $db Handler database
* @param conf Object conf * @param Conf $conf Object conf
* @param user Object user * @param User $user Object user
* @param 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
* *
* @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const * @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const
*/ */
@ -968,11 +982,11 @@ function dol_set_user_param($db, $conf, &$user, $tab)
/** /**
* Returns formated reduction * Returns formated reduction
* *
* @param reduction Reduction percentage * @param int $reduction Reduction percentage
* @param langs Output language * @param Translate $langs Output language
* @return string Formated reduction * @return string Formated reduction
*/ */
function dol_print_reduction($reduction=0,$langs) function dol_print_reduction($reduction,$langs)
{ {
$string = ''; $string = '';
if ($reduction == 100) if ($reduction == 100)
@ -1035,10 +1049,10 @@ function version_webserver()
/** /**
* Return list of activated modules usable for document generation * Return list of activated modules usable for document generation
* *
* @param $db Database handler * @param DoliDB $db Database handler
* @param $type Type of models (company, invoice, ...) * @param string $type Type of models (company, invoice, ...)
* @param $maxfilenamelength Max length of value to show * @param int $maxfilenamelength Max length of value to show
* @return int or array 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename". * @return mixed 0 if no module is activated, or array(key=>label). For modules that need directory scan, key is completed with ":filename".
*/ */
function getListOfModels($db,$type,$maxfilenamelength=0) function getListOfModels($db,$type,$maxfilenamelength=0)
{ {
@ -1140,9 +1154,9 @@ function is_ip($ip)
/** /**
* Build a login from lastname, firstname * Build a login from lastname, firstname
* *
* @param lastname Lastname * @param string $lastname Lastname
* @param firstname Firstname * @param string $firstname Firstname
* @return string * @return string Login
*/ */
function dol_buildlogin($lastname,$firstname) function dol_buildlogin($lastname,$firstname)
{ {

View File

@ -25,8 +25,9 @@
/** /**
* Return if a BVRB number is valid or not (For switzerland) * Return if a BVRB number is valid or not (For switzerland)
* @param bvrb BVRB number *
* @return bool True if OK, false if KO * @param string $bvrb BVRB number
* @return boolean True if OK, false if KO
*/ */
function dol_ch_controle_bvrb($bvrb) function dol_ch_controle_bvrb($bvrb)
{ {

View File

@ -31,8 +31,9 @@ $quality = 80;
/** /**
* Return if a filename is file name of a supported image format * Return if a filename is file name of a supported image format
* @param file Filename *
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported * @param string $file Filename
* @return int -1=Not image filename, 0=Image filename but format not supported by PHP, 1=Image filename with format supported
*/ */
function image_format_supported($file) function image_format_supported($file)
{ {
@ -62,8 +63,9 @@ function image_format_supported($file)
/** /**
* Return size of image file on disk (Supported extensions are gif, jpg, png and bmp) * Return size of image file on disk (Supported extensions are gif, jpg, png and bmp)
* @param $file Full path name of file *
* @return Array array('width'=>width, 'height'=>height) * @param string $file Full path name of file
* @return array array('width'=>width, 'height'=>height)
*/ */
function dol_getImageSize($file) function dol_getImageSize($file)
{ {
@ -84,13 +86,14 @@ function dol_getImageSize($file)
/** /**
* Resize or crop an image file (Supported extensions are gif, jpg, png and bmp) * Resize or crop an image file (Supported extensions are gif, jpg, png and bmp)
* @param file Path of file to resize/crop *
* @param mode 0=Resize, 1=Crop * @param string $file Path of file to resize/crop
* @param newWidth Largeur maximum que dois faire l'image destination (0=keep ratio) * @param int $mode 0=Resize, 1=Crop
* @param newHeight Hauteur maximum que dois faire l'image destination (0=keep ratio) * @param int $newWidth Largeur maximum que dois faire l'image destination (0=keep ratio)
* @param src_x Position of croping image in source image (not use if mode=0) * @param int $newHeight Hauteur maximum que dois faire l'image destination (0=keep ratio)
* @param src_y Position of croping image in source image (not use if mode=0) * @param int $src_x Position of croping image in source image (not use if mode=0)
* @return int File name if OK, error message if KO * @param int $src_y Position of croping image in source image (not use if mode=0)
* @return int File name if OK, error message if KO
*/ */
function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0) function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x=0, $src_y=0)
{ {
@ -539,11 +542,12 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
/** /**
* \brief This function returns the html for the moneymeter. * This function returns the html for the moneymeter.
* \param actualValue: amount of actual money *
* \param pendingValue: amount of money of pending memberships * @param int $actualValue amount of actual money
* \param intentValue: amount of intended money (that's without the amount of actual money) * @param int $pendingValue amount of money of pending memberships
* \return thermometer htmlLegenda * @param int $intentValue amount of intended money (that's without the amount of actual money)
* @return string thermometer htmlLegenda
*/ */
function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0) function moneyMeter($actualValue=0, $pendingValue=0, $intentValue=0)
{ {

View File

@ -22,6 +22,11 @@
* \ingroup ldap * \ingroup ldap
*/ */
/**
* Initialize the array of tabs for customer invoice
*
* @return array Array of head tabs
*/
function ldap_prepare_head() function ldap_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
@ -73,7 +78,14 @@ function ldap_prepare_head()
/** /**
* \brief Show button test LDAP synchro * Show button test LDAP synchro
*
* @param string $butlabel Label
* @param string $testlabel Label
* @param string $key Key
* @param string $dn Dn
* @param string $objectclass Class
* @return void
*/ */
function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass) function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
{ {
@ -105,13 +117,13 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
/** /**
* Show a LDAP array into an HTML output array. * Show a LDAP array into an HTML output array.
* *
* @param $result Array to show. This array is already encoded into charset_output * @param string $result Array to show. This array is already encoded into charset_output
* @param $level * @param int $level Level
* @param $count * @param int $count Count
* @param $var * @param string $var Var
* @param $hide * @param int $hide Hide
* @param $subcount * @param int $subcount Subcount
* @return intr * @return int
*/ */
function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0) function show_ldap_content($result,$level,$count,$var,$hide=0,$subcount=0)
{ {

View File

@ -35,9 +35,9 @@ $shmoffset=100;
/** /**
* Save data into a memory area shared by all users, all sessions on server * Save data into a memory area shared by all users, all sessions on server
* *
* @param $memoryid Memory id of shared area * @param string $memoryid Memory id of shared area
* @param $data Data to save * @param string $data Data to save
* @return int <0 if KO, Nb of bytes written if OK * @return int <0 if KO, Nb of bytes written if OK
*/ */
function dol_setcache($memoryid,$data) function dol_setcache($memoryid,$data)
{ {
@ -93,8 +93,8 @@ function dol_setcache($memoryid,$data)
/** /**
* Read a memory area shared by all users, all sessions on server * Read a memory area shared by all users, all sessions on server
* *
* @param $memoryid Memory id of shared area * @param string $memoryid Memory id of shared area
* @return int <0 if KO, data if OK * @return int <0 if KO, data if OK
*/ */
function dol_getcache($memoryid) function dol_getcache($memoryid)
{ {
@ -154,9 +154,10 @@ function dol_getcache($memoryid)
/** /**
* \brief Return shared memory address used to store dataset with key memoryid * Return shared memory address used to store dataset with key memoryid
* \param $memoryid Memory id of shared area *
* \return int <0 if KO, Memoy address of shared memory for key * @param string $memoryid Memory id of shared area
* @return int <0 if KO, Memoy address of shared memory for key
*/ */
function dol_getshmopaddress($memoryid) function dol_getshmopaddress($memoryid)
{ {
@ -166,8 +167,9 @@ function dol_getshmopaddress($memoryid)
} }
/** /**
* \brief Return list of contents of all memory area shared * Return list of contents of all memory area shared
* \return int 0=Nothing is done, <0 if KO, >0 if OK *
* @return int 0=Nothing is done, <0 if KO, >0 if OK
*/ */
function dol_listshmop() function dol_listshmop()
{ {
@ -183,10 +185,11 @@ function dol_listshmop()
} }
/** /**
* \brief Save data into a memory area shared by all users, all sessions on server * Save data into a memory area shared by all users, all sessions on server
* \param $memoryid Memory id of shared area *
* \param $data Data to save * @param int $memoryid Memory id of shared area
* \return int <0 if KO, Nb of bytes written if OK * @param string $data Data to save
* @return int <0 if KO, Nb of bytes written if OK
*/ */
function dol_setshmop($memoryid,$data) function dol_setshmop($memoryid,$data)
{ {
@ -218,9 +221,10 @@ function dol_setshmop($memoryid,$data)
} }
/** /**
* \brief Read a memory area shared by all users, all sessions on server * Read a memory area shared by all users, all sessions on server
* \param $memoryid Memory id of shared area *
* \return int <0 if KO, data if OK * @param string $memoryid Memory id of shared area
* @return int <0 if KO, data if OK
*/ */
function dol_getshmop($memoryid) function dol_getshmop($memoryid)
{ {

View File

@ -321,12 +321,12 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
/** /**
* Show bank informations for PDF generation * Show bank informations for PDF generation
* *
* @param pdf Object PDF * @param PDF &$pdf Object PDF
* @param outputlangs Object lang * @param Translate $outputlangs Object lang
* @param curx X * @param int $curx X
* @param cury Y * @param int $cury Y
* @param account Bank account object * @param Account $account Bank account object
* @param onlynumber Output only number * @param int $onlynumber Output only number
* @return void * @return void
*/ */
function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0) function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
@ -360,7 +360,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$cury+=3; $cury+=3;
} }
if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8 ); if (empty($onlynumber)) $pdf->line($curx+1, $cury+1, $curx+1, $cury+8);
if ($usedetailedbban == 1) if ($usedetailedbban == 1)
{ {
@ -384,7 +384,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1); $pdf->SetXY($curx, $cury+1);
$curx+=$tmplength; $curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0); $pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankCode"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 ); if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
} }
if ($val == 'desk') if ($val == 'desk')
{ {
@ -395,7 +395,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1); $pdf->SetXY($curx, $cury+1);
$curx+=$tmplength; $curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0); $pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("DeskCode"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 ); if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
} }
if ($val == 'number') if ($val == 'number')
{ {
@ -406,7 +406,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1); $pdf->SetXY($curx, $cury+1);
$curx+=$tmplength; $curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0); $pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumber"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 ); if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
} }
if ($val == 'key') if ($val == 'key')
{ {
@ -417,7 +417,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
$pdf->SetXY($curx, $cury+1); $pdf->SetXY($curx, $cury+1);
$curx+=$tmplength; $curx+=$tmplength;
$pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); $pdf->SetFont('','B',6);$pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8 ); if (empty($onlynumber)) $pdf->line($curx, $cury+1, $curx, $cury+8);
} }
} }
@ -469,14 +469,14 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0)
* Show footer of page for PDF generation * Show footer of page for PDF generation
* *
* @param PDF &$pdf The PDF factory * @param PDF &$pdf The PDF factory
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text * @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company * @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom * @param int $marge_basse Margin bottom
* @param int $marge_gauche Margin left * @param int $marge_gauche Margin left
* @param int $page_hauteur Page height * @param int $page_hauteur Page height
* @param Object $object Object shown in PDF * @param Object $object Object shown in PDF
* @param int $showdetails Show company details * @param int $showdetails Show company details
* @return void * @return void
*/ */
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0) function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0)
@ -666,7 +666,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
/** /**
* Output line description into PDF * Output line description into PDF
* *
* @param PDF $pdf PDF object * @param PDF &$pdf PDF object
* @param Object $object Object * @param Object $object Object
* @param int $i Current line number * @param int $i Current line number
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1229,7 +1229,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
* @param HookManager $hookmanager Hook manager instance * @param HookManager $hookmanager Hook manager instance
* @return void * @return void
*/ */
function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false) function pdf_getTotalQty($object,$type,$outputlangs,$hookmanager=false)
{ {
$total=0; $total=0;
$nblignes=count($object->lines); $nblignes=count($object->lines);
@ -1267,7 +1267,7 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
/** /**
* Convert a currency code into its symbol * Convert a currency code into its symbol
* *
* @param PDF $pdf PDF object * @param PDF &$pdf PDF object
* @param string $currency_code Currency code * @param string $currency_code Currency code
* @return string Currency symbol encoded into UTF8 * @return string Currency symbol encoded into UTF8
*/ */

View File

@ -83,6 +83,7 @@ function prelevement_prepare_head($object)
/** /**
* Check need data to create standigns orders receipt file * Check need data to create standigns orders receipt file
*
* @return int -1 if ko 0 if ok * @return int -1 if ko 0 if ok
*/ */
function prelevement_check_config() function prelevement_check_config()

View File

@ -256,9 +256,10 @@ function show_stats_for_company($product,$socid)
/** /**
* Return translation label of a unit key * Return translation label of a unit key
* @param unit Unit key (-3,0,3,98,99...) *
* @param measuring_style Style of unit: weight, volume,... * @param int $unit Unit key (-3,0,3,98,99...)
* @return string Unit string * @param string $measuring_style Style of unit: weight, volume,...
* @return string Unit string
* @see load_measuring_units * @see load_measuring_units
*/ */
function measuring_units_string($unit,$measuring_style='') function measuring_units_string($unit,$measuring_style='')

View File

@ -257,13 +257,13 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
/** /**
* Output a task line * Output a task line
* *
* @param $inc * @param string &$inc ?
* @param $parent * @param string $parent ?
* @param $lines * @param Object $lines ?
* @param $level * @param int &$level ?
* @param $projectsrole * @param string &$projectsrole ?
* @param $tasksrole * @param string &$tasksrole ?
* @param $mytask 0 or 1 to enable only if task is a task i am affected to * @param int $mytask 0 or 1 to enable only if task is a task i am affected to
* @return $inc * @return $inc
*/ */
function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0) function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0)
@ -369,14 +369,14 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $
/** /**
* Show task lines with a particular parent * Show task lines with a particular parent
* *
* @param $inc Counter that count number of lines legitimate to show (for return) * @param string &$inc Counter that count number of lines legitimate to show (for return)
* @param $parent Id of parent task to start * @param int $parent Id of parent task to start
* @param $lines Array of all tasks * @param array &$lines Array of all tasks
* @param $level Level of task * @param int &$level Level of task
* @param $var Color * @param string $var Color
* @param $showproject Show project columns * @param int $showproject Show project columns
* @param $taskrole Array of roles of user for each tasks * @param int &$taskrole Array of roles of user for each tasks
* @param $projectsListId List of id of project allowed to user (separated with comma) * @param int $projectsListId List of id of project allowed to user (separated with comma)
*/ */
function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='') function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='')
{ {
@ -525,11 +525,12 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
/** /**
* Search in task lines with a particular parent if there is a task for a particular user (in taskrole) * Search in task lines with a particular parent if there is a task for a particular user (in taskrole)
* @param $inc Counter that count number of lines legitimate to show (for return) *
* @param $parent Id of parent task to start * @param string &$inc Counter that count number of lines legitimate to show (for return)
* @param $lines Array of all tasks * @param int $parent Id of parent task to start
* @param $taskrole Array of task filtered on a particular user * @param array &$lines Array of all tasks
* @return int 1 if there is * @param string &$taskrole Array of task filtered on a particular user
* @return int 1 if there is
*/ */
function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole) function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
{ {
@ -561,8 +562,9 @@ function SearchTaskInChild(&$inc, $parent, &$lines, &$taskrole)
/** /**
* Clean task not linked to a parent * Clean task not linked to a parent
* @param $db Database handler *
* @return int Nb of records deleted * @param DoliDB $db Database handler
* @return int Nb of records deleted
*/ */
function clean_orphelins($db) function clean_orphelins($db)
{ {
@ -618,10 +620,11 @@ function clean_orphelins($db)
/** /**
* Return HTML table with list of projects and number of opened tasks * Return HTML table with list of projects and number of opened tasks
* *
* @param $db * @param DoliDB $db Database handler
* @param $socid * @param int $socid Id thirdparty
* @param $projectsListId Id of project i have permission on * @param int $projectsListId Id of project i have permission on
* @param $mytasks Limited to task i am contact to * @param int $mytasks Limited to task i am contact to
* @return void
*/ */
function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0) function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0)
{ {

View File

@ -35,7 +35,7 @@
* @param array $moreparam Array with list of params to add into form * @param array $moreparam Array with list of params to add into form
* @return void * @return void
*/ */
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array()) function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
{ {
global $langs, $hselected; global $langs, $hselected;

View File

@ -104,12 +104,12 @@ function delivery_prepare_head($object)
/** /**
* List sendings and receive receipts * List sendings and receive receipts
* *
* @param string $origin Origin * @param string $origin Origin ('commande', ...)
* @param int $origin_id Origin id * @param int $origin_id Origin id
* @param string $filter Filter * @param string $filter Filter
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function show_list_sending_receive($origin='commande',$origin_id,$filter='') function show_list_sending_receive($origin,$origin_id,$filter='')
{ {
global $db, $conf, $langs, $bc; global $db, $conf, $langs, $bc;
global $form; global $form;

View File

@ -64,14 +64,15 @@ function tax_prepare_head($object)
/** /**
* Look for collectable VAT clients in the chosen year (and month) * Look for collectable VAT clients in the chosen year (and month)
* @param db Database handle *
* @param y Year * @param DoliDB $db Database handle
* @param date_start Start date * @param int $y Year
* @param date_end End date * @param string $date_start Start date
* @param modetax 0 or 1 (option vat on debit) * @param string $date_end End date
* @param direction 'sell' or 'buy' * @param int $modetax 0 or 1 (option vat on debit)
* @param m Month * @param string $direction 'sell' or 'buy'
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error * @param int $m Month
* @return array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error
*/ */
function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction, $m=0) function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction, $m=0)
{ {
@ -207,19 +208,20 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
/** /**
* \brief Gets VAT to collect for the given year (and given quarter or month) * Gets VAT to collect for the given year (and given quarter or month)
* The function gets the VAT in split results, as the VAT declaration asks * The function gets the VAT in split results, as the VAT declaration asks
* to report the amounts for different VAT rates as different lines. * to report the amounts for different VAT rates as different lines.
* This function also accounts recurrent invoices * This function also accounts recurrent invoices.
* \param db Database handler object *
* \param y Year * @param DoliDB $db Database handler object
* \param q Quarter * @param int $y Year
* \param date_start Start date * @param int $q Quarter
* \param date_end End date * @param string $date_start Start date
* \param modetax 0 or 1 (option vat on debit) * @param string $date_end End date
* \param direction 'sell' (customer invoice) or 'buy' (supplier invoices) * @param int $modetax 0 or 1 (option vat on debit)
* \param m Month * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices)
* \return array List of quarters with vat * @param int $m Month
* @return array List of quarters with vat
*/ */
function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0) function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0)
{ {