diff --git a/ChangeLog b/ChangeLog
index 409c885050f..78bba6e6df5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -139,6 +139,7 @@ Fix: [ bug #1388 ] Wrong date when invoicing several orders.
Fix: [ bug #1411 ] Unable to set an expedition note if invoices module is not enabled.
Fix: [ bug #1407 ] Rouget pdf overlapped when using tracking number and public notes.
Fix: [ bug #1405 ] Rouget PDF expedition incorrect when two expeditions under the same commande
+Fix: [ bug #1434 ] Muscadet supplier order document model linked objects overlap the text
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
Fix: Can't add user for a task.
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 16cab849514..fcf53d8254c 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -257,10 +257,11 @@ class FormFile
*/
function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='')
{
- global $langs,$conf,$hookmanager,$user,$form,$bc;
+ global $langs, $conf, $user, $hookmanager;
+ global $form, $bc;
if (! is_object($form)) $form=new Form($this->db);
-
+
// filedir = $conf->...->dir_ouput."/".get_exdir(id)
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -554,9 +555,12 @@ class FormFile
$out.= "
";
+ $documenturl = DOL_URL_ROOT.'/document.php';
+ if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
+
// Show file name with link to download
$out.= '';
- $out.= '';
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 09b39f22812..7c322a59264 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -438,7 +438,9 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
// Add a background image on document
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF))
{
+ $pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image
$pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, 0, 0, 0, $page_height);
+ $pdf->SetAutoPageBreak(1,0); // Restore pagebreak
}
}
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 616970f4dae..63b301253ab 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -993,7 +993,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
}
- $posy+=2;
+ $posy+=5;
$pdf->SetTextColor(0,0,60);
// Show list of linked objects
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index b59b7dd0aa2..d671322d0dc 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2231,16 +2231,24 @@ class User extends CommonObject
*/
function get_full_tree($markafterid=0)
{
+ global $conf,$user;
+
$this->users = array();
// Init this->parentof that is array(id_son=>id_parent, ...)
$this->load_parentof();
// Init $this->users array
- $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut"; // Distinct reduce pb with old tables with duplicates
+ $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
- $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
-
+ if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
+ {
+ $sql.= " WHERE u.entity IS NOT NULL";
+ }
+ else
+ {
+ $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
+ }
dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
@@ -2255,6 +2263,7 @@ class User extends CommonObject
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
$this->users[$obj->rowid]['login'] = $obj->login;
$this->users[$obj->rowid]['statut'] = $obj->statut;
+ $this->users[$obj->rowid]['entity'] = $obj->entity;
$i++;
}
}
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index f108667ccb3..d78a512bf53 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -1301,19 +1301,23 @@ else
}
// Multicompany
- if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
+ // TODO This should be done with hook formObjectOption
+ if (is_object($mc))
{
- print '| '.$langs->trans("Entity").' | ';
- if ($object->admin && ! $object->entity)
- {
- print $langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($object->entity);
- print $mc->label;
- }
- print " | \n";
+ if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
+ {
+ print '| '.$langs->trans("Entity").' | ';
+ if ($object->admin && ! $object->entity)
+ {
+ print $langs->trans("AllEntities");
+ }
+ else
+ {
+ $mc->getInfo($object->entity);
+ print $mc->label;
+ }
+ print " | \n";
+ }
}
// Other attributes
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index 8061163fca2..3c330f3a712 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -76,9 +76,9 @@ foreach($fulltree as $key => $val)
$userstatic->id=$val['id'];
$userstatic->ref=$val['label'];
$userstatic->firstname=$val['firstname'];
- $userstatic->lastname=$val['name'];
+ $userstatic->lastname=$val['lastname'];
$userstatic->statut=$val['statut'];
- $li=$userstatic->getNomUrl(1,'').' ('.$val['login'].')';
+ $li=$userstatic->getNomUrl(1,'').' ('.$val['login'].(empty($conf->multicompany->enabled)?'':' - '.$langs->trans("Instance").' '.$val['entity']).')';
$data[] = array(
'rowid'=>$val['rowid'],
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index 44b40f7786b..824f505fddd 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -148,26 +148,30 @@ if ($resql)
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1);
}
- else if (! empty($conf->multicompany->enabled))
- {
- if ($obj->admin && ! $obj->entity)
- {
- print $langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($obj->entity);
- print $mc->label;
- }
- }
- else if ($obj->ldap_sid)
- {
- print $langs->trans("DomainUser");
- }
else
{
print $langs->trans("InternalUser");
}
+ if ($obj->ldap_sid)
+ {
+ print ' ('.$langs->trans("DomainUser").')';
+ }
+ // TODO This should be done with a hook
+ if (is_object($mc))
+ {
+ if (! empty($conf->multicompany->enabled))
+ {
+ if ($obj->admin && ! $obj->entity)
+ {
+ print ' ('.$langs->trans("AllEntities").')';
+ }
+ else
+ {
+ $mc->getInfo($obj->entity);
+ print ' ('.$mc->label.')';
+ }
+ }
+ }
print ' | ';
print ''.dol_print_date($db->jdate($obj->datec),'dayhour').' | ';
print '';
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index 56d866f3ae9..743379f843c 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -42,7 +42,6 @@ if ($user->societe_id > 0)
$sall=GETPOST('sall','alpha');
$search_user=GETPOST('search_user','alpha');
$search_statut=GETPOST('search_statut','alpha');
-if ($search_statut=='') $search_statut=1; // always display activ customer first
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
@@ -82,14 +81,14 @@ if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf
}
else
{
- $sql.= " WHERE u.entity IN (0,".$conf->entity.")";
+ $sql.= " WHERE u.entity IN (".getEntity('user',1).")";
}
if (! empty($socid)) $sql.= " AND u.fk_societe = ".$socid;
if (! empty($search_user))
{
$sql.= " AND (u.login LIKE '%".$db->escape($search_user)."%' OR u.lastname LIKE '%".$db->escape($search_user)."%' OR u.firstname LIKE '%".$db->escape($search_user)."%')";
}
-if ($search_statut!='')
+if ($search_statut != '' && $search_statut >= 0)
{
$sql.= " AND (u.statut=".$search_statut.")";
}
@@ -103,8 +102,10 @@ if ($result)
$i = 0;
print ' |