';
print ''.$langs->trans("Categories").' ';
if (!empty($conf->use_javascript_ajax))
{
- print '';
+ print '';
}
print ' ';
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index d259c8ca5a5..c4366ebf19c 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -317,9 +317,9 @@ print '';
if (!empty($conf->use_javascript_ajax))
{
print '';
}
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 20e76b6e7d5..9e770f70a93 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -62,11 +62,12 @@ if ($id > 0)
}
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index f1ea3c0923d..7c6335d146b 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -65,11 +65,12 @@ $result = restrictedArea($user, 'societe', $id, '&societe');
$action = GETPOST('action', 'aZ09');
$mode = GETPOST("mode");
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 02d801860a5..d9d12c5efb4 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -53,11 +53,12 @@ if (!empty($user->socid))
$result = restrictedArea($user, 'propal', $id);
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 4fa1095998a..9d188cda104 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -52,11 +52,12 @@ if ($user->socid)
$result = restrictedArea($user, 'commande', $id, '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php
index 1df1f000a61..05f89e1bc6f 100644
--- a/htdocs/compta/bank/account_statement_document.php
+++ b/htdocs/compta/bank/account_statement_document.php
@@ -57,11 +57,12 @@ if ($user->socid)
$socid = $user->socid;
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; }
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder)
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index bc5b9d46be1..d947d169695 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -73,12 +73,12 @@ class BankAccounts extends DolibarrApi
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
if ($category > 0) {
- $sql .= ", ".MAIN_DB_PREFIX."categorie_account as c";
+ $sql .= ", ".MAIN_DB_PREFIX."categorie_account as c";
}
$sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')';
// Select accounts of given category
if ($category > 0) {
- $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_account = t.rowid ";
+ $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_account = t.rowid ";
}
// Add sql filters
if ($sqlfilters)
diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php
index 9fd2207f3ec..d003463e5af 100644
--- a/htdocs/compta/bank/document.php
+++ b/htdocs/compta/bank/document.php
@@ -54,11 +54,12 @@ if ($user->socid)
$socid = $user->socid;
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; }
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder)
diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index ccd6b24c6b9..c4fdc3be56a 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -277,7 +277,7 @@ if ($action == 'create')
print ' ';
print ' ';
- print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'invoicing');
+ print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'object_payment');
dol_fiche_head('', '');
diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php
index 618cc6006a5..d81b9bdd41a 100644
--- a/htdocs/compta/bank/various_payment/document.php
+++ b/htdocs/compta/bank/various_payment/document.php
@@ -43,11 +43,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'banque', '', '', '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php
index e2aa6517417..5f68440809c 100644
--- a/htdocs/compta/bank/various_payment/list.php
+++ b/htdocs/compta/bank/various_payment/list.php
@@ -58,7 +58,7 @@ $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) $sortfield = "v.datep,v.rowid";
@@ -95,6 +95,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$typeid = "";
}
+
/*
* View
*/
@@ -178,9 +179,8 @@ if ($result)
print ' ';
print ' ';
print ' ';
- print ' ';
- print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
+ print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '';
print '
'."\n";
diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php
index e9aa35d80b3..93065219248 100644
--- a/htdocs/compta/charges/index.php
+++ b/htdocs/compta/charges/index.php
@@ -102,11 +102,11 @@ print ' ';
if ($mode != 'sconly')
{
$center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')." " : "");
- print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1);
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1);
}
else
{
- print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit);
+ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0);
}
if ($year) $param .= '&year='.$year;
diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php
index 1dc13c0580f..6c1439d5466 100644
--- a/htdocs/compta/clients.php
+++ b/htdocs/compta/clients.php
@@ -44,11 +44,12 @@ $langs->load("companies");
$mode = GETPOST("mode");
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php
index 4f42ae2292b..2cef0b3e6cd 100644
--- a/htdocs/compta/deplacement/document.php
+++ b/htdocs/compta/deplacement/document.php
@@ -48,11 +48,12 @@ $result = restrictedArea($user, 'deplacement', $id, '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php
index e95d7f95732..9d45bafd20f 100644
--- a/htdocs/compta/deplacement/index.php
+++ b/htdocs/compta/deplacement/index.php
@@ -35,11 +35,12 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'deplacement', '', '');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC";
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 5e280535c27..4f111c26f39 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4357,16 +4357,13 @@ elseif ($id > 0 || !empty($ref))
- if(!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
-
+ if (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
$displayWarranty = true;
- if(!in_array($object->type, $retainedWarrantyInvoiceAvailableType) && empty($object->retained_warranty)){
+ if (!in_array($object->type, $retainedWarrantyInvoiceAvailableType) && empty($object->retained_warranty)) {
$displayWarranty = false;
}
- if($displayWarranty)
- {
-
+ if($displayWarranty) {
// Retained Warranty
print '';
print '';
@@ -5049,8 +5046,9 @@ elseif ($id > 0 || !empty($ref))
print '';
// Show object lines
- if (!empty($object->lines))
+ if (!empty($object->lines)) {
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
+ }
// Form to add new line
if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline')
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index 95c6af527b6..85da9cd5c37 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -502,8 +502,7 @@ class Invoices extends DolibarrApi
}
$result = $this->invoice->delete_contact($rowid);
-
- if (!$result) {
+ if ($result < 0) {
throw new RestException(500, 'Error when deleted the contact');
}
@@ -600,7 +599,7 @@ class Invoices extends DolibarrApi
/**
* Delete invoice
*
- * @param int $id Invoice ID
+ * @param int $id Invoice ID
* @return array
*/
public function delete($id)
@@ -617,7 +616,8 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
- if ($this->invoice->delete($id) < 0)
+ $result = $this->invoice->delete(DolibarrApiAccess::$user);
+ if ($result < 0)
{
throw new RestException(500);
}
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index e09c8aee11c..a901b985342 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -56,11 +56,12 @@ if ($user->socid)
$result = restrictedArea($user, 'facture', $id, '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 759e9cc3944..8faa0de3de5 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -328,13 +328,12 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- print ' ';
print ' ';
print ' ';
$title = $langs->trans("RepeatableInvoices");
- print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
+ print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
print ''.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).' ';
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 3cb06396c80..87bdaa9641d 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -215,10 +215,9 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- print ' ';
print ' ';
- print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
+ print_barre_liste($langs->trans("ReceivedCustomersPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit, 0, 0, 1);
print '';
print '
'."\n";
diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php
index 19ba5892474..6eef29d1e3e 100644
--- a/htdocs/compta/prelevement/line.php
+++ b/htdocs/compta/prelevement/line.php
@@ -43,9 +43,22 @@ $action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha');
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+if ($page == -1 || $page == null) { $page = 0; }
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+
+if ($sortorder == "") $sortorder = "DESC";
+if ($sortfield == "") $sortfield = "pl.fk_soc";
+
+
+/*
+ * Actions
+ */
if ($action == 'confirm_rejet')
{
@@ -246,17 +259,6 @@ if ($id)
print "";
-
-
- if ($page == -1 || $page == null) { $page = 0; }
-
- $offset = $conf->liste_limit * $page;
- $pageprev = $page - 1;
- $pagenext = $page + 1;
-
- if ($sortorder == "") $sortorder = "DESC";
- if ($sortfield == "") $sortfield = "pl.fk_soc";
-
/*
* List of invoices
*/
diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php
index 1bc2a1844e2..602c57b5ad4 100644
--- a/htdocs/compta/prelevement/rejets.php
+++ b/htdocs/compta/prelevement/rejets.php
@@ -39,20 +39,19 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
// Get supervariables
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortorder = GETPOST('sortorder', 'alpha');
$sortfield = GETPOST('sortfield', 'alpha');
-
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
/*
* View
*/
llxHeader('', $langs->trans("WithdrawsRefused"));
-$offset = $conf->liste_limit * $page;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
-
if ($sortorder == "") $sortorder = "DESC";
if ($sortfield == "") $sortfield = "p.datec";
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index a64c0432be9..3c73c8e6614 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -52,13 +52,14 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales', 'charges');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
}
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 9cfec1868fa..ef39d559ca0 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -191,19 +191,16 @@ if ($resql)
print ' ';
print ' ';
print ' ';
- print ' ';
print ' ';
+ $center = '';
if ($year)
{
$center = ($year ? "".img_previous()." ".$langs->trans("Year")." $year ".img_next()." " : "");
- print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
- }
- else
- {
- print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit);
}
+ print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
+
if (empty($mysoc->country_id) && empty($mysoc->country_code))
{
print '';
diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php
index 037e6baa5c3..fabaf1ee705 100644
--- a/htdocs/compta/tva/document.php
+++ b/htdocs/compta/tva/document.php
@@ -53,14 +53,14 @@ $result = restrictedArea($user, 'tax', '', 'vat', 'charges');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) {
$page = 0;
}
-
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index 35c5dc2c052..003a7eabcad 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2018 Laurent Destailleur
+ * Copyright (C) 2004-2020 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
* Copyright (C) 2011-2019 Alexandre Spangaro
*
@@ -160,9 +160,8 @@ if ($result)
print ' ';
print ' ';
print ' ';
- print ' ';
- print_barre_liste($langs->trans("VATPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy', 0, $newcardbutton, '', $limit);
+ print_barre_liste($langs->trans("VATPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
print '';
print '
'."\n";
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 28d8ac42f6b..e21ee3e492b 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -55,11 +55,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php
index de064d6bccf..297cadac0be 100644
--- a/htdocs/contact/vcard.php
+++ b/htdocs/contact/vcard.php
@@ -79,7 +79,7 @@ if ($company->id)
if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "TYPE=WORK;POSTAL");
- if ($company->email != $contact->email) $v->setEmail($company->email, 'TYPE=PREF,INTERNET');
+ if (empty($contact->email)) $v->setEmail($company->email, 'TYPE=PREF,INTERNET');
// Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
}
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index c104d210617..330db63e30c 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -55,11 +55,12 @@ if ($user->socid > 0)
$result = restrictedArea($user, 'contrat', $id);
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 31d0b449d5b..bb6a8de30d4 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -46,11 +46,12 @@ if (!isset($mode) || $mode != 'noajax') // For ajax call
$urlsource = GETPOST("urlsource", 'alpha');
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
+ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
- $offset = $conf->liste_limit * $page;
+ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php
index 7c8c110db88..17dd29057b3 100644
--- a/htdocs/core/boxes/box_birthdays.php
+++ b/htdocs/core/boxes/box_birthdays.php
@@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")";
- $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']);
+ $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0);
diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php
index 96fc97f2e37..010bf8e7f21 100644
--- a/htdocs/core/boxes/box_birthdays_members.php
+++ b/htdocs/core/boxes/box_birthdays_members.php
@@ -90,7 +90,7 @@ class box_birthdays_members extends ModeleBoxes
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
$sql .= " AND u.statut = 1";
- $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']);
+ $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0);
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index e868934e55a..a5cb9bf7d35 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -1466,6 +1466,7 @@ abstract class CommonDocGenerator
// save curent cell padding
$curentCellPaddinds = $pdf->getCellPaddings();
+ // Add space for lines (more if we need to show a second alternative language)
global $outputlangsbis;
if (is_object($outputlangsbis)) {
// set cell padding with column title definition
@@ -1480,8 +1481,8 @@ abstract class CommonDocGenerator
$textWidth = $colDef['width'];
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);
-
- if (is_object($outputlangsbis)) {
+ // Add variant of translation if $outputlangsbis is an object
+ if (is_object($outputlangsbis) && trim($colDef['title']['label'])) {
$pdf->setCellPaddings($colDef['title']['padding'][3], 0, $colDef['title']['padding'][1], $colDef['title']['padding'][2]);
$pdf->SetXY($colDef['xStartPos'], $pdf->GetY());
$textbis = $outputlangsbis->transnoentities($colDef['title']['textkey']);
@@ -1495,6 +1496,7 @@ abstract class CommonDocGenerator
}
}
}
+
return $this->tabTitleHeight;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f9c3e260e6f..7bbf7b6475c 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7117,6 +7117,13 @@ abstract class CommonObject
{
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) ?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)) : $this->array_options['options_'.$key];
}
+ // HTML, select, integer and text add default value
+ if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'select', 'int')))
+ {
+ if($action=='create') $value = $extrafields->attributes[$this->table_element]['default'][$key];
+ else $value = $this->array_options['options_'.$key];
+ }
+
$labeltoshow = $langs->trans($label);
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 8c7a88e925a..d4ee7ccaced 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -259,7 +259,7 @@ class DolEditor
})';
$out .= ''."\n";
}
-var_dump($this->height);
+
$out .= 'element.'-'.$fieldname.'">';
$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang');
$result .= $s;
@@ -7408,9 +7409,14 @@ class Form
$htmltext = '';
// If there is extra languages
foreach ($arrayoflangcode as $extralangcode) {
- $s = picto_from_langcode($extralangcode, 'class="pictoforlang paddingright"');
- $htmltext .= $s.$object->array_languages['name'][$extralangcode];
+ $htmltext .= picto_from_langcode($extralangcode, 'class="pictoforlang paddingright"');
+ if ($object->array_languages['name'][$extralangcode]) {
+ $htmltext .= $object->array_languages['name'][$extralangcode];
+ } else {
+ $htmltext .= ''.$langs->trans("SwitchInEditModeToAddTranslation").' ';
+ }
}
+ $ret .= ''."\n";
$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft');
}
}
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index 2031d23eece..ba3c8199fca 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1379,9 +1379,10 @@ class SMTPs
$strContentAltText = '';
if ($strType == 'html')
{
- // Similar code to forge a text from html is also in CMailFile.class.php
- $strContentAltText = preg_replace("/ ]*>/", " ", $strContent);
- $strContentAltText = html_entity_decode(strip_tags($strContentAltText));
+ // Similar code to forge a text from html is also in CMailFile.class.php
+ $strContentAltText = preg_replace('/.*<\/style><\/head>/', '', $strContent);
+ $strContentAltText = preg_replace("/ ]*>/", " ", $strContentAltText);
+ $strContentAltText = html_entity_decode(strip_tags($strContentAltText));
$strContentAltText = trim(wordwrap($strContentAltText, 75, "\r\n"));
}
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index 4baf2aa0232..cff2670061e 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -301,7 +301,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $exclu
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date));
$sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'";
} else
- $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%m') = '".$db->escape($month_date)."'";
+ $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'";
} elseif ($year_date > 0) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'";
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f6584a49c77..16ecae4298b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3142,18 +3142,20 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes',
- 'delete', 'dolly', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
- 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', 'mrp', 'note', 'stock',
+ 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
+ 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot',
+ 'money-bill-alt', 'mrp', 'note', 'stock',
'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom',
- 'object_category', 'object_bookmark', 'object_bug', 'object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
+ 'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder',
+ 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_dynamicprice',
- 'object_holiday', 'object_hrm', 'object_intervention', 'object_multicurrency', 'object_order', 'object_payment',
- 'object_lot', 'object_mrp', 'object_product', 'object_propal', 'object_supplier_proposal', 'object_service', 'object_stock',
- 'object_paragraph', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
+ 'object_holiday', 'object_hrm', 'object_intervention', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
+ 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_supplier_proposal', 'object_service', 'object_stock',
+ 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other',
'object_phoning', 'object_phoning_fax', 'object_email',
'off', 'on',
- 'paiment', 'play', 'playdisabled', 'printer', 'product', 'propal', 'resize', 'service', 'stats', 'trip',
+ 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'resize', 'service', 'stats', 'trip',
'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
@@ -3178,7 +3180,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'account'=>'university', 'action'=>'calendar-alt', 'address'=> 'address-book', 'bank_account'=>'university', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt',
- 'accounting'=>'chart-line', 'category'=>'tag',
+ 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode',
'email'=>'at',
'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'info-circle',
@@ -3190,9 +3192,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'intervention'=>'ambulance', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'other'=>'square',
- 'playdisabled'=>'play', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
+ 'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'resize'=>'crop', 'supplier_proposal'=>'file-signature',
- 'payment'=>'money-bill-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
+ 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'resource'=>'laptop-house',
'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
@@ -3247,15 +3249,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Add CSS
$arrayconvpictotomorcess = array(
'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'bank_account'=>'bg-infobox-bank_account', 'cash-register'=>'bg-infobox-bank_account',
- 'contract'=>'bg-infobox-contrat',
- 'multicurrency'=>'bg-infobox-bank_account',
- 'check'=>'font-status4',
+ 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action',
'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat',
- 'members'=>'bg-infobox-adherent', 'member'=>'bg-infobox-adherent', 'order'=>'bg-infobox-commande',
+ 'multicurrency'=>'bg-infobox-bank_account',
+ 'members'=>'bg-infobox-adherent', 'member'=>'bg-infobox-adherent', 'money-bill-alt'=>'bg-infobox-bank_account',
+ 'order'=>'bg-infobox-commande',
'user'=>'bg-infobox-adherent', 'users'=>'bg-infobox-adherent',
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
'holiday'=>'bg-infobox-holiday',
- 'payment'=>'bg-infobox-bank_account', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
+ 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
'resource'=>'bg-infobox-action', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
'ticket'=>'bg-infobox-contrat', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
@@ -3269,7 +3271,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944',
'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944',
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999',
- 'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
+ 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
'other'=>'#ddd',
'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba',
'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>''
@@ -3361,7 +3363,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
*/
function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $srconly = 0, $notitle = 0)
{
- return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
+ if (strpos($picto, '^') === 0) return img_picto($titlealt, str_replace('^', '', $picto), $moreatt, $pictoisfullpath, $srconly, $notitle);
+ else return img_picto($titlealt, 'object_'.$picto, $moreatt, $pictoisfullpath, $srconly, $notitle);
}
/**
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index f3e7cee141d..5b7c923001b 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -331,7 +331,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
if ($foruserprofile) $colspan = 4;
$thumbsbyrow = 6;
- print '';
+ print '';
// Title
if ($foruserprofile)
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index f5119791432..cf6bc12b9a1 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -746,7 +746,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->SetXY($posx, $posy);
$pdf->SetFont('', 'B', $default_font_size + 2);
$pdf->SetTextColor(111, 81, 124);
- $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $object->getLibStatut(0), '', 'R');
+ $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posx, 3, $outputlangs->transnoentities($object->statuts_short[$object->status]), '', 'R');
if ($showaddress) {
// Sender properties
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index cc26c4ba13b..4d9df1c662a 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1419,7 +1419,6 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1);
-
}
}
}
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index 6fad6fc4665..8f48f31fddb 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -1272,7 +1272,15 @@ class pdf_sponge extends ModelePDFFactures
$default_font_size = pdf_getPDFFontSize($outputlangs);
- $tab2_top = $posy;
+ $outputlangsbis = null;
+ if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
+ $outputlangsbis = new Translate('', $conf);
+ $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
+ $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
+ $default_font_size--;
+ }
+
+ $tab2_top = $posy;
$tab2_hl = 4;
$pdf->SetFont('', '', $default_font_size - 1);
@@ -1287,13 +1295,6 @@ class pdf_sponge extends ModelePDFFactures
$useborder = 0;
$index = 0;
- $outputlangsbis = null;
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
- $outputlangsbis = new Translate('', $conf);
- $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
- $outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
- }
-
// Add trigger to allow to edit $object
$parameters = array(
'object' => &$object,
@@ -1708,7 +1709,7 @@ class pdf_sponge extends ModelePDFFactures
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
- $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").' ('.$object->retained_warranty.'%)';
+ $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RetainedWarranty") : '').' ('.$object->retained_warranty.'%)';
$retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : '';
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1);
@@ -2028,7 +2029,12 @@ class pdf_sponge extends ModelePDFFactures
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DateInvoice")." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R');
+
+ $title = $outputlangs->transnoentities("DateInvoice");
+ if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
+ $title .= ' - '.$outputlangsbis->transnoentities("DateInvoice");
+ }
+ $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R');
if (!empty($conf->global->INVOICE_POINTOFTAX_DATE))
{
@@ -2043,7 +2049,11 @@ class pdf_sponge extends ModelePDFFactures
$posy += 3;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
- $pdf->MultiCell($w, 3, $outputlangs->transnoentities("DateDue")." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R');
+ $title = $outputlangs->transnoentities("DateDue");
+ if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
+ $title .= ' - '.$outputlangsbis->transnoentities("DateDue");
+ }
+ $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R');
}
if ($object->thirdparty->code_client)
diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php
index b6efd6a05f1..4d314644fb4 100644
--- a/htdocs/core/modules/modECM.class.php
+++ b/htdocs/core/modules/modECM.class.php
@@ -58,7 +58,7 @@ class modECM extends DolibarrModules
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module
- $this->picto = 'dir';
+ $this->picto = 'folder';
// Data directories to create when module is enabled
$this->dirs = array("/ecm/temp");
diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php
index 93cd08c7001..19e22497a7a 100644
--- a/htdocs/core/modules/modExpedition.class.php
+++ b/htdocs/core/modules/modExpedition.class.php
@@ -57,7 +57,7 @@ class modExpedition extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->picto = "sending";
+ $this->picto = "dolly";
// Data directories to create when module is enabled
$this->dirs = array("/expedition/temp",
diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php
index c3fe9b3a18d..10515a78449 100644
--- a/htdocs/core/modules/modGeoIPMaxmind.class.php
+++ b/htdocs/core/modules/modGeoIPMaxmind.class.php
@@ -56,7 +56,7 @@ class modGeoIPMaxmind extends DolibarrModules
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/images directory, use this->picto=DOL_URL_ROOT.'/module/images/file.png'
- $this->picto = 'globe';
+ $this->picto = 'geoip';
// Data directories to create when module is enabled
$this->dirs = array("/geoipmaxmind");
diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php
index e4e93e495a0..b1adf99940b 100644
--- a/htdocs/core/modules/modLoan.class.php
+++ b/htdocs/core/modules/modLoan.class.php
@@ -54,7 +54,7 @@ class modLoan extends DolibarrModules
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->picto = 'bill';
+ $this->picto = 'money-bill-alt';
// Data directories to create when module is enabled
$this->dirs = array("/loan/temp");
diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php
index 3e5f3d8d62e..165cb9d5858 100644
--- a/htdocs/core/modules/modOpenSurvey.class.php
+++ b/htdocs/core/modules/modOpenSurvey.class.php
@@ -64,7 +64,7 @@ class modOpenSurvey extends DolibarrModules
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
- $this->picto = 'opensurvey.png@opensurvey';
+ $this->picto = '^date@opensurvey';
// Data directories to create when module is enabled
$this->dirs = array();
diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php
index 0a03515b246..637afae049d 100644
--- a/htdocs/core/modules/modReception.class.php
+++ b/htdocs/core/modules/modReception.class.php
@@ -53,7 +53,7 @@ class modReception extends DolibarrModules
$this->version = 'experimental';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
- $this->picto = "sending";
+ $this->picto = "dollyrevert";
// Data directories to create when module is enabled
$this->dirs = array("/reception/receipt",
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index d61810c5178..57e4c14e5d5 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -45,7 +45,7 @@ if (empty($object) || !is_object($object))
exit;
}
-
+global $mysoc;
global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax;
$usemargins = 0;
@@ -282,13 +282,13 @@ if ($line->special_code == 3) { ?>
$coldisplay++;
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- print 'country_code).'='.price($line->total_ht);
- print ' '.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva);
- if (price2num($line->total_localtax1)) print ' '.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
- if (price2num($line->total_localtax2)) print ' '.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
- print ' '.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
- print '">';
+ $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht);
+ $tooltiponprice .= ' '.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva);
+ if (price2num($line->total_localtax1)) $tooltiponprice .= ' '.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
+ if (price2num($line->total_localtax2)) $tooltiponprice .= ' '.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
+ $tooltiponprice .= ' '.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
+
+ print '';
}
print price($line->total_ht);
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
index af2ed9cc96b..27138e6099f 100644
--- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
+++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php
@@ -53,7 +53,7 @@ class InterfaceStripe
$this->family = 'stripe';
$this->description = "Triggers of the module Stripe";
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
- $this->picto = 'stripe@stripe';
+ $this->picto = 'stripe';
}
/**
@@ -77,29 +77,6 @@ class InterfaceStripe
return $this->description;
}
- /**
- * Trigger version
- *
- * @return string Version of trigger file
- */
- public function getVersion()
- {
- global $langs;
- $langs->load("admin");
-
- if ($this->version == 'development') {
- return $langs->trans("Development");
- } elseif ($this->version == 'experimental') {
- return $langs->trans("Experimental");
- } elseif ($this->version == 'dolibarr') {
- return DOL_VERSION;
- } elseif ($this->version) {
- return $this->version;
- } else {
- return $langs->trans("Unknown");
- }
- }
-
/**
* Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 8dbb6f99fda..dcb245e3e85 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -55,11 +55,12 @@ $result = restrictedArea($user, 'don', $id, '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index a61a97f7c78..cd0d0539f8f 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -32,10 +32,12 @@ if (!empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/clas
// Load translation files required by the page
$langs->loadLangs(array("companies", "donations"));
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'sclist';
+
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
@@ -137,6 +139,8 @@ if ($resql)
$i = 0;
$param = '';
+ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
+ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
if ($search_status && $search_status != -1) $param .= '&search_status='.urlencode($search_status);
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
@@ -159,7 +163,7 @@ if ($resql)
print ' ';
print ' ';
- print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton);
+ print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, $newcardbutton, '', $limit, 0, 0, 1);
if ($search_all)
{
diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php
index 0c9190b9a4c..4d6f2bdce5a 100644
--- a/htdocs/ecm/dir_add_card.php
+++ b/htdocs/ecm/dir_add_card.php
@@ -62,11 +62,12 @@ else // For example $module == 'medias'
$upload_dir = $conf->medias->multidir_output[$conf->entity];
}
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php
index 42c6b140f3c..9b3da9d8aae 100644
--- a/htdocs/ecm/dir_card.php
+++ b/htdocs/ecm/dir_card.php
@@ -42,11 +42,12 @@ $pageid = GETPOST('pageid', 'int');
if (empty($module)) $module = 'ecm';
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php
index 4b2d6006c5c..1c94fd1700b 100644
--- a/htdocs/ecm/file_card.php
+++ b/htdocs/ecm/file_card.php
@@ -46,11 +46,12 @@ if ($user->socid > 0)
$socid = $user->socid;
}
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 9e51da09899..43b9ca6dcce 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -45,11 +45,12 @@ $section = GETPOST('section', 'int') ?GETPOST('section', 'int') : GETPOST('secti
if (!$section) $section = 0;
$section_dir = GETPOST('section_dir', 'alpha');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 6c245e3ad1c..39bdc9a1612 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -47,11 +47,12 @@ $section_dir = GETPOST('section_dir', 'alpha');
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 1b90ae77411..e125824a8c8 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -52,11 +52,12 @@ if (empty($module)) $module = 'ecm';
$upload_dir = $conf->ecm->dir_output.'/'.$section;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index e4fc2868b99..655ba8f060f 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -874,8 +874,9 @@ $warehousestatic = new Entrepot($db);
if ($action == 'create2')
{
- print load_fiche_titre($langs->trans("CreateShipment")).' ';
- print $langs->trans("ShipmentCreationIsDoneFromOrder");
+ print load_fiche_titre($langs->trans("CreateShipment"), '', 'dolly');
+
+ print ' '.$langs->trans("ShipmentCreationIsDoneFromOrder");
$action = ''; $id = ''; $ref = '';
}
@@ -884,7 +885,8 @@ if ($action == 'create')
{
$expe = new Expedition($db);
- print load_fiche_titre($langs->trans("CreateShipment"));
+ print load_fiche_titre($langs->trans("CreateShipment"), '', 'dolly');
+
if (!$origin)
{
setEventMessages($langs->trans("ErrorBadParameters"), null, 'errors');
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 7cce1c282da..624add5c075 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -74,7 +74,7 @@ class Expedition extends CommonObject
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
- public $picto = 'sending';
+ public $picto = 'dolly';
public $socid;
@@ -1626,7 +1626,7 @@ class Expedition extends CommonObject
global $langs, $conf;
$result = '';
- $label = ''.$langs->trans("ShowSending").' ';
+ $label = ''.$langs->trans("Shipment").' ';
$label .= ''.$langs->trans('Ref').': '.$this->ref;
$label .= ''.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client);
@@ -1647,14 +1647,15 @@ class Expedition extends CommonObject
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- $label = $langs->trans("ShowSending");
+ $label = $langs->trans("Shipment");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip"';
}
- $linkstart = '';
+ $linkstart = ' ';
$linkend = ' ';
$result .= $linkstart;
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index 65786dfbdae..6047be5fe0e 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -53,11 +53,12 @@ if ($user->socid)
$result = restrictedArea($user, 'expedition', $id, '');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php
index a930fed21b0..d3fec260d95 100644
--- a/htdocs/expedition/index.php
+++ b/htdocs/expedition/index.php
@@ -47,7 +47,7 @@ $shipment = new Expedition($db);
$helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
llxHeader('', $langs->trans("Shipment"), $helpurl);
-print load_fiche_titre($langs->trans("SendingsArea"));
+print load_fiche_titre($langs->trans("SendingsArea"), '', 'dolly');
print '';
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 6f33c41c9dc..52c69f960cc 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -365,11 +365,10 @@ if ($resql)
print '
';
print '
';
print '
';
- print '
';
print '
';
print '
';
- print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, $newcardbutton, '', $limit);
+ print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendShippingRef";
$modelmail = "shipping_send";
diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php
index 5d3c8038bc2..db28b094e65 100644
--- a/htdocs/expedition/stats/index.php
+++ b/htdocs/expedition/stats/index.php
@@ -58,7 +58,7 @@ $form = new Form($db);
llxHeader();
-print load_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
+print load_fiche_titre($langs->trans("StatisticsOfSendings"), '', 'dolly');
dol_mkdir($dir);
diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php
index 0c974ef450a..17b7eb57619 100644
--- a/htdocs/expensereport/document.php
+++ b/htdocs/expensereport/document.php
@@ -48,11 +48,12 @@ $result = restrictedArea($user, 'expensereport', $id, 'expensereport');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php
index accea8f8251..0597d1b29a2 100644
--- a/htdocs/expensereport/index.php
+++ b/htdocs/expensereport/index.php
@@ -45,11 +45,12 @@ $socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'expensereport', '', '');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC";
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 925ad7be709..a6b4c88ed09 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -52,11 +52,12 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index 179b9f158bc..139d87162c6 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -479,6 +479,203 @@ class SupplierInvoices extends DolibarrApi
return $paiement_id;
}
+ /**
+ * Get lines of a supplier invoice
+ *
+ * @param int $id Id of supplier invoice
+ *
+ * @url GET {id}/lines
+ *
+ * @return array
+ */
+ public function getLines($id)
+ {
+ if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
+ throw new RestException(401);
+ }
+
+ $result = $this->invoice->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Supplier invoice not found');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+ $this->invoice->fetch_lines();
+ $result = array();
+ foreach ($this->invoice->lines as $line) {
+ array_push($result, $this->_cleanObjectDatas($line));
+ }
+ return $result;
+ }
+
+ /**
+ * Add a line to given supplier invoice
+ *
+ * @param int $id Id of supplier invoice to update
+ * @param array $request_data supplier invoice line data
+ *
+ * @url POST {id}/lines
+ *
+ * @return int|bool
+ */
+ public function postLine($id, $request_data = null)
+ {
+ if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
+ throw new RestException(401);
+ }
+
+ $result = $this->invoice->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Supplier invoice not found');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+ $request_data = (object) $request_data;
+
+ $updateRes = $this->invoice->addline(
+ $request_data->description,
+ $request_data->pu_ht,
+ $request_data->tva_tx,
+ $request_data->localtax1_tx,
+ $request_data->localtax2_tx,
+ $request_data->qty,
+ $request_data->fk_product,
+ $request_data->remise_percent,
+ $request_data->date_start,
+ $request_data->date_end,
+ $request_data->ventil,
+ $request_data->info_bits,
+ 'HT',
+ $request_data->product_type,
+ $request_data->rang,
+ false,
+ $request_data->array_options,
+ $request_data->fk_unit,
+ $request_data->origin_id,
+ $request_data->multicurrency_subprice,
+ $request_data->ref_supplier,
+ $request_data->special_code
+ );
+
+ if ($updateRes < 0) {
+ throw new RestException(400, 'Unable to insert the new line. Check your inputs. '.$this->invoice->error);
+ }
+
+ return $updateRes;
+ }
+
+ /**
+ * Update a line to a given supplier invoice
+ *
+ * @param int $id Id of supplier invoice to update
+ * @param int $lineid Id of line to update
+ * @param array $request_data InvoiceLine data
+ *
+ * @url PUT {id}/lines/{lineid}
+ *
+ * @return object
+ *
+ * @throws 200
+ * @throws 304
+ * @throws 401
+ * @throws 404
+ */
+ public function putLine($id, $lineid, $request_data = null)
+ {
+ if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
+ throw new RestException(401);
+ }
+
+ $result = $this->invoice->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Supplier invoice not found');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+ $request_data = (object) $request_data;
+ $updateRes = $this->invoice->updateline(
+ $lineid,
+ $request_data->description,
+ $request_data->pu_ht,
+ $request_data->tva_tx,
+ $request_data->localtax1_tx,
+ $request_data->localtax2_tx,
+ $request_data->qty,
+ $request_data->fk_product,
+ 'HT',
+ $request_data->info_bits,
+ $request_data->product_type,
+ $request_data->remise_percent,
+ false,
+ $request_data->date_start,
+ $request_data->date_end,
+ $request_data->array_options,
+ $request_data->fk_unit,
+ $request_data->multicurrency_subprice,
+ $request_data->ref_supplier
+ );
+
+ if ($updateRes > 0) {
+ $result = $this->get($id);
+ unset($result->line);
+ return $this->_cleanObjectDatas($result);
+ } else {
+ throw new RestException(304, $this->invoice->error);
+ }
+ }
+
+ /**
+ * Deletes a line of a given supplier invoice
+ *
+ * @param int $id Id of supplier invoice
+ * @param int $lineid Id of the line to delete
+ *
+ * @url DELETE {id}/lines/{lineid}
+ *
+ * @return array
+ *
+ * @throws 400
+ * @throws 401
+ * @throws 404
+ * @throws 405
+ */
+ public function deleteLine($id, $lineid)
+ {
+ if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) {
+ throw new RestException(401);
+ }
+
+ $result = $this->invoice->fetch($id);
+ if( ! $result ) {
+ throw new RestException(404, 'Supplier invoice not found');
+ }
+
+ if(empty($lineid)) {
+ throw new RestException(400, 'Line ID is mandatory');
+ }
+
+ if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
+
+ // TODO Check the lineid $lineid is a line of ojbect
+
+ $updateRes = $this->invoice->deleteline($lineid);
+ if ($updateRes > 0) {
+ return $this->get($id);
+ }
+ else
+ {
+ throw new RestException(405, $this->invoice->error);
+ }
+ }
+
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Clean sensible object datas
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 916ef2f001d..bc353e7ef0d 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -977,6 +977,15 @@ class FactureFournisseur extends CommonInvoice
}
}
+ if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0)
+ {
+ $result=$this->insertExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ }
+ }
+
if (!$error)
{
if (!$notrigger)
@@ -3119,7 +3128,7 @@ class SupplierInvoiceLine extends CommonObjectLine
*/
public function delete($notrigger = 0)
{
- global $user;
+ global $user, $conf;
dol_syslog(get_class($this)."::deleteline rowid=".$this->id, LOG_DEBUG);
@@ -3135,6 +3144,17 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->deleteObjectLinked();
+ // Remove extrafields
+ if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used
+ {
+ $result=$this->deleteExtraFields();
+ if ($result < 0)
+ {
+ $error++;
+ dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
+ }
+ }
+
if (!$error) {
// Supprime ligne
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det ';
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 2292f335c40..7db240abf94 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -51,11 +51,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index 06e7f09edd7..40773f0eca6 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -41,11 +41,12 @@ if ($user->socid > 0)
$socid = $user->socid;
}
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 287a85bc7cc..022028bb483 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -50,11 +50,12 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
// Get parameters
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortorder) $sortorder = "ASC";
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 4e5ed4dbae2..5368b491728 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -54,9 +54,10 @@ $search_company = GETPOST('search_company', 'alpha');
$search_amount_no_tax = GETPOST('search_amount_no_tax', 'alpha');
$search_amount_all_tax = GETPOST('search_amount_all_tax', 'alpha');
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!$sortfield) $sortfield = "f.date_lim_reglement";
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index a907bcd6bb0..45d9c8ef967 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2004-2020 Laurent Destailleur
* Copyright (C) 2004 Christophe Combelles
* Copyright (C) 2005 Marc Barilley / Ocebo
* Copyright (C) 2005-2012 Regis Houssin
@@ -889,8 +889,6 @@ if (empty($action) || $action == 'list')
$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
- print_barre_liste($langs->trans('SupplierPayments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
-
print '