Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Nov 14, 2011
2 parents 9a43c8a + 40a4bce commit 8cdbc21
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
my $dir = getcwd;

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)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 7 additions & 5 deletions htdocs/comm/remx.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
$langs->load("bills");
$langs->load("companies");

$action=GETPOST('action');

// Security check
$socid = GETPOST("id");
if ($user->societe_id > 0)
Expand All @@ -50,7 +52,7 @@
exit;
}

if (GETPOST("action") == 'confirm_split' && GETPOST("confirm") == 'yes')
if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
{
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)
Expand Down Expand Up @@ -127,7 +129,7 @@
}
}

if (GETPOST("action") == 'setremise')
if ($action == 'setremise')
{
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)
Expand All @@ -145,13 +147,13 @@
{
$soc = new Societe($db);
$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"))
{
Header("Location: ".GETPOST("backtopage"));
Header("Location: ".GETPOST("backtopage").'&discountid='.$discountid);
exit;
}
else
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2225,12 +2225,12 @@
// Remise dispo de type remise fixe (not credit note)
$filter='fk_facture_source IS NULL';
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
{
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>';
else print '.';
Expand Down
10 changes: 5 additions & 5 deletions htdocs/compta/facture/impayees.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@

?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#checkall").click(function() {
jQuery(".checkformerge").attr('checked', true);
$(document).ready(function() {
$("#checkall").click(function() {
$(".checkformerge").attr('checked', true);
});
jQuery("#checknone").click(function() {
jQuery(".checkformerge").attr('checked', false);
$("#checknone").click(function() {
$(".checkformerge").attr('checked', false);
});
});
</script>
Expand Down
87 changes: 43 additions & 44 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@ class Form
{
var $db;
var $error;

// Cache arrays
var $cache_types_paiements=array();
var $cache_conditions_paiements=array();
var $cache_availability=array();
var $cache_demand_reason=array();
var $cache_type_fees=array();

var $tva_taux_value;
var $tva_taux_libelle;


/**
* Constructor
*
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
$this->db = $db;
}

/**
* Output key field for an editable field
*
*
* @param string $text Text of label or key to translate
* @param string $htmlname Name of select field
* @param string $preselected Name of Value to show/edit (not used in this function)
Expand All @@ -79,9 +79,9 @@ public function __construct($db)
function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='string')
{
global $conf,$langs;

$ret='';

if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
{
if ($perm)
Expand All @@ -104,13 +104,13 @@ function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='st
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&amp;id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
$ret.='</tr></table>';
}

return $ret;
}

/**
* Output val field for an editable field
*
*
* @param string $text Text of label (not used in this function)
* @param string $htmlname Name of select field
* @param string $value Value to show/edit
Expand All @@ -124,9 +124,9 @@ function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='st
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=false)
{
global $conf,$langs,$db;

$ret='';

// When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
{
Expand Down Expand Up @@ -185,7 +185,7 @@ function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',
}
return $ret;
}

/**
* Output edit in place form
*
Expand All @@ -200,14 +200,14 @@ function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $extObject=false)
{
global $conf;

$out='';

// Check parameters
if ($inputType == 'textarea') $value = dol_nl2br($value);
else if (preg_match('/^numeric/',$inputType)) $value = price($value);
else if ($inputType == 'datepicker') $value = dol_print_date($value, 'day');

if ($condition)
{
$element = false;
Expand All @@ -218,21 +218,21 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
$ext_element = false;
//$ext_table_element = false;
//$ext_fk_element = false;

if (is_object($object))
{
$element = $object->element;
$table_element = $object->table_element;
$fk_element = $object->id;
}

if (is_object($extObject))
{
$ext_element = $extObject->element;
//$ext_table_element = $extObject->table_element;
//$ext_fk_element = $extObject->id;
}

if (preg_match('/^(string|email|numeric)/',$inputType))
{
$tmp=explode(':',$inputType);
Expand All @@ -244,7 +244,7 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
$tmp=explode(':',$inputType);
$inputType=$tmp[0]; $inputOption=$tmp[1];
if (! empty($tmp[2])) $savemethod=$tmp[2];

$out.= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format
}
else if (preg_match('/^select/',$inputType))
Expand All @@ -260,7 +260,7 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
if (! empty($tmp[2])) $width=$tmp[2];
if (! empty($tmp[3])) $heigth=$tmp[3];
if (! empty($tmp[4])) $savemethod=$tmp[4];

if (! empty($conf->fckeditor->enabled))
{
$out.= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n";
Expand All @@ -270,7 +270,7 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
$inputType = 'textarea';
}
}

$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="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n";
Expand All @@ -279,17 +279,17 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
$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_fk_element_'.$htmlname.'" value="'.$ext_fk_element.'" type="hidden"/>'."\n";

$out.= '<div id="val_'.$htmlname.'" class="editval_'.$inputType.'">'.$value.'</div>'."\n";
}
else
{
$out = $value;
}

return $out;
}

/**
* Show a text and picto with tooltip on text or picto
*
Expand All @@ -308,21 +308,21 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0)
{
global $conf;

if ($incbefore) $text = $incbefore.$text;
if (! $htmltext) return $text;

// Sanitize tooltip
$htmltext=str_replace("\\","\\\\",$htmltext);
$htmltext=str_replace("\r","",$htmltext);
$htmltext=str_replace("\n","",$htmltext);

$htmltext=str_replace('"',"&quot;",$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
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
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag

$s="";
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
if ($direction > 0)
Expand All @@ -346,7 +346,7 @@ function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extr
}
}
if (empty($notabs)) $s.='</tr></table>';

return $s;
}

Expand Down Expand Up @@ -2701,17 +2701,17 @@ function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id'


/**
* 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 selected Value pre-selected
* @param htmlname Nom du formulaire select. Si none, non modifiable
* @param socid Third party id
* @param amount Total amount available
* @param filter SQL filter on discounts
* @param maxvalue Max value for lines that can be selected
* @param more More string to add
* @return void
* @param string $page Page URL where form is shown
* @param int $selected Value pre-selected
* @param string $htmlname Nom du formulaire select. Si none, non modifiable
* @param int $socid Third party id
* @param float $amount Total amount available
* @param string $filter SQL filter on discounts
* @param int $maxvalue Max value for lines that can be selected
* @param string $more More string to add
* @return void
*/
function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
{
Expand All @@ -2725,10 +2725,9 @@ function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $a
print '<tr><td nowrap="nowrap">';
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)).': ';
// print $langs->trans("AvailableGlobalDiscounts").': ';
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
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>';
if ($nbqualifiedlines > 0)
Expand Down

0 comments on commit 8cdbc21

Please sign in to comment.