Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6

This commit is contained in:
Laurent Destailleur 2014-10-12 15:24:33 +02:00
commit 5c07df812d
9 changed files with 76 additions and 53 deletions

View File

@ -2,6 +2,12 @@
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice
- Fix: bug 1588 : relative discount
- Fix: label of input method not tranlated.
***** ChangeLog for 3.6.1 compared to 3.6.* ***** ***** ChangeLog for 3.6.1 compared to 3.6.* *****
For users: For users:
- Fix: Can upload files on services. - Fix: Can upload files on services.

View File

@ -184,18 +184,19 @@ if ($action=='show_week')
$prev_month = $prev['prev_month']; $prev_month = $prev['prev_month'];
$prev_day = $prev['prev_day']; $prev_day = $prev['prev_day'];
$first_day = $prev['first_day']; $first_day = $prev['first_day'];
$first_month= $prev['first_month'];
$first_year = $prev['first_year'];
$week = $prev['week']; $week = $prev['week'];
$day = (int) $day; $day = (int) $day;
$next = dol_get_next_week($day, $week, $month, $year); $next = dol_get_next_week($first_day, $week, $first_month, $first_year);
$next_year = $next['year']; $next_year = $next['year'];
$next_month = $next['month']; $next_month = $next['month'];
$next_day = $next['day']; $next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow // Define firstdaytoshow and lastdaytoshow
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$first_day,$prev_year); $firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year); $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year)); $max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@ -870,40 +871,28 @@ elseif ($action == 'show_week') // View by week
} }
echo " </tr>\n"; echo " </tr>\n";
// In loops, tmpday contains day nb in current month (can be zero or negative for days of previous month)
//var_dump($eventarray);
//print $tmpday;
echo " <tr>\n"; echo " <tr>\n";
for($iter_day = 0; $iter_day < 7; $iter_day++) for($iter_day = 0; $iter_day < 7; $iter_day++)
{
if(($tmpday <= $max_day_in_month))
{ {
// Show days of the current week // Show days of the current week
$curtime = dol_mktime(0, 0, 0, $month, $tmpday, $year); $curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
$tmparray = dol_getdate($curtime,'fast');
$tmpday = $tmparray['mday'];
$tmpmonth = $tmparray['mon'];
$tmpyear = $tmparray['year'];
$style='cal_current_month'; $style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right'; if ($iter_day == 6) $style.=' cal_other_month_right';
$today=0; $today=0;
$todayarray=dol_getdate($now,'fast'); $todayarray=dol_getdate($now,'fast');
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($today) $style='cal_today'; if ($today) $style='cal_today';
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">'; echo ' <td class="'.$style.'" width="14%" valign="top">';
show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300); show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo " </td>\n"; echo " </td>\n";
} }
else
{
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month_right';
echo ' <td class="'.$style.' nowrap" width="14%" valign="top">';
show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
echo "</td>\n";
}
$tmpday++;
}
echo " </tr>\n"; echo " </tr>\n";
echo "</table>\n"; echo "</table>\n";

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -41,6 +41,7 @@ class Contrat extends CommonObject
public $table_element='contrat'; public $table_element='contrat';
public $table_element_line='contratdet'; public $table_element_line='contratdet';
public $fk_element='fk_contrat'; public $fk_element='fk_contrat';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
var $ref; var $ref;

View File

@ -544,7 +544,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
} }
} }
$week = date("W",dol_mktime(0,0,0,$month,$tmpday,$year,$gm)); $week = date("W",dol_mktime(0,0,0,$tmpmonth,$tmpday,$tmpyear,$gm));
return array('year' => $year, 'month' => $month, 'week' => $week, 'first_day' => $tmpday, 'first_month' => $tmpmonth, 'first_year' => $tmpyear, 'prev_year' => $prev_year, 'prev_month' => $prev_month, 'prev_day' => $prev_day); return array('year' => $year, 'month' => $month, 'week' => $week, 'first_day' => $tmpday, 'first_month' => $tmpmonth, 'first_year' => $tmpyear, 'prev_year' => $prev_year, 'prev_month' => $prev_month, 'prev_day' => $prev_day);
} }

View File

@ -203,7 +203,7 @@ else {
<?php } ?> <?php } ?>
<td align="right"><input type="text" size="2" name="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"> <td align="right"><input type="text" size="2" name="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
</td> </td>
<td align="right" class="nowrap"><input type="text" size="1" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_client); ?>" name="remise_percent"><span class="hideonsmartphone">%</span></td> <td align="right" class="nowrap"><input type="text" size="1" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>" name="remise_percent"><span class="hideonsmartphone">%</span></td>
<?php <?php
if (! empty($usemargins)) if (! empty($usemargins))

View File

@ -94,11 +94,20 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
$action=''; $action='';
} }
else else
{
$res = $object->reprogram_jobs($user->login);
if ($res > 0)
{ {
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
else setEventMessage($langs->trans("JobFinished"),'mesgs'); else setEventMessage($langs->trans("JobFinished"),'mesgs');
$action=''; $action='';
} }
else
{
setEventMessage($object->error,'errors');
$action='';
}
}
} }

View File

@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
if ($result < 0) { if ($result < 0) {
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }
else
{
$res = $object->reprogram_jobs($user->login);
if ($res > 0)
{
if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
else setEventMessage($langs->trans("JobFinished"),'mesgs');
$action='';
}
else
{
setEventMessage($object->error,'errors');
$action='';
}
}
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back
exit; exit;

View File

@ -2016,7 +2016,8 @@ class CommandeFournisseur extends CommonOrder
} }
/** /**
* Returns the translated input method * Returns the translated input method of object (defined if $this->methode_commande_id > 0).
* This function make a sql request to get translation. No cache yet, try to not use it inside a loop.
* *
* @return string * @return string
*/ */
@ -2026,21 +2027,19 @@ class CommandeFournisseur extends CommonOrder
if ($this->methode_commande_id > 0) if ($this->methode_commande_id > 0)
{ {
$sql = "SELECT rowid, code, libelle"; $sql = "SELECT rowid, code, libelle as label";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_input_method';
$sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id); $sql.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id);
$query = $db->query($sql); $query = $db->query($sql);
if ($query && $db->num_rows($query)) if ($query && $db->num_rows($query))
{ {
$result = $db->fetch_object($query); $obj = $db->fetch_object($query);
$string = $langs->trans($result->code); $string = $langs->trans($obj->code);
if ($string == $obj->code)
if ($string == $result->code)
{ {
$string = $obj->libelle != '-' ? $obj->libelle : ''; $string = $obj->label != '-' ? $obj->label : '';
} }
return $string; return $string;

View File

@ -365,9 +365,13 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
// Prix mini // Prix mini
print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>'; print '<tr><td>' . $langs->trans("MinPrice") . ' ' . $i . '</td><td>';
if ($object->multiprices_base_type ["$i"] == 'TTC') { if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT";
if ($object->multiprices_base_type["$i"] == 'TTC')
{
print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); print price($object->multiprices_min_ttc["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
} else { }
else
{
print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]); print price($object->multiprices_min["$i"]) . ' ' . $langs->trans($object->multiprices_base_type["$i"]);
} }
print '</td></tr>'; print '</td></tr>';