diff --git a/.travis.yml b/.travis.yml
index 26d4c64fef25b..a4f8ecd827075 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -56,7 +56,7 @@ before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo ' htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
@@ -80,10 +80,18 @@ before_script:
- sudo /etc/init.d/apache2 restart
- wget http://localhost/
- cat index.html
-
+
script:
+ - cd htdocs/install
+ - php upgrade.php 3.4.0 3.5.0 > upgrade.log
+ - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
+ - php upgrade.php 3.5.0 3.6.0 >> upgrade.log
+ - php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
+ - cd ../..
+# - cat upgrade.log
+# - cat upgrade2.log
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php
diff --git a/ChangeLog b/ChangeLog
index 27ce4abbbcf6d..cb6495b4196b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,11 +9,13 @@ For users:
- New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you
use the "print" view on screen.
- New: Add menu entry to barcode genration page.
-- New: Add option MAIN_AUTO_TIMESTAMP_IN_NOTES to automatically add timestamp
- and user line into editionf field when editing a note.
+- New: Add option MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES and MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES
+ to automatically add timestamp and user line into editionf field when editing a note.
- New: Add button cancel into edition of notes.
- New: Improved Opensurvey module and added options to disable comments and disable
public votes
+- New: The box "balance of bank accounts" show all opened accounts.
+- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE.
For translators:
- Update language files.
@@ -170,6 +172,18 @@ parameter. All methods addline in this case were modified to remove this paramet
***** ChangeLog for 3.4.3 compared to 3.4.2 *****
Fix: Bad get of localtaxes into contracts add lines
+***** ChangeLog for 3.4.3 compared to 3.4.2 *****
+Fix: Warning into bank conciliation feature.
+Fix: Bad get of localtaxes into contracts add lines.
+Fix: Add a limit into list to avoid browser to hang when database is too large.
+Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
+
+***** ChangeLog for 3.4.3 compared to 3.4.2 *****
+Fix: Warning into bank conciliation feature.
+Fix: Bad get of localtaxes into contracts add lines.
+Fix: Add a limit into list to avoid browser to hang when database is too large.
+Fix: [ bug #1212 ] 'jqueryFileTree.php' directory traversal vulnerability
+
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB).
Fix: Document cerfa doesn't contained firstname & lastname from donator.
diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl
old mode 100644
new mode 100755
diff --git a/build/doxygen/dolibarr-doxygen-filter.pl b/build/doxygen/dolibarr-doxygen-filter.pl
old mode 100644
new mode 100755
diff --git a/build/doxygen/dolibarr-doxygen-getversion.pl b/build/doxygen/dolibarr-doxygen-getversion.pl
old mode 100644
new mode 100755
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 3f7f4767d4f78..2bf2e1a5c991b 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -54,3 +54,9 @@ window.location.href=pRef
JCROP:
------
* Remove analytics tag into file index.html
+
+
+JQUERYFILETREE:
+---------------
+* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
+
diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php
index d4beb3ecdd97f..a4b9bdb7a5a2f 100644
--- a/htdocs/adherents/liste.php
+++ b/htdocs/adherents/liste.php
@@ -256,9 +256,9 @@
print '
';
print "\n";
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 7e31518d4024c..2ed0f5e5dadd7 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -49,7 +49,7 @@
/* Actions */
/******************************************************************************/
-$permission=$user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote=$user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php
index 18038d3ed44f3..767a29f0b88ad 100644
--- a/htdocs/comm/prospect/list.php
+++ b/htdocs/comm/prospect/list.php
@@ -378,7 +378,7 @@
// Print the search button
print '
";
print "\n";
print '';
diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php
index 9b80ffefb7400..17fd2a63fed6b 100644
--- a/htdocs/core/boxes/box_comptes.php
+++ b/htdocs/core/boxes/box_comptes.php
@@ -85,7 +85,7 @@ function loadBox($max=5)
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
- $sql.= " AND courant = 1";
+ //$sql.= " AND courant = 1";
$sql.= " ORDER BY label";
$sql.= $db->plimit($max, 0);
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 86d924b5fa29e..ee5ab2cbae9ef 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -170,7 +170,8 @@ function get_substitutionarray_thirdparty($object,$outputlangs)
'company_idprof4'=>$object->idprof4,
'company_idprof5'=>$object->idprof5,
'company_idprof6'=>$object->idprof6,
- 'company_note'=>$object->note
+ 'company_note_public'=>$object->note_public,
+ 'company_note_private'=>$object->note_private
);
// Retrieve extrafields
@@ -260,7 +261,7 @@ function get_substitutionarray_propal($object,$outputlangs,$array_key='object')
$array_key.'_total_localtax2'=>price2num($object->total_localtax2),
$array_key.'_total_ttc'=>price2num($object->total_ttc),
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
-
+
$array_key.'_vatrate'=>vatrate($object->tva),
$array_key.'_note_private'=>$object->note,
$array_key.'_note'=>$object->note_public,
@@ -314,7 +315,7 @@ function get_substitutionarray_propal_lines($line,$outputlangs)
'line_date_end'=>$line->date_end
);
}
-
+
/**
* Define array with couple substitution key => substitution value
*
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 9c0968436d3e4..172d65b4ca6b0 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -796,7 +796,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
{
print '
';
$tmp=explode('.',$file['name']);
- $minifile=$tmp[0].'_mini.'.$tmp[1];
+ $minifile=$tmp[0].'_mini.'.strtolower($tmp[1]); // Thumbs are created with filename in lower case
if (image_format_supported($file['name']) > 0) print '';
else print ' ';
print '
';
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 3eb92fb26a3c2..3cfb0adeb7d51 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -557,7 +557,13 @@ function listOfSessions()
global $conf;
$arrayofSessions = array();
- $sessPath = ini_get("session.save_path").'/';
+ // session.save_path can be returned empty so we set a default location and work from there
+ $sessPath = '/tmp';
+ $iniPath = ini_get("session.save_path");
+ if ($iniPath) {
+ $sessPath = $iniPath;
+ }
+ $sessPath .= '/'; // We need the trailing slash
dol_syslog('admin.lib:listOfSessions sessPath='.$sessPath);
$dh = @opendir(dol_osencode($sessPath));
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 1437d5d99749b..5ea8f503ad8b6 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -631,7 +631,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
// Edit
print '
';
- print '';
+ print '';
print '
';
print "";
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 3df77ec722a1f..dd4ff4b6ed39d 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -538,13 +538,13 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
$newpathofdestfile=dol_osencode($destfile);
$result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
- if (! $result)
+ if (! $result)
{
- if ($destexists)
+ if ($destexists)
{
dol_syslog("files.lib.php::dol_move failed. We try to delete first and move after.", LOG_WARNING);
// We force delete and try again. Rename function sometimes fails to replace dest file with some windows NTFS partitions.
- dol_delete_file($destfile);
+ dol_delete_file($destfile);
$result=@rename($newpathofsrcfile, $newpathofdestfile); // To see errors, remove @
}
else dol_syslog("files.lib.php::dol_move failed", LOG_WARNING);
@@ -726,6 +726,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
$langs->load("other");
$langs->load("errors");
+ dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook);
+
if (empty($nohook))
{
$hookmanager->initHooks(array('fileslib'));
@@ -1301,7 +1303,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
if (empty($modulepart)) return 'ErrorBadParameter';
if (empty($entity)) $entity=0;
- dol_syslog('modulepart='.$modulepart.' original_file= '.$original_file);
+ dol_syslog('modulepart='.$modulepart.' original_file='.$original_file);
// We define $accessallowed and $sqlprotectagainstexternals
$accessallowed=0;
$sqlprotectagainstexternals='';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 906eb08dd8131..31e2a1344b40a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2406,8 +2406,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
// If field is used as sort criteria we use a specific class
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
- if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="liste_titre_sel'.($field?' nowrap':'').'" '. $moreattrib.'>';
- else $out.= '<'.$tag.' class="liste_titre'.($field?' nowrap':'').'" '. $moreattrib.'>';
+ if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="liste_titre_sel" '. $moreattrib.'>';
+ else $out.= '<'.$tag.' class="liste_titre" '. $moreattrib.'>';
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
{
@@ -2435,7 +2435,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
if (! preg_match('/^&/',$options)) $options='&'.$options;
//print " ";
- $out.= '';
+ $out.= '';
if (! $sortorder || $field != $sortfield)
{
@@ -2453,6 +2453,8 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
$out.= ''.img_up("Z-A",0).'';
}
}
+
+ $out.= '';
}
$out.=''.$tag.'>';
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index a954c68c9067a..a58a52aec6774 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -244,12 +244,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;
// Affiche notes
- if (! empty($object->note_public))
+ $notetoshow=empty($object->note_public)?'':$object->note_public;
+ if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
+ {
+ // Get first sale rep
+ if (is_object($object->thirdparty))
+ {
+ $salereparray=$object->thirdparty->getSalesRepresentatives($user);
+ $salerepobj=new User($this->db);
+ $salerepobj->fetch($salereparray[0]['id']);
+ if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
+ }
+ }
+ if ($notetoshow)
{
$tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
+ $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
index 35d7dd3f9fca6..9733b30ded67d 100644
--- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
@@ -244,12 +244,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;
// Affiche notes
- if (! empty($object->note_public))
+ $notetoshow=empty($object->note_public)?'':$object->note_public;
+ if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
+ {
+ // Get first sale rep
+ if (is_object($object->thirdparty))
+ {
+ $salereparray=$object->thirdparty->getSalesRepresentatives($user);
+ $salerepobj=new User($this->db);
+ $salerepobj->fetch($salereparray[0]['id']);
+ if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
+ }
+ }
+ if ($notetoshow)
{
$tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
+ $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 0f2ac346e695e..ebbe4727cfeea 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -245,12 +245,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;
// Affiche notes
- if (! empty($object->note_public))
+ $notetoshow=empty($object->note_public)?'':$object->note_public;
+ if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
+ {
+ // Get first sale rep
+ if (is_object($object->thirdparty))
+ {
+ $salereparray=$object->thirdparty->getSalesRepresentatives($user);
+ $salerepobj=new User($this->db);
+ $salerepobj->fetch($salereparray[0]['id']);
+ if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
+ }
+ }
+ if ($notetoshow)
{
$tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
+ $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
@@ -378,7 +390,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
$vatrate=(string) $object->lines[$i]->tva_tx;
-
+
// Retrieve type from database for backward compatibility with old records
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php
index d927af0c4a489..4e552d7cad7e1 100644
--- a/htdocs/core/modules/modAgenda.class.php
+++ b/htdocs/core/modules/modAgenda.class.php
@@ -23,15 +23,15 @@
/**
* \defgroup agenda Module agenda
- * \brief Module pour gerer l'agenda et actions
+ * \brief Module to manage agenda and events
* \file htdocs/core/modules/modAgenda.class.php
* \ingroup agenda
- * \brief Fichier de description et activation du module agenda
+ * \brief File of class to describe and enable/disable module Agenda
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
- * Classe de description et activation du module Adherent
+ * Class to describe and enable/disable module Agenda
*/
class modAgenda extends DolibarrModules
{
diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php
index 6743d415ff14f..9f643170588d4 100644
--- a/htdocs/core/modules/modOpenSurvey.class.php
+++ b/htdocs/core/modules/modOpenSurvey.class.php
@@ -17,11 +17,8 @@
*/
/**
- * \defgroup opensurvey Module OpenSurvey
+ * \defgroup opensurvey Module opensurvey
* \brief Module to OpenSurvey integration.
- */
-
-/**
* \file htdocs/core/modules/modOpenSurvey.class.php
* \ingroup opensurvey
* \brief Description and activation file for module OpenSurvey
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index 088c688a4fde3..43cab4f72cff6 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -5,6 +5,7 @@
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2012-2013 Juanjo Menent
+ * Copyright (C) 2014 Christophe Battarel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -140,12 +141,15 @@ function __construct($db)
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue'));
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
+ if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'SuppliersPrices'));
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Number",'p.surface'=>"Number",'p.volume'=>"Number",'p.weight'=>"Number",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Number",'p.price_ttc'=>"Number",'p.tva_tx'=>'Number','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.pmp'=>'Number'));
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
- $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
+ if (! empty($conf->fournisseur->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('s.nom'=>'Text','pf.ref_fourn'=>'Text','pf.unitprice'=>'Number'));
+ $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product'));
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
+ if (! empty($conf->fournisseur->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('s.nom'=>'product','pf.ref_fourn'=>'product','pf.unitprice'=>'product'));
// Add extra fields
$sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$resql=$this->db->query($sql);
@@ -184,6 +188,7 @@ function __construct($db)
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra ON p.rowid = extra.fk_object';
+ if (! empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity("product", 1).')';
diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php
index 6f7da0d3e73d0..6a009956b5b83 100644
--- a/htdocs/core/modules/modSkype.class.php
+++ b/htdocs/core/modules/modSkype.class.php
@@ -16,11 +16,11 @@
*/
/**
- * \defgroup Skype Module Skype
+ * \defgroup Skype Module skype
* \brief Add a skype button.
* \file htdocs/core/modules/modSkype.class.php
* \ingroup Skype
- * \brief Description and activation file for module Skype
+ * \brief Description and activation file for module skype
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index fbe3fb98bbfa8..700e558668ecc 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2004-2014 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2008 Raphael Bertrand
* Copyright (C) 2010-2013 Juanjo Menent
@@ -153,7 +153,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$outputlangs->load("products");
$nblignes = count($object->lines);
-
+
// Loop on each lines to detect if there is at least one image to show
$realpatharray=array();
if (! empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
@@ -161,7 +161,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
for ($i = 0 ; $i < $nblignes ; $i++)
{
if (empty($object->lines[$i]->fk_product)) continue;
-
+
$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
@@ -185,7 +185,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
if ($conf->propal->dir_output)
{
$object->fetch_thirdparty();
-
+
// $deja_regle = 0;
// Definition of $dir and $file
@@ -270,12 +270,24 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$tab_height_newpage = 150;
// Affiche notes
- if (! empty($object->note_public))
+ $notetoshow=empty($object->note_public)?'':$object->note_public;
+ if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
+ {
+ // Get first sale rep
+ if (is_object($object->thirdparty))
+ {
+ $salereparray=$object->thirdparty->getSalesRepresentatives($user);
+ $salerepobj=new User($this->db);
+ $salerepobj->fetch($salereparray[0]['id']);
+ if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
+ }
+ }
+ if ($notetoshow)
{
$tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1);
- $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
+ $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index ccc3ed8c17b74..34c031734f1a7 100644
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -166,8 +166,10 @@ function write_file($object, $outputlangs='', $srctemplatepath='', $hidedetails=
else
{
$objectref = dol_sanitizeFileName($object->ref);
+ $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier);
$dir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$objectref;
$file = $dir . "/" . $objectref . ".pdf";
+ if (! empty($conf->global->SUPPLIER_REF_IN_NAME)) $file = $dir . "/" . $objectref . ($objectrefsupplier?"_".$objectrefsupplier:"").".pdf";
}
if (! file_exists($dir))
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index efa93e17aecda..0b580a41de87d 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -174,8 +174,10 @@ function write_file($object,$outputlangs='',$srctemplatepath='',$hidedetails=0,$
else
{
$objectref = dol_sanitizeFileName($object->ref);
+ $objectrefsupplier = dol_sanitizeFileName($object->ref_supplier);
$dir = $conf->fournisseur->commande->dir_output . '/'. $objectref;
$file = $dir . "/" . $objectref . ".pdf";
+ if (! empty($conf->global->SUPPLIER_REF_IN_NAME)) $file = $dir . "/" . $objectref . ($objectrefsupplier?"_".$objectrefsupplier:"").".pdf";
}
if (! file_exists($dir))
diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
index 06edca3c7c7c5..7bfc59641407b 100644
--- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
@@ -41,12 +41,17 @@
{
if ($object->id)
{
- $urlfile = GETPOST('urlfile', 'alpha');
- $linkid = GETPOST('linkid', 'int');
+ $urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
+ if (GETPOST('section')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
+ else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
+ {
+ $urlfile=basename($urlfile);
+ $file = $upload_dir . "/" . $urlfile;
+ }
+ $linkid = GETPOST('linkid', 'int'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
+
if ($urlfile)
{
- $file = $upload_dir . "/" . $urlfile; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
-
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessage($langs->trans("FileWasRemoved", $urlfile));
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index fa3d21b92015a..731084c09260a 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -25,7 +25,7 @@
if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
-$arrayofjs=array('/core/js/dst.js'); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
+$arrayofjs=array('/core/js/dst.js'.(empty($conf->dol_use_jmobile)?'':'?version='.urlencode(DOL_VERSION))); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
$titleofloginpage=$langs->trans('Login').' '.$title; // title is defined by dol_loginfunction in security2.lib.php
print top_htmlhead('',$titleofloginpage,0,0,$arrayofjs);
?>
@@ -33,12 +33,14 @@
+dol_use_jmobile)) { ?>
+
';
print "\n";
diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.asp b/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.asp
deleted file mode 100755
index 41eb5b4d5b779..0000000000000
--- a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.asp
+++ /dev/null
@@ -1,44 +0,0 @@
-<%
-'
-' jQuery File Tree ASP (VBS) Connector
-' Copyright 2008 Chazzuka
-' programmer@chazzuka.com
-' http://www.chazzuka.com/
-'
-' retrive base directory
-dim BaseFileDir:BaseFileDir=Request.Form("dir")
-' if blank give default value
-if len(BaseFileDir)=0 then BaseFileDir="/userfiles/"
-
-dim ObjFSO,BaseFile,Html
-' resolve the absolute path
-BaseFile = Server.MapPath(BaseFileDir)&"\"
-' create FSO
-Set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
-' if given folder is exists
-if ObjFSO.FolderExists(BaseFile) then
- dim ObjFolder,ObjSubFolder,ObjFile,i__Name,i__Ext
- Html = Html + "
"&VBCRLF
- Set ObjFolder = ObjFSO.GetFolder(BaseFile)
- ' LOOP THROUGH SUBFOLDER
- For Each ObjSubFolder In ObjFolder.SubFolders
- i__Name=ObjSubFolder.name
- Html = Html + "
"&VBCRLF
- Next
- 'LOOP THROUGH FILES
- For Each ObjFile In ObjFolder.Files
- ' name
- i__Name=ObjFile.name
- ' extension
- i__Ext = LCase(Mid(i__Name, InStrRev(i__Name, ".", -1, 1) + 1))
- Html = Html + "
')
- return HttpResponse(''.join(r))
\ No newline at end of file
diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.rb b/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.rb
deleted file mode 100755
index b30b8a976a2ff..0000000000000
--- a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# jQuery File Tree Ruby Connector
-#
-# Version 1.01
-#
-# Erik Lax
-# http://datahack.se
-# 13 July 2008
-#
-# History
-#
-# 1.01 Initial Release
-#
-# Output a list of files for jQuery File Tree
-#
-
-#
-#root = "/absolute/path/"
-# or
-root = File.expand_path(".")
-#
-
-#
-require "cgi"
-cgi = CGI.new
-cgi.header("type" => "text/html")
-dir = cgi.params["dir"].to_s
-
-puts "
"
-begin
- path = root + "/" + dir
-
- # chdir() to user requested dir (root + "/" + dir)
- Dir.chdir(File.expand_path(path).untaint);
-
- # check that our base path still begins with root path
- if Dir.pwd[0,root.length] == root then
-
- #loop through all directories
- Dir.glob("*") {
- |x|
- if not File.directory?(x.untaint) then next end
- puts "
"
- }
- else
- #only happens when someone tries to go outside your root directory...
- puts "You are way out of your league"
- end
-rescue
- puts "Internal Error"
-end
-puts "
"
-#
diff --git a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree_huck.lasso b/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree_huck.lasso
deleted file mode 100755
index 3359e29314f1f..0000000000000
--- a/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree_huck.lasso
+++ /dev/null
@@ -1,36 +0,0 @@
-[
- //
- // jQuery File Tree Lasso Connector
- //
- // Version 1.00
- //
- // Jason Huck
- // http://devblog.jasonhuck.com/
- // 1 May 2008
- //
- // History:
- //
- // 1.00 - released (1 May 2008)
- //
- // Output a list of files for jQuery File Tree
- //
-
- !action_param('dir') ? abort;
- var('dir') = action_param('dir');
- var('files') = file_listdirectory($dir);
-
- '
';
- /if;
-/if;
-
-/Encode_set;
-?>
\ No newline at end of file
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index 904144cad66c4..de0a8fe28a1b1 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -15,6 +15,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ *
+ * Upgrade scripts can be ran from command line with syntax:
+ *
+ * cd htdocs/install
+ * php upgrade.php 3.4.0 3.5.0
+ * php upgrade2.php 3.4.0 3.5.0
+ *
+ * Return code is 0 if OK, >0 if error
*/
/**
@@ -260,6 +268,7 @@
}
}
+
/*
* Remove deprecated indexes and constraints for Mysql
*/
@@ -343,12 +352,12 @@
{
while (($file = readdir($handle))!==false)
{
- if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file;
+ if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file;
}
sort($filesindir);
}
else
- {
+ {
print '
'.$langs->trans("ErrorCanNotReadDir",$dir).'
';
}
@@ -365,47 +374,54 @@
}
}
- // Loop on each migrate files
- foreach($filelist as $file)
+ if (count($filelist) == 0)
{
- print '
';
- print '
'.$langs->trans("ChoosedMigrateScript").'
'.$file.'
'."\n";
-
- // Run sql script
- $ok=run_sql($dir.$file, 0, '', 1);
-
- // Scan if there is migration scripts for modules htdocs/module/sql or htdocs/custom/module/sql
- $modulesfile = array();
- foreach ($conf->file->dol_document_root as $type => $dirroot)
- {
- $handlemodule=@opendir($dirroot); // $dirroot may be '..'
- if (is_resource($handlemodule))
- {
- while (($filemodule = readdir($handlemodule))!==false)
- {
- if (! preg_match('/\./',$filemodule) && is_dir($dirroot.'/'.$filemodule.'/sql')) // We exclude filemodule that contains . (are not directories) and are not directories.
- {
- //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file;
- if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file))
- {
- $modulesfile[$dirroot . '/' . $filemodule . '/sql/'.$file] = '/' . $filemodule . '/sql/'.$file;
- }
- }
- }
- closedir($handlemodule);
- }
- }
-
- foreach ($modulesfile as $modulefilelong => $modulefileshort)
- {
- print '
'."\n";
+
+ // Run sql script
+ $okmodule=run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not.
+ }
+
+ }
+ }
}
print '';
@@ -413,7 +429,6 @@
if ($db->connected) $db->close();
}
-
if (empty($actiondone))
{
print '
'.$langs->trans("ErrorWrongParameters").'
';
@@ -429,4 +444,4 @@
// Return code if ran from command line
if ($ret) exit($ret);
-?>
\ No newline at end of file
+?>
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 78c223a98072b..593ae33ebcc22 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -16,6 +16,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
+ *
+ * Upgrade scripts can be ran from command line with syntax:
+ *
+ * cd htdocs/install
+ * php upgrade.php 3.4.0 3.5.0
+ * php upgrade2.php 3.4.0 3.5.0
+ *
+ * Return code is 0 if OK, >0 if error
*/
/**
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index e4de38e621e43..88ac8d90d5ee1 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -28,6 +28,7 @@ EndBankBalance=End balance
CurrentBalance=Current balance
FutureBalance=Future balance
ShowAllTimeBalance=Show balance from start
+AllTime=From start
Reconciliation=Reconciliation
RIB=Bank Account Number
IBAN=IBAN number
diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang
index aceee7db3a0c1..e7e9da7dc1b80 100644
--- a/htdocs/langs/en_US/boxes.lang
+++ b/htdocs/langs/en_US/boxes.lang
@@ -18,7 +18,7 @@ BoxLastContracts=Last contracts
BoxLastContacts=Last contacts/addresses
BoxLastMembers=Last members
BoxFicheInter=Last interventions
-BoxCurrentAccounts=Current accounts balance
+BoxCurrentAccounts=Opened accounts balance
BoxSalesTurnover=Sales turnover
BoxTotalUnpaidCustomerBills=Total unpaid customer's invoices
BoxTotalUnpaidSuppliersBills=Total unpaid supplier's invoices
@@ -43,7 +43,7 @@ BoxTitleLastModifiedMembers=Last %s modified members
BoxTitleLastFicheInter=Last %s modified intervention
BoxTitleOldestUnpaidCustomerBills=Oldest %s unpaid customer's invoices
BoxTitleOldestUnpaidSupplierBills=Oldest %s unpaid supplier's invoices
-BoxTitleCurrentAccounts=Current account's balances
+BoxTitleCurrentAccounts=Opened account's balances
BoxTitleSalesTurnover=Sales turnover
BoxTitleTotalUnpaidCustomerBills=Unpaid customer's invoices
BoxTitleTotalUnpaidSuppliersBills=Unpaid supplier's invoices
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 4465b660cf6ce..d889dedc9d654 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -666,6 +666,8 @@ SaveUploadedFileWithMask=Save file on server with name "%s" (ot
OriginFileName=Original filename
SetDemandReason=Set source
ViewPrivateNote=View notes
+XMoreLines=%s line(s) hidden
+
# Week day
Monday=Monday
Tuesday=Tuesday
diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang
index 314faf964bc13..bef2dea85fea7 100644
--- a/htdocs/langs/fr_FR/boxes.lang
+++ b/htdocs/langs/fr_FR/boxes.lang
@@ -18,7 +18,7 @@ BoxLastContracts=Derniers contrats
BoxLastContacts=Derniers contacts/adresses
BoxLastMembers=Derniers adhérents modifiés
BoxFicheInter=Dernières fiches d'intervention modifiées
-BoxCurrentAccounts=Soldes des comptes courants
+BoxCurrentAccounts=Soldes des comptes ouverts
BoxSalesTurnover=Chiffre d'affaires
BoxTotalUnpaidCustomerBills=Total des factures clients impayées
BoxTotalUnpaidSuppliersBills=Total des factures fournisseurs impayées
@@ -43,7 +43,7 @@ BoxTitleLastModifiedMembers=Les %s derniers adhérents modifiés
BoxTitleLastFicheInter=Les %s dernières fiches d'intervention modifiées
BoxTitleOldestUnpaidCustomerBills=Les %s plus anciennes factures clients impayées
BoxTitleOldestUnpaidSupplierBills=Les %s plus anciennes factures fournisseurs impayées
-BoxTitleCurrentAccounts=Les soldes des comptes courants
+BoxTitleCurrentAccounts=Les soldes des comptes ouverts
BoxTitleSalesTurnover=Le chiffre d'affaires réalisé
BoxTitleTotalUnpaidCustomerBills=Impayés clients
BoxTitleTotalUnpaidSuppliersBills=Impayés fournisseurs
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index de40bc94593e4..f0b01bef578f2 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -666,6 +666,7 @@ SaveUploadedFileWithMask=Sauver le fichier sur le serveur sous le nom "%
OriginFileName=nom du fichier source
SetDemandReason=Définir l'origine
ViewPrivateNote=Voir notes
+XMoreLines=%s ligne(s) non affichée(s)
# Week day
Monday=Lundi
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 69265f73b675d..60564d383c732 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -972,41 +972,44 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
else print "".dol_htmlentities($appli)."";
print "\n";
+ $ext='';
+ if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
+
if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax)
{
print ''."\n";
$jquerytheme = 'smoothness';
if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
- if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery
- else print ''."\n"; // JQuery
- print ''."\n"; // Tooltip
- print ''."\n"; // JNotify
+ if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery
+ else print ''."\n"; // JQuery
+ print ''."\n"; // Tooltip
+ print ''."\n"; // JNotify
/*if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) // jQuery fileupload
{
- print ''."\n";
+ print ''."\n";
}*/
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) // jQuery datatables
{
- //print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- //print ''."\n";
- print ''."\n";
+ //print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ //print ''."\n";
+ print ''."\n";
}
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT'))) // jQuery multiselect
{
- print ''."\n";
+ print ''."\n";
}
// jQuery Timepicker
if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
{
- print ''."\n";
+ print ''."\n";
}
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
{
- print ''."\n";
+ print ''."\n";
}
}
@@ -1029,6 +1032,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
}
}
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'&userid='.$user->id.'&entity='.$conf->entity;
+ $themeparam.=($ext?'&'.$ext:'');
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
if (GETPOST('dol_hide_topmenu')) { $themeparam.='&dol_hide_topmenu='.GETPOST('dol_hide_topmenu'); }
if (GETPOST('dol_hide_leftmenu')) { $themeparam.='&dol_hide_leftmenu='.GETPOST('dol_hide_leftmenu'); }
@@ -1068,63 +1072,61 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
}
}
- $ext='.js';
-
// Output standard javascript links
if (! defined('DISABLE_JQUERY') && ! $disablejs && ! empty($conf->use_javascript_ajax))
{
// JQuery. Must be before other includes
print ''."\n";
- if (constant('JS_JQUERY')) print ''."\n";
- else print ''."\n";
- if (constant('JS_JQUERY_UI')) print ''."\n";
- else print ''."\n";
- print ''."\n";
- print ''."\n";
+ if (constant('JS_JQUERY')) print ''."\n";
+ else print ''."\n";
+ if (constant('JS_JQUERY_UI')) print ''."\n";
+ else print ''."\n";
+ print ''."\n";
+ print ''."\n";
// jQuery Layout
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
{
- print ''."\n";
+ print ''."\n";
}
// jQuery jnotify
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY'))
{
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
// jQuery blockUI
if (! empty($conf->global->MAIN_USE_JQUERY_BLOCKUI) || defined('REQUIRE_JQUERY_BLOCKUI'))
{
- print ''."\n";
+ print ''."\n";
print ''."\n";
- print ''."\n";
+ print ''."\n";
}
// Flot
if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT))
{
if (constant('JS_JQUERY_FLOT'))
{
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
else
{
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
}
// jQuery jeditable
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE))
{
- print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
// jQuery File Upload
/*
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD')))
{
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
print ''."\n";
- print ''."\n";
+ print ''."\n";
}*/
// jQuery DataTables
if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES')))
{
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
// jQuery Multiselect
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT')))
{
- print ''."\n";
+ print ''."\n";
}
// jQuery Timepicker
if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
{
- print ''."\n";
- print ''."\n";
+ print ''."\n";
+ print ''."\n";
}
// jQuery jMobile
if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0))
@@ -1189,7 +1191,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
});
';
}
- if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n";
+ if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 3) print ''."\n";
}
}
@@ -1207,15 +1209,15 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print ''."\n";
- print ''."\n";
+ print ''."\n";
}
// Global js function
print ''."\n";
- print ''."\n";
+ print ''."\n";
// Add datepicker default options
- print ''."\n";
+ print ''."\n";
// JS forced by modules (relative url starting with /)
if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
@@ -1423,11 +1425,20 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
if (! empty($_SESSION["disablemodules"])) $loginhtmltext.=' '.$langs->trans("DisabledModules").': '.join(', ',explode(',',$_SESSION["disablemodules"]));
$appli='Dolibarr';
- if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE))
+ {
+ $appli=$conf->global->MAIN_APPLICATION_TITLE;
+ if (preg_match('/\d\.\d/', $appli))
+ {
+ if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core
+ }
+ else $appli.=" ".DOL_VERSION;
+ }
+ else $appli.=" ".DOL_VERSION;
// Link info
$logouttext='';
- $logouthtmltext=$appli.' '.DOL_VERSION.' ';
+ $logouthtmltext=$appli.' ';
$logouthtmltext.=$langs->trans("Logout").' ';
//$logouthtmltext.=" ";
if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http')
@@ -1621,10 +1632,16 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es';
$appli='Dolibarr';
- if (! empty($conf->global->MAIN_APPLICATION_TITLE)) {
+ if (! empty($conf->global->MAIN_APPLICATION_TITLE))
+ {
$appli=$conf->global->MAIN_APPLICATION_TITLE; $doliurl='';
+ if (preg_match('/\d\.\d/', $appli))
+ {
+ if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core
+ }
+ else $appli.=" ".DOL_VERSION;
}
- $appli.=" ".DOL_VERSION;
+ else $appli.=" ".DOL_VERSION;
print '
';
print "\n";
// Show all lines in taskarray (recursive function to go down on tree)
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 301629dd17a1a..f29c290548f7b 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -270,8 +270,8 @@
print '';
print '';
print '