\n";
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 073ef7bd0f5..6cf04c10522 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1,12 +1,12 @@
* Copyright (C) 2004-2012 Destailleur Laurent
- * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2005-2014 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2008 Raphael Bertrand
* Copyright (C) 2010-2013 Juanjo Menent
- * Copyright (C) 2013 Christophe Battarel
- * Copyright (C) 2013 Florian Henry
+ * Copyright (C) 2013 Christophe Battarel
+ * Copyright (C) 2013 Florian Henry
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,6 +41,7 @@ class Contrat extends CommonObject
public $table_element='contrat';
public $table_element_line='contratdet';
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 $ref;
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index 1d447430dfe..48ccec88cf1 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -482,7 +482,7 @@ function dol_get_last_day($year,$month=12,$gm=false)
* @param int $month Month
* @param int $year Year
* @param int $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date.
- * @return array year,month, week,first_day,prev_year,prev_month,prev_day
+ * @return array year,month,week,first_day,prev_year,prev_month,prev_day
*/
function dol_get_first_day_week($day,$month,$year,$gm=false)
{
@@ -532,7 +532,7 @@ function dol_get_first_day_week($day,$month,$year,$gm=false)
$prev_day = $tmparray['mday'];
//Check prev day of week is in same month than first day or not
- if ($prev_day>$tmpday)
+ if ($prev_day > $tmpday)
{
$prev_month = $month-1;
$prev_year = $year;
@@ -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);
}
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 68613492df8..a51a6505416 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -203,7 +203,7 @@ else {
">
-
remise_client); ?>" name="remise_percent">%
+
remise_percent); ?>" name="remise_percent">%
rights->cron->ex
}
else
{
- if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings');
- else setEventMessage($langs->trans("JobFinished"),'mesgs');
- $action='';
+ $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='';
+ }
}
}
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index dd9eb8b6289..95dd669d023 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
if ($result < 0) {
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
exit;
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 155c8111f81..3aa9d77f5de 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -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
*/
@@ -2026,21 +2027,19 @@ class CommandeFournisseur extends CommonOrder
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.= " WHERE active=1 AND rowid = ".$db->escape($this->methode_commande_id);
$query = $db->query($sql);
-
if ($query && $db->num_rows($query))
{
- $result = $db->fetch_object($query);
+ $obj = $db->fetch_object($query);
- $string = $langs->trans($result->code);
-
- if ($string == $result->code)
+ $string = $langs->trans($obj->code);
+ if ($string == $obj->code)
{
- $string = $obj->libelle != '-' ? $obj->libelle : '';
+ $string = $obj->label != '-' ? $obj->label : '';
}
return $string;
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index b208cba1c7e..856a68face6 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -365,10 +365,14 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
// Prix mini
print '