diff --git a/ChangeLog b/ChangeLog
index 2da9d45364d..6e81703b33a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@ Fix: Update impayees.php
Fix: Link product, In list view and label product
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
Fix: When disabled, all fields to add time into task line must be disabled.
+Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index 99a89ff0d1e..e71e9c8541a 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -328,6 +328,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
{
if (GETPOST('deletephoto'))
{
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/'.$object->photo;
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/thumbs';
dol_delete_file($fileimg);
diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php
index 29e4c96b6c3..e449d265fa3 100644
--- a/htdocs/admin/tools/update.php
+++ b/htdocs/admin/tools/update.php
@@ -23,7 +23,7 @@
*/
require '../../main.inc.php';
-include_once $dolibarr_main_document_root.'/core/lib/files.lib.php';
+include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("other");
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 1933bfe4f7c..fbe6a01bded 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2006,15 +2006,7 @@ $now=dol_now();
llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
-print '
-
-';
+
/*********************************************************************
@@ -3812,16 +3804,26 @@ else if ($id > 0 || ! empty($ref))
// Linked object block
$somethingshown=$object->showLinkedObjectBlock();
- if (empty($somethingshown) && $object->statut > 0)
+ if (empty($somethingshown) && ! empty($conf->commande->enabled))
{
- print '
'.$langs->trans('LinkedOrder').'';
+ print '
' . $langs->trans('LinkedOrder') . '';
+
+ print '
+
+ ';
print '
';
$sql = "SELECT s.rowid as socid, s.nom as name, s.client, c.rowid, c.ref, c.ref_client, c.total_ht";
- $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
- $sql.= ", ".MAIN_DB_PREFIX."commande as c";
- $sql.= ' WHERE c.fk_soc = '.$soc->id.'';
+ $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
+ $sql .= ", " . MAIN_DB_PREFIX . "commande as c";
+ $sql .= ' WHERE c.fk_soc = s.rowid AND c.fk_soc = ' . $soc->id . '';
$resqlorderlist = $db->query($sql);
if ($resqlorderlist)
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 6eda2558daf..7da3e5aaf7e 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -811,6 +811,7 @@ class Contrat extends CommonObject
function delete($user)
{
global $conf, $langs;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 40248cd6596..cc7ede21ea9 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -427,7 +427,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);
@@ -795,7 +795,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;
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index ba12febd3d4..7fba7f50247 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -446,9 +446,9 @@ if (! defined('NOLOGIN'))
$dol_authmode=$conf->authmode; // This properties is defined only when logged, to say what mode was successfully used
$dol_tz=$_POST["tz"];
$dol_tz_string=$_POST["tz_string"];
- $dol_tz_string=preg_replace('\s*\(.+\)$','',$dol_tz_string);
- $dol_tz_string=preg_replace(',','/',$dol_tz_string);
- $dol_tz_string=preg_replace('\s','_',$dol_tz_string);
+ $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string);
+ $dol_tz_string=preg_replace('/,/','/',$dol_tz_string);
+ $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string);
$dol_dst=0;
if (isset($_POST["dst_first"]) && isset($_POST["dst_second"]))
{
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 59dbc487f74..52ad1a7f323 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -594,6 +594,7 @@ class Product extends CommonObject
function delete($id=0)
{
global $conf,$user,$langs;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 7ceb6a8438c..d42262ffe4f 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -204,9 +204,9 @@ class Project extends CommonObject
$sql.= ", fk_soc = " . ($this->socid > 0 ? $this->socid : "null");
$sql.= ", fk_statut = " . $this->statut;
$sql.= ", public = " . ($this->public ? 1 : 0);
- $sql.= ", datec=" . ($this->date_c != '' ? $this->db->idate($this->date_c) : 'null');
- $sql.= ", dateo=" . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null');
- $sql.= ", datee=" . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null');
+ $sql.= ", datec=" . ($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null');
+ $sql.= ", dateo=" . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null');
+ $sql.= ", datee=" . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
$sql.= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this)."::Update sql=" . $sql, LOG_DEBUG);
@@ -263,6 +263,7 @@ class Project extends CommonObject
else
{
$this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR);
$result = -2;
}
@@ -513,10 +514,9 @@ class Project extends CommonObject
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields";
$sql.= " WHERE fk_object=" . $this->id;
-
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
- if (!$resql)
+ if (! $resql)
{
$this->errors[] = $this->db->lasterror();
$error++;
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index c6ad2b82604..57b1ecc695e 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -354,6 +354,7 @@ class Task extends CommonObject
{
global $conf, $langs;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index edc633a7fc8..62bbf9ae642 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -209,13 +209,13 @@ foreach ($listofreferent as $key => $value)
$classname=$value['class'];
$tablename=$value['table'];
$qualified=$value['test'];
-
+
if ($qualified)
{
print '
';
print_titre($langs->trans($title));
-
+
$selectList=$formproject->select_element($tablename,$project->societe->id);
if (!$selectList || ($selectList<0)) {
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index fad70d5bd2e..0e2e58f73e8 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1423,7 +1423,7 @@ else
print '
';
print '| '.$langs->trans("Logo").' | ';
print '';
- if ($object->logo) print $form->showphoto('societe',$object,50);
+ if ($object->logo) print $form->showphoto('societe',$object);
$caneditfield=1;
if ($caneditfield)
{
@@ -1497,7 +1497,7 @@ else
print ' |
';
// 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++;
@@ -1507,9 +1507,9 @@ else
if ($showlogo || $showbarcode)
{
$htmllogobar.='
';
- if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object,50);
+ if ($showlogo) $htmllogobar.=$form->showphoto('societe',$object);
if ($showlogo && $showbarcode) $htmllogobar.='
';
- if ($showbarcode) $htmllogobar.=$form->showbarcode($object,50);
+ if ($showbarcode) $htmllogobar.=$form->showbarcode($object);
$htmllogobar.=' | ';
}
@@ -1588,12 +1588,12 @@ else
if (empty($conf->global->SOCIETE_DISABLE_STATE)) print '
| '.$langs->trans('State').' | '.$object->state.' | ';
// EMail
- print '
| '.$langs->trans('EMail').' | ';
+ print ' |
| '.$langs->trans('EMail').' | ';
print dol_print_email($object->email,0,$object->id,'AC_EMAIL');
print ' |
';
// Web
- print '
| '.$langs->trans('Web').' | ';
+ print ' |
| '.$langs->trans('Web').' | ';
print dol_print_url($object->url);
print ' |
';
@@ -1937,7 +1937,6 @@ else
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{
print '
';
- //print '
| ';
print ''; // ancre
/*
diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php
index ab59c7689a4..81cfc21f067 100644
--- a/htdocs/theme/eldy/graph-color.php
+++ b/htdocs/theme/eldy/graph-color.php
@@ -28,7 +28,7 @@
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
$theme_bordercolor = array(235,235,224);
-$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170));
+$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170), array(190,170,190), array(170,190,190), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150));
$theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4'));
$theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC'));
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index c4e9b87ff44..309d6f87e46 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -681,7 +681,7 @@ div.mainmenu.click2dial {
}
div.mainmenu.companies {
- background-image: url();
+ background-image: url();
}
div.mainmenu.commercial {
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 74902878c63..df4128ba747 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2192,8 +2192,8 @@ class User extends CommonObject
// Load array[child]=parent
$sql = "SELECT fk_user as id_parent, rowid as id_son";
$sql.= " FROM ".MAIN_DB_PREFIX."user";
- $sql.= " WHERE fk_user != 0";
- $sql.= " AND entity = ".$conf->entity;
+ $sql.= " WHERE fk_user <> 0";
+ $sql.= " AND entity IN (".getEntity('user',1).")";
dol_syslog(get_class($this)."::load_parentof sql=".$sql);
$resql = $this->db->query($sql);
@@ -2222,10 +2222,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;
@@ -2233,7 +2233,7 @@ class User extends CommonObject
// 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, u.entity"; // Distinct reduce pb with old tables with duplicates
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
@@ -2276,14 +2276,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'])
@@ -2322,13 +2322,13 @@ class User extends CommonObject
// Define fullpath and fullname
$this->users[$id_user]['fullpath'] = '_'.$id_user;
- $this->users[$id_user]['fullname'] = $this->users[$id_user]['label'];
+ $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]))
{
$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]]['label'].' >> '.$this->users[$id_user]['fullname'];
+ $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname'];
$i++; $cursor_user=$this->parentof[$cursor_user];
}
|