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

This commit is contained in:
Laurent Destailleur 2014-08-13 19:23:45 +02:00
commit 6c316d0cda
7 changed files with 24 additions and 25 deletions

View File

@ -340,7 +340,7 @@ if ($resql)
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
print img_picto($langs->trans("Late"),"warning");
if(!empty($objp->note_private))
{

View File

@ -172,11 +172,11 @@ if (strlen($search_phone))
}
if (strlen($search_phoneper))
{
$sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'";
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phoneper)."%'";
}
if (strlen($search_phonepro))
{
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'";
$sql .= " AND p.phone LIKE '%".$db->escape($search_phonepro)."%'";
}
if (strlen($search_phonemob))
{

View File

@ -430,7 +430,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
global $conf;
// Add a background image on document
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF))
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation beeing crazy and some content disappeared behin the image
{
$pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image
$pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height);
@ -798,7 +798,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($line) // Free text
{
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell($width, 3, $line, 0, $align, 0);
$pdf->MultiCell(0, 3, $line, 0, $align, 0);
$posy-=$freetextheight;
}

View File

@ -468,7 +468,7 @@ if (empty($action))
{
$sql .= ' AND p.rowid='.$db->escape($search_ref);
}
if (! empty($search_account))
if (! empty($search_account) && $search_account > 0)
{
$sql .= ' AND b.fk_account='.$db->escape($search_account);
}

View File

@ -1452,7 +1452,7 @@ else
print '<tr class="hideonsmartphone">';
print '<td>'.$langs->trans("Logo").'</td>';
print '<td colspan="3">';
if ($object->logo) print $form->showphoto('societe',$object,50);
if ($object->logo) print $form->showphoto('societe',$object);
$caneditfield=1;
if ($caneditfield)
{
@ -1527,7 +1527,7 @@ else
print '</tr>';
// Logo+barcode
$rowspan=4;
$rowspan=6;
if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++;
if (! empty($object->client)) $rowspan++;
if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++;
@ -1537,9 +1537,9 @@ else
if ($showlogo || $showbarcode)
{
$htmllogobar.='<td rowspan="'.$rowspan.'" style="text-align: center;" width="25%">';
if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object,50);
if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object);
if ($showlogo && $showbarcode) $htmllogobar.='<br><br>';
if ($showbarcode) $htmllogobar.=$form->showbarcode($object,50);
if ($showbarcode) $htmllogobar.=$form->showbarcode($object);
$htmllogobar.='</td>';
}
@ -1618,12 +1618,12 @@ else
if (empty($conf->global->SOCIETE_DISABLE_STATE)) print '<tr><td>'.$langs->trans('State').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">'.$object->state.'</td>';
// EMail
print '<tr><td>'.$langs->trans('EMail').'</td><td colspan="3">';
print '<tr><td>'.$langs->trans('EMail').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
print dol_print_email($object->email,0,$object->id,'AC_EMAIL');
print '</td></tr>';
// Web
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="3">';
print '<tr><td>'.$langs->trans('Web').'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
print dol_print_url($object->url);
print '</td></tr>';
@ -1972,7 +1972,6 @@ else
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{
print '<div class="fichecenter"><div class="fichethirdleft">';
//print '<table width="100%"><tr><td valign="top" width="50%">';
print '<a name="builddoc"></a>'; // ancre
/*

View File

@ -682,7 +682,7 @@ div.mainmenu.click2dial {
}
div.mainmenu.companies {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/members.png',1) ?>);
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/company.png',1) ?>);
}
div.mainmenu.commercial {

View File

@ -2226,10 +2226,10 @@ class User extends CommonObject
* fullname = nom avec chemin complet du user
* fullpath = chemin complet compose des id
*
* @param int $markafterid Removed all users including the leaf $markafterid in user tree.
* @return array Array of users. this->users and this->parentof are set.
* @param int $deleteafterid Removed all users including the leaf $deleteafterid (and all its child) in user tree.
* @return array Array of users. this->users and this->parentof are set.
*/
function get_full_tree($markafterid=0)
function get_full_tree($deleteafterid=0)
{
global $conf,$user;
@ -2280,14 +2280,14 @@ class User extends CommonObject
$this->build_path_from_id_user($key,0); // Process a branch from the root user key (this user has no parent)
}
// Exclude leaf including $markafterid from tree
if ($markafterid)
// Exclude leaf including $deleteafterid from tree
if ($deleteafterid)
{
//print "Look to discard user ".$markafterid."\n";
$keyfilter1='^'.$markafterid.'$';
$keyfilter2='_'.$markafterid.'$';
$keyfilter3='^'.$markafterid.'_';
$keyfilter4='_'.$markafterid.'_';
//print "Look to discard user ".$deleteafterid."\n";
$keyfilter1='^'.$deleteafterid.'$';
$keyfilter2='_'.$deleteafterid.'$';
$keyfilter3='^'.$deleteafterid.'_';
$keyfilter4='_'.$deleteafterid.'_';
foreach($this->users as $key => $val)
{
if (preg_match('/'.$keyfilter1.'/',$val['fullpath']) || preg_match('/'.$keyfilter2.'/',$val['fullpath'])
@ -2329,7 +2329,7 @@ class User extends CommonObject
$this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname'];
$i=0; $cursor_user=$id_user;
while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) // Loop on each parent, one after one
while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user]))
{
$this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath'];
$this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];