This commit is contained in:
Laurent Destailleur 2011-09-17 00:47:01 +00:00
parent fd2b3099cf
commit 8c69ac29b6

View File

@ -33,6 +33,8 @@
/** /**
* This function output memory used by PHP and exit everything. Used for debugging purpose. * This function output memory used by PHP and exit everything. Used for debugging purpose.
*
* @return void
*/ */
function dol_stopwithmem() function dol_stopwithmem()
{ {
@ -43,6 +45,8 @@ function dol_stopwithmem()
/** /**
* Function called at end of web php process * Function called at end of web php process
*
* @return void
*/ */
function dol_shutdown() function dol_shutdown()
{ {
@ -202,11 +206,11 @@ function dol_size($size,$type='')
/** /**
* Return date for now. We should always use this function without parameters (that means GMT time) * Return date for now. We should always use this function without parameters (that means GMT time)
* *
* @param mode 'gmt' => we return GMT timestamp, * @param string $mode 'gmt' => we return GMT timestamp,
* 'tzserver' => we add the PHP server timezone * 'tzserver' => we add the PHP server timezone
* 'tzref' => we add the company timezone * 'tzref' => we add the company timezone
* 'tzuser' => we add the user timezone * 'tzuser' => we add the user timezone
* @return date Timestamp * @return timestamp $date Timestamp
*/ */
function dol_now($mode='gmt') function dol_now($mode='gmt')
{ {
@ -235,9 +239,10 @@ function dol_now($mode='gmt')
/** /**
* Clean a string to use it as a file name * Clean a string to use it as a file name
* *
* @param str String to clean * @param string $str String to clean
* @param newstr String to replace bad chars with * @param string $newstr String to replace bad chars with
* @return string String cleaned (a-zA-Z_) * @return string String cleaned (a-zA-Z_)
*
* @see dol_string_nospecial, dol_string_unaccent * @see dol_string_nospecial, dol_string_unaccent
*/ */
function dol_sanitizeFileName($str,$newstr='_') function dol_sanitizeFileName($str,$newstr='_')
@ -249,8 +254,9 @@ function dol_sanitizeFileName($str,$newstr='_')
/** /**
* Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName * Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName
* *
* @param str String to clean * @param string $str String to clean
* @return string Cleaned string * @return string Cleaned string
*
* @see dol_sanitizeFilename, dol_string_nospecial * @see dol_sanitizeFilename, dol_string_nospecial
*/ */
function dol_string_unaccent($str) function dol_string_unaccent($str)
@ -296,10 +302,11 @@ function dol_string_unaccent($str)
/** /**
* Clean a string from all punctuation characters to use it as a ref or login * Clean a string from all punctuation characters to use it as a ref or login
* *
* @param str String to clean * @param string $str String to clean
* @param newstr String to replace forbidden chars with * @param string $newstr String to replace forbidden chars with
* @param badchars List of forbidden characters * @param array $badchars List of forbidden characters
* @return string Cleaned string * @return string Cleaned string
*
* @see dol_sanitizeFilename, dol_string_unaccent * @see dol_sanitizeFilename, dol_string_unaccent
*/ */
function dol_string_nospecial($str,$newstr='_',$badchars='') function dol_string_nospecial($str,$newstr='_',$badchars='')
@ -467,11 +474,12 @@ function dol_syslog($message, $level=LOG_INFO)
/** /**
* Show tab header of a card * Show tab header of a card
* *
* @param links Array of tabs * @param array $links Array of tabs
* @param active Active tab name * @param int $active Active tab name
* @param title Title * @param string $title Title
* @param notab 0=Add tab header, 1=no tab header * @param int $notab 0=Add tab header, 1=no tab header
* @param picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @return void
*/ */
function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='') function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='')
{ {
@ -481,11 +489,12 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
/** /**
* Show tab header of a card * Show tab header of a card
* *
* @param links Array of tabs * @param array $links Array of tabs
* @param active Active tab name * @param int $active Active tab name
* @param title Title * @param string $title Title
* @param notab 0=Add tab header, 1=no tab header * @param int $notab 0=Add tab header, 1=no tab header
* @param picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @return void
*/ */
function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='') function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='')
{ {
@ -549,6 +558,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
* Show tab footer of a card * Show tab footer of a card
* *
* @param int $notab 0=Add tab footer, 1=no tab footer * @param int $notab 0=Add tab footer, 1=no tab footer
* @return void
*/ */
function dol_fiche_end($notab=0) function dol_fiche_end($notab=0)
{ {
@ -559,6 +569,7 @@ function dol_fiche_end($notab=0)
* Return tab footer of a card * Return tab footer of a card
* *
* @param int $notab 0=Add tab footer, 1=no tab footer * @param int $notab 0=Add tab footer, 1=no tab footer
* @return void
*/ */
function dol_get_fiche_end($notab=0) function dol_get_fiche_end($notab=0)
{ {
@ -896,10 +907,11 @@ function dolibarr_date($fmt, $timestamp, $gm=false)
/** /**
* Returns formated date * Returns formated date
* *
* @param fmt Format (Exemple: 'Y-m-d H:i:s') * @param string $fmt Format (Exemple: 'Y-m-d H:i:s')
* @param timestamp Date. Example: If timestamp=0 and gm=1, return 01/01/1970 00:00:00 * @param timestamp $timestamp Date. Example: If timestamp=0 and gm=1, return 01/01/1970 00:00:00
* @param gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime * @param boolean $gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime
* @return string Formated date * @return string Formated date
*
* @deprecated Replaced by dol_print_date * @deprecated Replaced by dol_print_date
*/ */
function dol_date($fmt, $timestamp, $gm=false) function dol_date($fmt, $timestamp, $gm=false)
@ -924,9 +936,9 @@ function dol_date($fmt, $timestamp, $gm=false)
/** /**
* Return string with formated size * Return string with formated size
* *
* @param size Size to print * @param int $size Size to print
* @param shortvalue Tell if we want long value to use another unit (Ex: 1.5Kb instead of 1500b) * @param int $shortvalue Tell if we want long value to use another unit (Ex: 1.5Kb instead of 1500b)
* @param shortunit Use short value of size unit * @param int $shortunit Use short value of size unit
* @return string Link * @return string Link
*/ */
function dol_print_size($size,$shortvalue=0,$shortunit=0) function dol_print_size($size,$shortvalue=0,$shortunit=0)
@ -957,9 +969,9 @@ function dol_print_size($size,$shortvalue=0,$shortunit=0)
/** /**
* Show Url link * Show Url link
* *
* @param url Url to show * @param string $url Url to show
* @param target Target for link * @param string $target Target for link
* @param max Max number of characters to show * @param int $max Max number of characters to show
* @return string HTML Link * @return string HTML Link
*/ */
function dol_print_url($url,$target='_blank',$max=32) function dol_print_url($url,$target='_blank',$max=32)
@ -979,12 +991,12 @@ function dol_print_url($url,$target='_blank',$max=32)
/** /**
* Show EMail link * Show EMail link
* *
* @param email EMail to show (only email, without 'Name of recipient' before) * @param string $email EMail to show (only email, without 'Name of recipient' before)
* @param cid Id of contact if known * @param int $cid Id of contact if known
* @param socid Id of third party if known * @param int $socid Id of third party if known
* @param addlink 0=no link to create action * @param int $addlink 0=no link to create action
* @param max Max number of characters to show * @param int $max Max number of characters to show
* @param showinvalid Show warning if syntax email is wrong * @param int $showinvalid Show warning if syntax email is wrong
* @return string HTML Link * @return string HTML Link
*/ */
function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=1) function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=1)
@ -4181,12 +4193,12 @@ function picto_from_langcode($codelang)
* 'member' to add a tab in fundation member view * 'member' to add a tab in fundation member view
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member) * 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
* @param mode 'add' to complete head, 'remove' to remove entries * @param mode 'add' to complete head, 'remove' to remove entries
* @return void
*/ */
function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add') function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add')
{ {
if (is_array($conf->tabs_modules[$type])) if (is_array($conf->tabs_modules[$type]))
{ {
$i=0;
foreach ($conf->tabs_modules[$type] as $value) foreach ($conf->tabs_modules[$type] as $value)
{ {
$values=explode(':',$value); $values=explode(':',$value);