diff --git a/build/debian/apache/dolibarr.conf b/build/debian/apache/dolibarr.conf
index 95eaae21190..bdbb6e1b4c3 100644
--- a/build/debian/apache/dolibarr.conf
+++ b/build/debian/apache/dolibarr.conf
@@ -15,7 +15,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
# Require all granted
#
#
-# Order allow, deny
+# Order allow,deny
# Allow from all
#
#
@@ -27,7 +27,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
Require all granted
- Order allow, deny
+ Order allow,deny
Allow from all
diff --git a/htdocs/.gitignore b/htdocs/.gitignore
index ddead79d7bd..b0b84be129e 100644
--- a/htdocs/.gitignore
+++ b/htdocs/.gitignore
@@ -1,7 +1,11 @@
+/allscreens*
/ancot*
/bootstrap*
+/dolimed*
+/ecommerce*
/extensions*
/google*
+/lead
/multicompany*
/ndf*
/numberingpack*
@@ -11,6 +15,3 @@
/teclib*
/test.php
/ultimatepdf*
-/lead
-/dolimed*
-/allscreens*
diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php
index 83d3547d1b8..28a97d3d89d 100644
--- a/htdocs/categories/edit.php
+++ b/htdocs/categories/edit.php
@@ -86,21 +86,15 @@ if ($action == 'update' && $user->rights->categorie->creer)
if (empty($categorie->label))
{
$error++;
- $action = 'create';
+ $action = 'edit';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
}
- if (empty($categorie->description))
- {
- $error++;
- $action = 'create';
- setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors');
- }
if (! $error && empty($categorie->error))
{
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
if ($ret < 0) $error++;
- if ($categorie->update($user) > 0)
+ if (! $error && $categorie->update($user) > 0)
{
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
exit;
@@ -151,7 +145,7 @@ print '';
// Description
print '
';
-print '| '.$langs->trans("Description").' | ';
+print ''.$langs->trans("Description").' | ';
print '';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50);
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index d6ff35f8af5..a9164676716 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -965,25 +965,25 @@ if ($id > 0)
print '';
- if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
+ if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
{
$langs->load("propal");
print ' ';
}
- if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
+ if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
{
$langs->load("orders");
print ' ';
}
- if ($user->rights->contrat->creer)
+ if ($user->rights->contrat->creer && $object->status==1)
{
$langs->load("contracts");
print ' ';
}
- if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
+ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
{
$langs->load("fichinter");
print ' ';
@@ -992,7 +992,7 @@ if ($id > 0)
// Add invoice
if ($user->societe_id == 0)
{
- if (! empty($conf->deplacement->enabled))
+ if (! empty($conf->deplacement->enabled) && $object->status==1)
{
$langs->load("trips");
print ' ';
@@ -1000,7 +1000,7 @@ if ($id > 0)
if (! empty($conf->facture->enabled))
{
- if ($user->rights->facture->creer)
+ if ($user->rights->facture->creer && $object->status==1)
{
$langs->load("bills");
$langs->load("orders");
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 204ef0ec6f2..24b7ab16d69 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -195,22 +195,18 @@ if (empty($reshook))
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
- // Define output language
- if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
- {
- $outputlangs = $langs;
- $newlang = '';
- if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
- if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
- if (! empty($newlang)) {
- $outputlangs = new Translate("", $conf);
- $outputlangs->setDefaultLang($newlang);
- }
- $model=$object->modelpdf;
- $ret = $object->fetch($id); // Reload to get new records
-
- $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
+ $outputlangs = $langs;
+ $newlang = '';
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
+ if (! empty($newlang)) {
+ $outputlangs = new Translate("", $conf);
+ $outputlangs->setDefaultLang($newlang);
}
+ $model=$object->modelpdf;
+ $ret = $object->fetch($id); // Reload to get new records
+
+ $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
} else {
$langs->load("errors");
@@ -1290,7 +1286,7 @@ if ($action == 'create')
print ' | ';
} else {
print '';
- print $form->select_company('', 'socid', 's.client = 1 OR s.client = 2 OR s.client = 3', 1);
+ print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1);
print ' | ';
}
print '
' . "\n";
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 7471dd3ee0d..50c93d8d432 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -628,8 +628,14 @@ class DolibarrModules // Can not be abstract, because we need to insta
{
$dirfound++;
- // Run llx_mytable.sql files
+ // Run llx_mytable.sql files, then llx_mytable_*.sql
+ $files = array();
while (($file = readdir($handle))!==false)
+ {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
@@ -640,8 +646,14 @@ class DolibarrModules // Can not be abstract, because we need to insta
rewinddir($handle);
- // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql)
+ // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) then then llx_mytable_*.key.sql
+ $files = array();
while (($file = readdir($handle))!==false)
+ {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file)
{
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
@@ -653,7 +665,13 @@ class DolibarrModules // Can not be abstract, because we need to insta
rewinddir($handle);
// Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
+ $files = array();
while (($file = readdir($handle))!==false)
+ {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{
@@ -665,7 +683,13 @@ class DolibarrModules // Can not be abstract, because we need to insta
rewinddir($handle);
// Run update_xxx.sql files
+ $files = array();
while (($file = readdir($handle))!==false)
+ {
+ $files[] = $file;
+ }
+ sort($files);
+ foreach ($files as $file)
{
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
{
diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php
index 824b3c53866..5222137e692 100644
--- a/htdocs/core/modules/modBanque.class.php
+++ b/htdocs/core/modules/modBanque.class.php
@@ -164,7 +164,7 @@ class modBanque extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Bordereaux remise Chq/Fact';
$this->export_permission[$r]=array(array("banque","export"));
- $this->export_fields_array[$r]=array("bch.rowid"=>"bordereauid","bch.number"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
+ $this->export_fields_array[$r]=array("bch.rowid"=>"DepositId","bch.number"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
"bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","f.facnumber"=>"InvoiceRef"
);
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date",
diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
index b348cb03c72..7b2145d0f93 100644
--- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
+++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php
@@ -51,7 +51,7 @@ $(document).ready(function() {
$('#refreshbutton').click( function() {
$.pleaseBePatient("trans('PleaseBePatient'); ?>");
- $.getJSON( "", {
+ $.get( "", {
action: "build",
element: "ecm"
},
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 20cf8f250bd..758885cef58 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -5,11 +5,8 @@
* Copyright (C) 2004 Christophe Combelles
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
-<<<<<<< HEAD
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
-=======
* Copyright (C) 2015 Marcos GarcĂa
->>>>>>> refs/remotes/origin/3.6
*
* 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
@@ -46,6 +43,7 @@ $confirm = GETPOST('confirm');
$facid=GETPOST('facid','int');
$socid=GETPOST('socid','int');
+$accountid = GETPOST('accountid');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@@ -200,7 +198,7 @@ if (empty($reshook))
if (! $error)
{
- $result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'','');
+ $result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$accountid,'','');
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
@@ -304,7 +302,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (! empty($conf->banque->enabled))
{
print '| '.$langs->trans('Account').' | ';
- $form->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',2);
+ $form->select_comptes(empty($accountid)?'':$accountid,'accountid',0,'',2);
print ' |
';
}
else
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index ca322f66eeb..7ea9f32830d 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -382,6 +382,8 @@ ChequesReceipts=Checks receipts
ChequesArea=Checks deposits area
ChequeDeposits=Checks deposits
Cheques=Checks
+DepositId=Id deposit
+NbCheque=Number of checks
CreditNoteConvertedIntoDiscount=This credit note or deposit invoice has been converted into %s
UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices
ShowUnpaidAll=Show all unpaid invoices
diff --git a/htdocs/theme/.gitignore b/htdocs/theme/.gitignore
index 59c154b7d5f..725155947d1 100644
--- a/htdocs/theme/.gitignore
+++ b/htdocs/theme/.gitignore
@@ -1,3 +1,4 @@
/bootstrap
/oblyon
/autre
+/allscreens