diff --git a/ChangeLog b/ChangeLog index 2da9d45364dec1d21028c6e466ee32e3548356b7..6e81703b33a2e937392486950e4c32c096eb613b 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 99a89ff0d1e0138a1040c47c03f5edd3b70bec09..e71e9c8541a01387ea9d482b06c40a0d6dadd90d 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 29e4c96b6c3295a2a136518d80bee5f65c0afada..e449d265fa3642b62614dd624083781fae8ab31d 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 1933bfe4f7cf010f475f9d529e7cc9e87ce288f2..fbe6a01bded43fe2c5dea304728a230b55a19632 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 ' -<script type="text/javascript" language="javascript"> -jQuery(document).ready(function() { - jQuery("#linktoorder").click(function() { - jQuery("#commande").toggle(); - }); -}); -</script> -'; + /********************************************************************* @@ -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 '<br><a href="#" id="linktoorder">'.$langs->trans('LinkedOrder').'</a>'; + print '<br><a href="#" id="linktoorder">' . $langs->trans('LinkedOrder') . '</a>'; + + print ' + <script type="text/javascript" language="javascript"> + jQuery(document).ready(function() { + jQuery("#linktoorder").click(function() { + jQuery("#commande").toggle(); + }); + }); + </script> + '; print '<div id="commande" style="display:none">'; $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 6eda2558dafb5192b4e9d6f41e2d9015fa6dc7cd..7da3e5aaf7e75c25344420987d190e8dba3a7567 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 40248cd65960031118f46db294ca18e7fb463d93..cc7ede21ea950e1087623f3fe7bcadb9960a019b 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 ba12febd3d4e57da29ce1719e6312e0f538f9c66..7fba7f50247039f7750742de9e5c7455c2fad729 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 59dbc487f748f6e44709358c5f7082b085efdc0b..52ad1a7f3235711f1b61e9d623452ee569c6bd57 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 7ceb6a8438cd556d136ce00c586e1a15dcb5a813..d42262ffe4f784d8e5df7b1e830d26f2162eeeb5 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 c6ad2b82604322480f360754b51e814ff1b067b8..57b1ecc695edc1a4e07bca0a49aad19f9e1f5e35 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 edc633a7fc84d94abe8ff91825ba77914e6abb23..62bbf9ae642ec971f9ecb2590e3faa170b7d9e9d 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 '<br>'; 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 fad70d5bd2e47fb33d11b013e25f4d60d739502b..0e2e58f73e886a17ea1cb69df3565a26ef81d982 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1423,7 +1423,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) { @@ -1497,7 +1497,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++; @@ -1507,9 +1507,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>'; } @@ -1588,12 +1588,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>'; @@ -1937,7 +1937,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 /* diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php index ab59c7689a44fff4b4b57927244ad1877fae4f5d..81cfc21f0677488c5d386655ff79aa6a2df32e4b 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 c4e9b87ff4418303b3c6a2e0518bff3f1c0d4663..309d6f87e464808bc50d64145bfd41f3c0743e5a 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(<?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 { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 74902878c637f814a4cc1833f528c6d8a9f13ed4..df4128ba747b7bde4caea64c90d05e68a2486dcd 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]; }