Merge remote-tracking branch 'origin/3.5' into develop

Conflicts:
	htdocs/core/class/html.formfile.class.php
This commit is contained in:
Laurent Destailleur 2014-06-06 12:00:21 +02:00
commit 171227e43a
9 changed files with 72 additions and 46 deletions

View File

@ -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.

View File

@ -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.= "<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
$out.= '<td class="nowrap">';
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$out.= '<a data-ajax="false" href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= ' target="_blank">';

View File

@ -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
}
}

View File

@ -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

View File

@ -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++;
}
}

View File

@ -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 '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
if ($object->admin && ! $object->entity)
{
print $langs->trans("AllEntities");
}
else
{
$mc->getInfo($object->entity);
print $mc->label;
}
print "</td></tr>\n";
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
print '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
if ($object->admin && ! $object->entity)
{
print $langs->trans("AllEntities");
}
else
{
$mc->getInfo($object->entity);
print $mc->label;
}
print "</td></tr>\n";
}
}
// Other attributes

View File

@ -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'],

View File

@ -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 '</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';
print '<td align="right">';

View File

@ -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 '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
$param="search_user=$search_user&amp;sall=$sall";
$param="search_user=".$search_user."&sall=".$sall;
$param.="&search_statut=".$search_statut;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Login"),"index.php","u.login",$param,"","",$sortfield,$sortorder);
@ -116,19 +117,20 @@ if ($result)
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="center"',$sortfield,$sortorder);
print '<td width="1%">&nbsp;</td>';
print "</tr>\n";
//SearchBar
print '<tr class="liste_titre">';
print '<td colspan="6">&nbsp;</td>';
// Status
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 class="liste_titre" align="right">';
print '<input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
print "</tr>\n";
$var=True;
while ($i < $num)