Merge remote-tracking branch 'origin/3.5' into develop
Conflicts: htdocs/core/class/html.formfile.class.php
This commit is contained in:
commit
171227e43a
@ -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 #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 #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 #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 *****
|
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
|
||||||
Fix: Can't add user for a task.
|
Fix: Can't add user for a task.
|
||||||
|
|||||||
@ -257,7 +257,8 @@ 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='')
|
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);
|
if (! is_object($form)) $form=new Form($this->db);
|
||||||
|
|
||||||
@ -554,9 +555,12 @@ class FormFile
|
|||||||
|
|
||||||
$out.= "<tr ".$bc[$var].">";
|
$out.= "<tr ".$bc[$var].">";
|
||||||
|
|
||||||
|
$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
|
// Show file name with link to download
|
||||||
$out.= '<td class="nowrap">';
|
$out.= '<td class="nowrap">';
|
||||||
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
$out.= '<a data-ajax="false" href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||||
$mime=dol_mimetype($relativepath,'',0);
|
$mime=dol_mimetype($relativepath,'',0);
|
||||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||||
$out.= ' target="_blank">';
|
$out.= ' target="_blank">';
|
||||||
|
|||||||
@ -438,7 +438,9 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
|
|||||||
// Add a background image on document
|
// Add a background image on document
|
||||||
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF))
|
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->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, 0, 0, 0, $page_height);
|
||||||
|
$pdf->SetAutoPageBreak(1,0); // Restore pagebreak
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -993,7 +993,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
$posy+=2;
|
$posy+=5;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
|||||||
@ -2231,16 +2231,24 @@ class User extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function get_full_tree($markafterid=0)
|
function get_full_tree($markafterid=0)
|
||||||
{
|
{
|
||||||
|
global $conf,$user;
|
||||||
|
|
||||||
$this->users = array();
|
$this->users = array();
|
||||||
|
|
||||||
// Init this->parentof that is array(id_son=>id_parent, ...)
|
// Init this->parentof that is array(id_son=>id_parent, ...)
|
||||||
$this->load_parentof();
|
$this->load_parentof();
|
||||||
|
|
||||||
// Init $this->users array
|
// 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.= " 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);
|
dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -2255,6 +2263,7 @@ class User extends CommonObject
|
|||||||
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
|
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
|
||||||
$this->users[$obj->rowid]['login'] = $obj->login;
|
$this->users[$obj->rowid]['login'] = $obj->login;
|
||||||
$this->users[$obj->rowid]['statut'] = $obj->statut;
|
$this->users[$obj->rowid]['statut'] = $obj->statut;
|
||||||
|
$this->users[$obj->rowid]['entity'] = $obj->entity;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1301,19 +1301,23 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multicompany
|
// 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 '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
|
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||||
if ($object->admin && ! $object->entity)
|
{
|
||||||
{
|
print '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
|
||||||
print $langs->trans("AllEntities");
|
if ($object->admin && ! $object->entity)
|
||||||
}
|
{
|
||||||
else
|
print $langs->trans("AllEntities");
|
||||||
{
|
}
|
||||||
$mc->getInfo($object->entity);
|
else
|
||||||
print $mc->label;
|
{
|
||||||
}
|
$mc->getInfo($object->entity);
|
||||||
print "</td></tr>\n";
|
print $mc->label;
|
||||||
|
}
|
||||||
|
print "</td></tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
|
|||||||
@ -76,9 +76,9 @@ foreach($fulltree as $key => $val)
|
|||||||
$userstatic->id=$val['id'];
|
$userstatic->id=$val['id'];
|
||||||
$userstatic->ref=$val['label'];
|
$userstatic->ref=$val['label'];
|
||||||
$userstatic->firstname=$val['firstname'];
|
$userstatic->firstname=$val['firstname'];
|
||||||
$userstatic->lastname=$val['name'];
|
$userstatic->lastname=$val['lastname'];
|
||||||
$userstatic->statut=$val['statut'];
|
$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(
|
$data[] = array(
|
||||||
'rowid'=>$val['rowid'],
|
'rowid'=>$val['rowid'],
|
||||||
|
|||||||
@ -148,26 +148,30 @@ if ($resql)
|
|||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas=$obj->canvas;
|
||||||
print $companystatic->getNomUrl(1);
|
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
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("InternalUser");
|
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 '</td>';
|
print '</td>';
|
||||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
|
|||||||
@ -42,7 +42,6 @@ if ($user->societe_id > 0)
|
|||||||
$sall=GETPOST('sall','alpha');
|
$sall=GETPOST('sall','alpha');
|
||||||
$search_user=GETPOST('search_user','alpha');
|
$search_user=GETPOST('search_user','alpha');
|
||||||
$search_statut=GETPOST('search_statut','alpha');
|
$search_statut=GETPOST('search_statut','alpha');
|
||||||
if ($search_statut=='') $search_statut=1; // always display activ customer first
|
|
||||||
|
|
||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
$sortorder = GETPOST('sortorder','alpha');
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
@ -82,14 +81,14 @@ if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf
|
|||||||
}
|
}
|
||||||
else
|
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($socid)) $sql.= " AND u.fk_societe = ".$socid;
|
||||||
if (! empty($search_user))
|
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)."%')";
|
$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.")";
|
$sql.= " AND (u.statut=".$search_statut.")";
|
||||||
}
|
}
|
||||||
@ -104,7 +103,9 @@ if ($result)
|
|||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
|
||||||
$param="search_user=$search_user&sall=$sall";
|
$param="search_user=".$search_user."&sall=".$sall;
|
||||||
|
$param.="&search_statut=".$search_statut;
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Login"),"index.php","u.login",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Login"),"index.php","u.login",$param,"","",$sortfield,$sortorder);
|
||||||
@ -121,8 +122,9 @@ if ($result)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="6"> </td>';
|
print '<td colspan="6"> </td>';
|
||||||
|
|
||||||
|
// Status
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->selectarray('search_statut', array('0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user