diff --git a/ChangeLog b/ChangeLog
index c88e1554a6a..2ee30c7915c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -128,7 +128,7 @@ parameter. All methods addline in this case were modified to remove this paramet
5) Property ->tel on objects is now ->phone
-
+
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB)
Fix: Document cerfa doesn't contained firstname & lastname from donator
@@ -140,6 +140,13 @@ Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1145 ] Agenda button list type do not display
Fix: [ bug #1148 ] Product consomation : supplier order bad status
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
+Fix: [ bug #1174 ] Product translated description not good into PDF
+Fix: [ bug #1163 ] SQL Error when searching for supplier orders
+Fix: [ bug #1162 ] Translaction for morning and afternoon
+Fix: [ bug #1161 ] Search on product label
+Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
+Fix: [ bug #1171 ] Documents lost in interventions after validating
+Fix: fix unsubscribe URL into mailing when sending manually (not by script)
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined
@@ -170,7 +177,6 @@ Fix: there was no escaping on filter fields in supplier product list
Fix: bugs on margin reports and better margin calculation on credit notes
Qual: Add travis-ci integration
-
***** ChangeLog for 3.4 compared to 3.3.* *****
For users:
- New: Can use ODS templates as document templates.
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 447e065219e..841e9e957e4 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -978,7 +978,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
$error++;
}
}
-
+
if (! $error)
{
$result = $object->updateline(
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 3b61a3150b5..134d6d408ab 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -957,7 +957,17 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang))
{
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"];
- if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
+
+ //Manage HTML entities description test
+ //Cause $prodser->description is store with htmlentities but $desc no
+ $needdesctranslation=false;
+ if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
+ $needdesctranslation=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false);
+ } else {
+ $needdesctranslation=($desc == $prodser->description);
+ }
+
+ if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($needdesctranslation)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"];
}
}
diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php
index 2609c402ffe..8461465c554 100644
--- a/htdocs/ecm/ajax/ecmdatabase.php
+++ b/htdocs/ecm/ajax/ecmdatabase.php
@@ -51,7 +51,9 @@ if (isset($action) && ! empty($action))
require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php';
$ecmdirstatic = new EcmDirectory($db);
+ $ecmdirtmp = new EcmDirectory($db);
+ // This part of code is same than into file index.php for action refreshmanual TODO Remove duplicate
clearstatcache();
$diroutputslash=str_replace('\\', '/', $conf->$element->dir_output);
@@ -129,7 +131,6 @@ if (isset($action) && ! empty($action))
if ($fk_parent >= 0)
{
- $ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
$ecmdirtmp->description = '';
@@ -163,7 +164,21 @@ if (isset($action) && ! empty($action))
}
}
+ // Loop now on each sql tree to check if dir exists
+ foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
+ {
+ $dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
+ if (! dol_is_dir($dirtotest))
+ {
+ $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."
\n";
+ $ecmdirtmp->id=$dirdesc['id'];
+ $ecmdirtmp->delete($user,'databaseonly');
+ //exit;
+ }
+ }
+
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
+ dol_syslog("sql = ".$sql);
$db->query($sql);
}
}
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 4abeea326e4..54e3fa0a561 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -151,7 +151,7 @@ class EcmDirectory // extends CommonObject
$dir=$conf->ecm->dir_output.'/'.$this->getRelativePath();
$result=dol_mkdir($dir);
if ($result < 0) { $error++; $this->error="ErrorFailedToCreateDir"; }
-
+
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
@@ -325,21 +325,23 @@ class EcmDirectory // extends CommonObject
/**
- * Delete object on database and on disk
+ * Delete object on database and/or on disk
*
* @param User $user User that delete
+ * @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented)
* @return int <0 if KO, >0 if OK
*/
- function delete($user)
+ function delete($user, $mode='all')
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error=0;
+ $result=0;
- $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
+ if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
- dol_syslog(get_class($this)."::delete remove directory ".$relativepath);
+ dol_syslog(get_class($this)."::delete remove directory id=".$this->id." mode=".$mode.(($mode == 'databaseonly')?'':' relativepath='.$relativepath));
$this->db->begin();
@@ -356,8 +358,11 @@ class EcmDirectory // extends CommonObject
return -2;
}
- $file = $conf->ecm->dir_output . "/" . $relativepath;
- $result=@dol_delete_dir($file);
+ if ($mode != 'databaseonly')
+ {
+ $file = $conf->ecm->dir_output . "/" . $relativepath;
+ $result=@dol_delete_dir($file);
+ }
if ($result || ! @is_dir(dol_osencode($file)))
{
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 531138aaab9..e7e4498f99d 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -206,7 +206,10 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
// Refresh directory view
if ($action == 'refreshmanual')
{
- clearstatcache();
+ $ecmdirtmp = new EcmDirectory($db);
+
+ // This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
+ clearstatcache();
$diroutputslash=str_replace('\\','/',$conf->ecm->dir_output);
$diroutputslash.='/';
@@ -269,7 +272,7 @@ if ($action == 'refreshmanual')
//break; // We found parent, we can stop the while loop
}
else
- {
+ {
dol_syslog("No");
//print "No
\n";
}
@@ -282,7 +285,6 @@ if ($action == 'refreshmanual')
if ($fk_parent >= 0)
{
- $ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = dol_basename($dirdesc['fullname']);
$ecmdirtmp->description = '';
@@ -316,6 +318,19 @@ if ($action == 'refreshmanual')
}
}
+ // Loop now on each sql tree to check if dir exists
+ foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
+ {
+ $dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
+ if (! dol_is_dir($dirtotest))
+ {
+ $mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."
\n";
+ $ecmdirtmp->id=$dirdesc['id'];
+ $ecmdirtmp->delete($user,'databaseonly');
+ //exit;
+ }
+ }
+
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
dol_syslog("sql = ".$sql);
$db->query($sql);
diff --git a/htdocs/ecm/tpl/builddatabase.tpl.php b/htdocs/ecm/tpl/builddatabase.tpl.php
index 4d5c0ab953a..1b34027142f 100644
--- a/htdocs/ecm/tpl/builddatabase.tpl.php
+++ b/htdocs/ecm/tpl/builddatabase.tpl.php
@@ -50,7 +50,15 @@ $(document).ready(function() {
);
$('#refreshbutton').click( function() {
- ecmBuildDatabase();
+ $.pleaseBePatient("trans('PleaseBePatient'); ?>");
+ $.getJSON( "", {
+ action: "build",
+ element: "ecm"
+ },
+ function(response) {
+ $.unblockUI();
+ location.href="";
+ });
});
});
@@ -78,17 +86,5 @@ function loadandshowpreview(filedirname,section)
});
}
-ecmBuildDatabase = function() {
- $.pleaseBePatient("trans('PleaseBePatient'); ?>");
- $.getJSON( "", {
- action: "build",
- element: "ecm"
- },
- function(response) {
- $.unblockUI();
- location.href="";
- });
-};
-
-
\ No newline at end of file
+
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index e56c60a68dd..bc4004e4fc1 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -109,16 +109,17 @@ if ($sttc)
}
if ($sall)
{
- $sql .= natural_search(array('cf.ref', 'cf.note_public'), $sall);
+ $sql .= natural_search(array('cf.ref', 'cf.note_public', 'cf.note_private'), $sall);
}
if ($socid) $sql.= " AND s.rowid = ".$socid;
if (GETPOST('statut'))
{
- $sql .= " AND fk_statut =".GETPOST('statut');
+ $sql .= " AND fk_statut =".GETPOST('statut','int');
}
-$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
+$sql.= " ORDER BY $sortfield $sortorder ";
+$sql.= $db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 7c535e07d5d..89b05f25f9a 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -257,6 +257,8 @@ Seconds=Seconds
Today=Today
Yesterday=Yesterday
Tomorrow=Tomorrow
+Morning=Morning
+Afternoon=Afternoon
Quadri=Quadri
MonthOfDay=Month of the day
HourShort=H
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 5725292f70d..34b0da196a2 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -257,6 +257,8 @@ Seconds=Secondes
Today=Aujourd'hui
Yesterday=Hier
Tomorrow=Demain
+Morning=Matin
+Afternoon=Après-midi
Quadri=Trimestre
MonthOfDay=Mois du jour
HourShort=H
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 21d98fbd64c..16d2c4fea7d 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -214,6 +214,7 @@ if ($month > 0) {
$sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
}
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";
+if ($sprod_fulldescr) $sql.= " AND (d.description LIKE '%".$sprod_fulldescr."%' OR p.label LIKE '%".$sprod_fulldescr."%')";
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset);
@@ -249,7 +250,7 @@ print $formother->select_month($month?$month:-1,'month',1);
$formother->select_year($year?$year:-1,'year',1, 20, 1);
print '';
print '