Improve: message for uploading , compute ini value and color red for the

trash can
This commit is contained in:
sparkyx 2025-11-08 15:41:54 +01:00
parent 35d73582b0
commit b5f55a129a
3 changed files with 23 additions and 2 deletions

View file

@ -1959,3 +1959,24 @@ function check_iban(&$iban): bool
return false;
}
/**
* @brief convert a value in Mbytes, kb ... in byte
* @param (string) $p_value containing K , M, G
* @return int in bytes
*/
function convert_ini_unit($p_value)
{
if ($p_value=="") return 0;
$a_convert=["k"=>1024,"m"=>1024**2,"g"=>1024**3];
$p_value=trim($p_value);
$last=strtolower($p_value[strlen($p_value)-1]);
$p_value=substr($p_value,0,strlen($p_value)-1);
if ( isset($a_convert[$last])) {
$p_value=$p_value*$a_convert[$last];
}
return $p_value;
}

View file

@ -272,7 +272,7 @@ class Icon_Action
*/
static function trash($p_id,$p_javascript)
{
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="smallicon icon">&#xe80f;</span>';
$r='<span id="'.$p_id.'" onclick="'.$p_javascript.'" class="bt-error smallicon icon">&#xe80f;</span>';
return $r;
}
/**

View file

@ -109,7 +109,7 @@ content[74]="<?php echo htmlspecialchars(_('TVA due ou récupérable quand l\'op
content[75]="<?php echo htmlspecialchars(_('Journaux Achat ou vente en mode simple, TVA ou détaillé'),ENT_QUOTES)?>";
content[76]="<?php echo htmlspecialchars(_('Il est conseillé d\'avoir un quickcode de moins de 9 car.'),ENT_QUOTES)?>";
content[77]="<?php echo htmlspecialchars(_("Permet de chercher dans le suivi pour les contacts multiples"),ENT_QUOTES)?>";
<?php $file_too_large=sprintf("Fichier trop grand , taille max = %s mb",(round(MAX_FILE_SIZE/1024/1024,2)));?>
<?php $file_too_large=sprintf("Fichier trop grand , taille max = %s mb total = %s",(round(MAX_FILE_SIZE/1024/1024,2)),ini_get("post_max_size"));?>
content[78]="<?php echo htmlspecialchars($file_too_large,ENT_QUOTES)?>";
content[79]="<?php echo htmlspecialchars(_("Les postes comptables sont entre [] , les fiches entre {} et les postes analytiques entre {{ }}"))?>";