Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
8cdbc2151c
@ -17,7 +17,7 @@ use Cwd;
|
|||||||
my $dir = getcwd;
|
my $dir = getcwd;
|
||||||
|
|
||||||
print "Current dir is: $dir\n";
|
print "Current dir is: $dir\n";
|
||||||
print "Running dir for doxygen must be: $DIR/doxygen\n";
|
print "Running dir for doxygen must be: $DIR\n";
|
||||||
|
|
||||||
if (! -s $CONFFILE)
|
if (! -s $CONFFILE)
|
||||||
{
|
{
|
||||||
@ -32,6 +32,8 @@ $langs->load("orders");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$action=GETPOST('action');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("id");
|
$socid = GETPOST("id");
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
@ -50,7 +52,7 @@ if (GETPOST('cancel') && GETPOST('backtopage'))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("action") == 'confirm_split' && GETPOST("confirm") == 'yes')
|
if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||||
{
|
{
|
||||||
//if ($user->rights->societe->creer)
|
//if ($user->rights->societe->creer)
|
||||||
//if ($user->rights->facture->creer)
|
//if ($user->rights->facture->creer)
|
||||||
@ -127,7 +129,7 @@ if (GETPOST("action") == 'confirm_split' && GETPOST("confirm") == 'yes')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("action") == 'setremise')
|
if ($action == 'setremise')
|
||||||
{
|
{
|
||||||
//if ($user->rights->societe->creer)
|
//if ($user->rights->societe->creer)
|
||||||
//if ($user->rights->facture->creer)
|
//if ($user->rights->facture->creer)
|
||||||
@ -145,13 +147,13 @@ if (GETPOST("action") == 'setremise')
|
|||||||
{
|
{
|
||||||
$soc = new Societe($db);
|
$soc = new Societe($db);
|
||||||
$soc->fetch($_GET["id"]);
|
$soc->fetch($_GET["id"]);
|
||||||
$soc->set_remise_except($_POST["amount_ht"],$user,$_POST["desc"],$_POST["tva_tx"]);
|
$discountid=$soc->set_remise_except($_POST["amount_ht"],$user,$_POST["desc"],$_POST["tva_tx"]);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($discountid > 0)
|
||||||
{
|
{
|
||||||
if (GETPOST("backtopage"))
|
if (GETPOST("backtopage"))
|
||||||
{
|
{
|
||||||
Header("Location: ".GETPOST("backtopage"));
|
Header("Location: ".GETPOST("backtopage").'&discountid='.$discountid);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2225,12 +2225,12 @@ else
|
|||||||
// Remise dispo de type remise fixe (not credit note)
|
// Remise dispo de type remise fixe (not credit note)
|
||||||
$filter='fk_facture_source IS NULL';
|
$filter='fk_facture_source IS NULL';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id',$soc->id, $absolute_discount, $filter, $resteapayer, ' ('.$addabsolutediscount.')');
|
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, GETPOST('discountid'), 'remise_id', $soc->id, $absolute_discount, $filter, $resteapayer, ' ('.$addabsolutediscount.')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($absolute_creditnote > 0) // If not linke will be added later
|
if ($absolute_creditnote > 0) // If not, link will be added later
|
||||||
{
|
{
|
||||||
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')<br>';
|
if ($object->statut == 0 && $object->type != 2 && $object->type != 3) print ' ('.$addabsolutediscount.')<br>';
|
||||||
else print '.';
|
else print '.';
|
||||||
|
|||||||
@ -144,12 +144,12 @@ $formfile = new FormFile($db);
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
$(document).ready(function() {
|
||||||
jQuery("#checkall").click(function() {
|
$("#checkall").click(function() {
|
||||||
jQuery(".checkformerge").attr('checked', true);
|
$(".checkformerge").attr('checked', true);
|
||||||
});
|
});
|
||||||
jQuery("#checknone").click(function() {
|
$("#checknone").click(function() {
|
||||||
jQuery(".checkformerge").attr('checked', false);
|
$(".checkformerge").attr('checked', false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -43,31 +43,31 @@ class Form
|
|||||||
{
|
{
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
|
|
||||||
// Cache arrays
|
// Cache arrays
|
||||||
var $cache_types_paiements=array();
|
var $cache_types_paiements=array();
|
||||||
var $cache_conditions_paiements=array();
|
var $cache_conditions_paiements=array();
|
||||||
var $cache_availability=array();
|
var $cache_availability=array();
|
||||||
var $cache_demand_reason=array();
|
var $cache_demand_reason=array();
|
||||||
var $cache_type_fees=array();
|
var $cache_type_fees=array();
|
||||||
|
|
||||||
var $tva_taux_value;
|
var $tva_taux_value;
|
||||||
var $tva_taux_libelle;
|
var $tva_taux_libelle;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
public function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output key field for an editable field
|
* Output key field for an editable field
|
||||||
*
|
*
|
||||||
* @param string $text Text of label or key to translate
|
* @param string $text Text of label or key to translate
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
* @param string $preselected Name of Value to show/edit (not used in this function)
|
* @param string $preselected Name of Value to show/edit (not used in this function)
|
||||||
@ -79,9 +79,9 @@ class Form
|
|||||||
function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='string')
|
function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='string')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$ret='';
|
$ret='';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
||||||
{
|
{
|
||||||
if ($perm)
|
if ($perm)
|
||||||
@ -104,13 +104,13 @@ class Form
|
|||||||
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
||||||
$ret.='</tr></table>';
|
$ret.='</tr></table>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output val field for an editable field
|
* Output val field for an editable field
|
||||||
*
|
*
|
||||||
* @param string $text Text of label (not used in this function)
|
* @param string $text Text of label (not used in this function)
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
* @param string $value Value to show/edit
|
* @param string $value Value to show/edit
|
||||||
@ -124,9 +124,9 @@ class Form
|
|||||||
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=false)
|
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=false)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
$ret='';
|
$ret='';
|
||||||
|
|
||||||
// When option to edit inline is activated
|
// When option to edit inline is activated
|
||||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
|
||||||
{
|
{
|
||||||
@ -185,7 +185,7 @@ class Form
|
|||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output edit in place form
|
* Output edit in place form
|
||||||
*
|
*
|
||||||
@ -200,14 +200,14 @@ class Form
|
|||||||
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $extObject=false)
|
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $extObject=false)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($inputType == 'textarea') $value = dol_nl2br($value);
|
if ($inputType == 'textarea') $value = dol_nl2br($value);
|
||||||
else if (preg_match('/^numeric/',$inputType)) $value = price($value);
|
else if (preg_match('/^numeric/',$inputType)) $value = price($value);
|
||||||
else if ($inputType == 'datepicker') $value = dol_print_date($value, 'day');
|
else if ($inputType == 'datepicker') $value = dol_print_date($value, 'day');
|
||||||
|
|
||||||
if ($condition)
|
if ($condition)
|
||||||
{
|
{
|
||||||
$element = false;
|
$element = false;
|
||||||
@ -218,21 +218,21 @@ class Form
|
|||||||
$ext_element = false;
|
$ext_element = false;
|
||||||
//$ext_table_element = false;
|
//$ext_table_element = false;
|
||||||
//$ext_fk_element = false;
|
//$ext_fk_element = false;
|
||||||
|
|
||||||
if (is_object($object))
|
if (is_object($object))
|
||||||
{
|
{
|
||||||
$element = $object->element;
|
$element = $object->element;
|
||||||
$table_element = $object->table_element;
|
$table_element = $object->table_element;
|
||||||
$fk_element = $object->id;
|
$fk_element = $object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($extObject))
|
if (is_object($extObject))
|
||||||
{
|
{
|
||||||
$ext_element = $extObject->element;
|
$ext_element = $extObject->element;
|
||||||
//$ext_table_element = $extObject->table_element;
|
//$ext_table_element = $extObject->table_element;
|
||||||
//$ext_fk_element = $extObject->id;
|
//$ext_fk_element = $extObject->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^(string|email|numeric)/',$inputType))
|
if (preg_match('/^(string|email|numeric)/',$inputType))
|
||||||
{
|
{
|
||||||
$tmp=explode(':',$inputType);
|
$tmp=explode(':',$inputType);
|
||||||
@ -244,7 +244,7 @@ class Form
|
|||||||
$tmp=explode(':',$inputType);
|
$tmp=explode(':',$inputType);
|
||||||
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
||||||
if (! empty($tmp[2])) $savemethod=$tmp[2];
|
if (! empty($tmp[2])) $savemethod=$tmp[2];
|
||||||
|
|
||||||
$out.= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
|
$out.= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
|
||||||
}
|
}
|
||||||
else if (preg_match('/^select/',$inputType))
|
else if (preg_match('/^select/',$inputType))
|
||||||
@ -260,7 +260,7 @@ class Form
|
|||||||
if (! empty($tmp[2])) $width=$tmp[2];
|
if (! empty($tmp[2])) $width=$tmp[2];
|
||||||
if (! empty($tmp[3])) $heigth=$tmp[3];
|
if (! empty($tmp[3])) $heigth=$tmp[3];
|
||||||
if (! empty($tmp[4])) $savemethod=$tmp[4];
|
if (! empty($tmp[4])) $savemethod=$tmp[4];
|
||||||
|
|
||||||
if (! empty($conf->fckeditor->enabled))
|
if (! empty($conf->fckeditor->enabled))
|
||||||
{
|
{
|
||||||
$out.= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
|
$out.= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
|
||||||
@ -270,7 +270,7 @@ class Form
|
|||||||
$inputType = 'textarea';
|
$inputType = 'textarea';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out.= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
|
$out.= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n";
|
||||||
$out.= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
|
$out.= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n";
|
||||||
$out.= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
|
$out.= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
|
||||||
@ -279,17 +279,17 @@ class Form
|
|||||||
$out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
|
$out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
|
||||||
//$out.= '<input id="ext_table_element_'.$htmlname.'" value="'.$ext_table_element.'" type="hidden"/>'."\n";
|
//$out.= '<input id="ext_table_element_'.$htmlname.'" value="'.$ext_table_element.'" type="hidden"/>'."\n";
|
||||||
//$out.= '<input id="ext_fk_element_'.$htmlname.'" value="'.$ext_fk_element.'" type="hidden"/>'."\n";
|
//$out.= '<input id="ext_fk_element_'.$htmlname.'" value="'.$ext_fk_element.'" type="hidden"/>'."\n";
|
||||||
|
|
||||||
$out.= '<div id="val_'.$htmlname.'" class="editval_'.$inputType.'">'.$value.'</div>'."\n";
|
$out.= '<div id="val_'.$htmlname.'" class="editval_'.$inputType.'">'.$value.'</div>'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$out = $value;
|
$out = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a text and picto with tooltip on text or picto
|
* Show a text and picto with tooltip on text or picto
|
||||||
*
|
*
|
||||||
@ -308,21 +308,21 @@ class Form
|
|||||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
|
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if ($incbefore) $text = $incbefore.$text;
|
if ($incbefore) $text = $incbefore.$text;
|
||||||
if (! $htmltext) return $text;
|
if (! $htmltext) return $text;
|
||||||
|
|
||||||
// Sanitize tooltip
|
// Sanitize tooltip
|
||||||
$htmltext=str_replace("\\","\\\\",$htmltext);
|
$htmltext=str_replace("\\","\\\\",$htmltext);
|
||||||
$htmltext=str_replace("\r","",$htmltext);
|
$htmltext=str_replace("\r","",$htmltext);
|
||||||
$htmltext=str_replace("\n","",$htmltext);
|
$htmltext=str_replace("\n","",$htmltext);
|
||||||
|
|
||||||
$htmltext=str_replace('"',""",$htmltext);
|
$htmltext=str_replace('"',""",$htmltext);
|
||||||
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
|
||||||
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||||
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
|
||||||
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||||
|
|
||||||
$s="";
|
$s="";
|
||||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||||
if ($direction > 0)
|
if ($direction > 0)
|
||||||
@ -346,7 +346,7 @@ class Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($notabs)) $s.='</tr></table>';
|
if (empty($notabs)) $s.='</tr></table>';
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2701,17 +2701,17 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a select box with available absolute discounts
|
* Show a select box with available absolute discounts
|
||||||
*
|
*
|
||||||
* @param page Page URL where form is shown
|
* @param string $page Page URL where form is shown
|
||||||
* @param selected Value pre-selected
|
* @param int $selected Value pre-selected
|
||||||
* @param htmlname Nom du formulaire select. Si none, non modifiable
|
* @param string $htmlname Nom du formulaire select. Si none, non modifiable
|
||||||
* @param socid Third party id
|
* @param int $socid Third party id
|
||||||
* @param amount Total amount available
|
* @param float $amount Total amount available
|
||||||
* @param filter SQL filter on discounts
|
* @param string $filter SQL filter on discounts
|
||||||
* @param maxvalue Max value for lines that can be selected
|
* @param int $maxvalue Max value for lines that can be selected
|
||||||
* @param more More string to add
|
* @param string $more More string to add
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
|
function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
|
||||||
{
|
{
|
||||||
@ -2725,10 +2725,9 @@ class Form
|
|||||||
print '<tr><td nowrap="nowrap">';
|
print '<tr><td nowrap="nowrap">';
|
||||||
if (! $filter || $filter=='fk_facture_source IS NULL') print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
if (! $filter || $filter=='fk_facture_source IS NULL') print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||||
// print $langs->trans("AvailableGlobalDiscounts").': ';
|
|
||||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||||
if ($filter) $newfilter.=' AND '.$filter;
|
if ($filter) $newfilter.=' AND '.$filter;
|
||||||
$nbqualifiedlines=$this->select_remises('',$htmlname,$newfilter,$socid,$maxvalue);
|
$nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($nbqualifiedlines > 0)
|
if ($nbqualifiedlines > 0)
|
||||||
|
|||||||
@ -439,12 +439,17 @@ class FormFile
|
|||||||
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC);
|
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC);
|
||||||
|
|
||||||
// Affiche en-tete tableau si non deja affiche
|
// Affiche en-tete tableau si non deja affiche
|
||||||
if (count($file_list) && ! $headershown && !$iconPDF)
|
if (! empty($file_list) && ! $headershown && ! $iconPDF)
|
||||||
{
|
{
|
||||||
$headershown=1;
|
$headershown=1;
|
||||||
$out.= '<div class="titre">'.$titletoshow.'</div>';
|
$out.= '<div class="titre">'.$titletoshow.'</div>';
|
||||||
$out.= '<table class="border" summary="listofdocumentstable" width="100%">';
|
$out.= '<table class="border" summary="listofdocumentstable" width="100%">';
|
||||||
}
|
}
|
||||||
|
else if (empty($file_list) && ! empty($iconPDF))
|
||||||
|
{
|
||||||
|
// For ajax treatment
|
||||||
|
$out.= '<div id="gen_pdf_'.$filename.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Loop on each file found
|
// Loop on each file found
|
||||||
foreach($file_list as $file)
|
foreach($file_list as $file)
|
||||||
@ -458,15 +463,15 @@ class FormFile
|
|||||||
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; }
|
||||||
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
if ($modulepart == 'export') { $relativepath = $file["name"]; }
|
||||||
|
|
||||||
if (!$iconPDF) $out.= "<tr ".$bc[$var].">";
|
if (! $iconPDF) $out.= "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
// Show file name with link to download
|
// Show file name with link to download
|
||||||
if (!$iconPDF) $out.= '<td nowrap="nowrap">';
|
if (! $iconPDF) $out.= '<td nowrap="nowrap">';
|
||||||
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||||
$mime=dol_mimetype($relativepath,'',0);
|
$mime=dol_mimetype($relativepath,'',0);
|
||||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||||
$out.= '>';
|
$out.= '>';
|
||||||
if (!$iconPDF)
|
if (! $iconPDF)
|
||||||
{
|
{
|
||||||
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
||||||
}
|
}
|
||||||
@ -474,12 +479,15 @@ class FormFile
|
|||||||
{
|
{
|
||||||
$out.= img_pdf($file["name"],2);
|
$out.= img_pdf($file["name"],2);
|
||||||
}
|
}
|
||||||
$out.= '</a>';
|
$out.= '</a>'."\n";
|
||||||
if (!$iconPDF) $out.= '</td>';
|
if (! $iconPDF)
|
||||||
// Affiche taille fichier
|
{
|
||||||
if (!$iconPDF) $out.= '<td align="right" nowrap="nowrap">'.dol_print_size(dol_filesize($filedir."/".$file["name"])).'</td>';
|
$out.= '</td>';
|
||||||
// Affiche date fichier
|
// Show file size
|
||||||
if (!$iconPDF) $out.= '<td align="right" nowrap="nowrap">'.dol_print_date(dol_filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
|
$out.= '<td align="right" nowrap="nowrap">'.dol_print_size(dol_filesize($filedir."/".$file["name"])).'</td>';
|
||||||
|
// Show file date
|
||||||
|
$out.= '<td align="right" nowrap="nowrap">'.dol_print_date(dol_filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($delallowed)
|
if ($delallowed)
|
||||||
{
|
{
|
||||||
@ -489,7 +497,7 @@ class FormFile
|
|||||||
$out.= '">'.img_delete().'</a></td>';
|
$out.= '">'.img_delete().'</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$iconPDF) $out.= '</tr>';
|
if (! $iconPDF) $out.= '</tr>';
|
||||||
|
|
||||||
$this->numoffiles++;
|
$this->numoffiles++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -752,11 +752,11 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
{
|
{
|
||||||
if ($idprod)
|
if ($idprod)
|
||||||
{
|
{
|
||||||
if ( empty($hidedesc) ) $libelleproduitservice.=$desc;
|
if ( empty($hidedesc) ) $libelleproduitservice.=dol_htmlentitiesbr($desc,1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$libelleproduitservice.=$desc;
|
$libelleproduitservice.=dol_htmlentitiesbr($desc,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
htdocs/langs/HOWTO-Translation.txt
Executable file → Normal file
0
htdocs/langs/HOWTO-Translation.txt
Executable file → Normal file
@ -73,7 +73,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
|
|||||||
function test_sql_and_script_inject($val, $type)
|
function test_sql_and_script_inject($val, $type)
|
||||||
{
|
{
|
||||||
$sql_inj = 0;
|
$sql_inj = 0;
|
||||||
// For SQL Injection (onyl GET and POST are used to be included into bad escaped SQL requests)
|
// For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests)
|
||||||
if ($type != 2)
|
if ($type != 2)
|
||||||
{
|
{
|
||||||
$sql_inj += preg_match('/delete[\s]+from/i', $val);
|
$sql_inj += preg_match('/delete[\s]+from/i', $val);
|
||||||
|
|||||||
@ -1217,17 +1217,18 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a discount for third party
|
* Add a discount for third party
|
||||||
* @param remise Montant de la remise
|
*
|
||||||
* @param user Utilisateur qui accorde la remise
|
* @param float $remise Amount of discount
|
||||||
* @param desc Motif de l'avoir
|
* @param User $user User adding discount
|
||||||
* @param tva_tx VAT rate
|
* @param string $desc Reason of discount
|
||||||
* @return int <0 if KO, id or record if OK
|
* @param float $tva_tx VAT rate
|
||||||
|
* @return int <0 if KO, id of discount record if OK
|
||||||
*/
|
*/
|
||||||
function set_remise_except($remise, $user, $desc, $tva_tx=0)
|
function set_remise_except($remise, $user, $desc, $tva_tx=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
// Nettoyage des parametres
|
// Clean parameters
|
||||||
$remise = price2num($remise);
|
$remise = price2num($remise);
|
||||||
$desc = trim($desc);
|
$desc = trim($desc);
|
||||||
|
|
||||||
@ -1269,11 +1270,12 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoie montant TTC des reductions/avoirs en cours disponibles de la societe
|
* Renvoie montant TTC des reductions/avoirs en cours disponibles de la societe
|
||||||
* \param user Filtre sur un user auteur des remises
|
*
|
||||||
* \param filter Filtre autre
|
* @param User $user Filtre sur un user auteur des remises
|
||||||
* \param maxvalue Filter on max value for discount
|
* @param string $filter Filtre autre
|
||||||
* \return int <0 if KO, Credit note amount otherwise
|
* @param string $maxvalue Filter on max value for discount
|
||||||
|
* @return int <0 if KO, Credit note amount otherwise
|
||||||
*/
|
*/
|
||||||
function getAvailableDiscounts($user='',$filter='',$maxvalue=0)
|
function getAvailableDiscounts($user='',$filter='',$maxvalue=0)
|
||||||
{
|
{
|
||||||
@ -1294,6 +1296,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of sales representatives
|
* Return array of sales representatives
|
||||||
|
*
|
||||||
* @return array Array of sales representatives of third party
|
* @return array Array of sales representatives of third party
|
||||||
*/
|
*/
|
||||||
function getSalesRepresentatives($user='')
|
function getSalesRepresentatives($user='')
|
||||||
@ -1331,8 +1334,8 @@ class Societe extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Set the price level
|
* Set the price level
|
||||||
*
|
*
|
||||||
* @param $price_level
|
* @param int $price_level Level of price
|
||||||
* @param $user
|
* @param User $user Use making change
|
||||||
*/
|
*/
|
||||||
function set_price_level($price_level, $user)
|
function set_price_level($price_level, $user)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user