diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml
index 8afb7e8f4f8..5b55cdc54c8 100644
--- a/.github/workflows/stale-issues.yml
+++ b/.github/workflows/stale-issues.yml
@@ -9,7 +9,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- - uses: Dolibarr/stale@v1.1.0
+ - uses: Dolibarr/stale@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. Without comment, this issue will be closed automatically by stale bot in 15 days.'
@@ -17,7 +17,7 @@ jobs:
exempt-issue-label: 'Priority High / Blocking'
days-before-stale: 365
days-before-close: 15
- operations-per-run: 10
+ operations-per-run: 50
#stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. If this PR is still mergeable (no conflict, nor Continuous Integration errors), please comment to confirm this merge is still expected. Without comment, this issue will be closed automatically by stale bot in 15 days.'
stale-pr-label: 'PR Stale (automatic label)'
stale-pr-message:
diff --git a/build/README b/build/README
index 07f0ebe3b55..67ceb05c8d2 100644
--- a/build/README
+++ b/build/README
@@ -45,9 +45,12 @@ Dolibarr working. It is here only to build Dolibarr packages, and those
generated packages will not contains this "build" directory.
-We can find in "build", following sub-directories:
+You can find in "build", following sub-directories:
-* debian:
+* composer
+To test an upgrade of a lib.
+
+* debian
To build Debian package.
* dmg:
diff --git a/build/obs/README b/build/obs/README
index c8a29e1dac4..44427c01d49 100644
--- a/build/obs/README
+++ b/build/obs/README
@@ -1,20 +1,24 @@
README (English)
##################################################
OBS Package tools
+OBE - openSUSE Build Service
##################################################
-This directory contains files to explain how to publish
-a package onto OBS
+This directory contains an instruction to explain
+how to publish a package onto OBS.
-# Create a project onto OBS
-#----------------------------------
-https://build.opensuse.org
+# Create a project onto OBS
+---------------------------
+https://build.opensuse.org
-Packaging rules: http://en.opensuse.org/Portal:Packaging
+
+# Packaging rules:
+------------------
+https://en.opensuse.org/Portal:Packaging
Add attributes:
-OBS:Screenshots URL of screenshot http://www.dolibarr.org/images/dolibarr_screenshot1.png
+OBS:Screenshots URL of screenshot https://www.dolibarr.org/images/dolibarr_screenshot1.png
OBS:QualityCategory Development|Testing|Stable|Private
OBS:Maintained 1
@@ -28,22 +32,24 @@ To submit a snapshot for building, we should have a service file with content
-How to have such a service file created automatically ?
-Go into project you want to update. It mught be:
+# How to have such a service file created automatically ?
+---------------------------------------------------------
+Go into project you want to update. It might be:
- openSUSE Build Service > Projects > Application:ERP:Dolibarr > dolibarr
- or your private project
Once logged, click on "Add file" in section "Source Files", then select mode "Upload From: Remote URL"
Keep empty for "Filename", choose "Remote URL" and enter into last field, URL that should looks like this:
-http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-0.4.src.rpm
+https://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-0.4.src.rpm
Then add into Advanded - Attributes
-OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png
-OBS:QualityCategory Stable|Testing|Development|Private
+OBS:Screenshots https://www.dolibarr.org/images/dolibarr_screenshot1.png
+OBS:QualityCategory Stable|Testing|Development|Private
# Move project into official directory
+--------------------------------------
- Enter a bug to ask to be a maintener of a category or to add a new one.
For example: https://bugzilla.novell.com/show_bug.cgi?id=848083 to be a maintener of category
https://build.opensuse.org/project/show/Application:ERP
diff --git a/dev/setup/eclipse/PSR-12 [built-in].xml b/dev/setup/eclipse/PSR-12 [built-in].xml
new file mode 100644
index 00000000000..47925209682
--- /dev/null
+++ b/dev/setup/eclipse/PSR-12 [built-in].xml
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/translation/erp_comparison_translation.txt b/dev/translation/erp_comparison_translation.txt
index c99a5f4cc1c..6cf7c4f7c60 100644
--- a/dev/translation/erp_comparison_translation.txt
+++ b/dev/translation/erp_comparison_translation.txt
@@ -1,17 +1,25 @@
+comparison of terms
-Term Dolibarr SAP Odoo ...
-----------------------------------------------------------------------------
-Thirdparty Contact partner Partner/Contact (company)
-Contact/address Contact person Partner/Contact (individual)
+Dolibarr SAP ERP Odoo
+-------------------------------------------------------------------------
+Thirdparty Contact partner Partner/Contact (company)
+Contact/address Contact person Partner/Contact (individual)
-Financial ?? Invoicing
-
-Income / Expense ?? Profit / Loss
-Balance ?? Net profit
-Subledger account Subledger account ??
+Financial Finance (FI) Accounting
+Accounting
-Proposal ?? Quotation Proposal is ok but proposition looks better (proposal is for a detailed proposition). We can say also "business proposition or business proposal".
- Indian are using "Quotation".
+Income / Expense ?? Profit / Loss
+Balance ?? Net profit
+Subledger account Subledger account ??
+
+CRM Sales & Distribution Sales
+Proposal ?? Quotation
+
+
+
+Proposal is ok but proposition looks better (proposal is for a detailed proposition).
+We can say also "business proposition or business proposal".
+In India they are using "Quotation".
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 9de858da26b..c7681c6f9ca 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -283,6 +283,8 @@ if ($resql)
'."\n";
$out .= '
';
- $out .= ''.($revertonoff ?img_picto($langs->trans("Enabled"), 'switch_on') : img_picto($langs->trans("Disabled"), 'switch_off')).'';
- $out .= ''.($revertonoff ?img_picto($langs->trans("Disabled"), 'switch_off') : img_picto($langs->trans("Enabled"), 'switch_on')).'';
+ $out .= ''.($revertonoff ?img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort)).'';
+ $out .= ''.($revertonoff ?img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', '', $marginleftonlyshort) : img_picto($langs->trans("Enabled"), 'switch_on', '', false, 0, 0, '', '', $marginleftonlyshort)).'';
$out .= "\n";
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 8129c810303..0b732f9372a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1145,15 +1145,16 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title
* @param string $morecss More Css
+ * @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
* @return void
*/
-function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '')
+function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0)
{
- print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath, $morehtmlright, $morecss);
+ print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath, $morehtmlright, $morecss, $limittoshow);
}
/**
- * Show tab header of a card
+ * Show tabs of a record
*
* @param array $links Array of tabs
* @param string $active Active tab name
@@ -1163,9 +1164,10 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title
* @param string $morecss More Css
+ * @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
* @return string
*/
-function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '')
+function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab = 0, $picto = '', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limittoshow = 0)
{
global $conf, $langs, $hookmanager;
@@ -1202,11 +1204,13 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
if (count($keys)) $maxkey = max($keys);
}
- if (!empty($conf->dol_optimize_smallscreen)) $conf->global->MAIN_MAXTABS_IN_CARD = 2;
-
// Show tabs
// if =0 we don't use the feature
- $limittoshow = (empty($conf->global->MAIN_MAXTABS_IN_CARD) ? 99 : $conf->global->MAIN_MAXTABS_IN_CARD);
+ if (empty($limittoshow)) {
+ $limittoshow = (empty($conf->global->MAIN_MAXTABS_IN_CARD) ? 99 : $conf->global->MAIN_MAXTABS_IN_CARD);
+ }
+ if (!empty($conf->dol_optimize_smallscreen)) $limittoshow = 2;
+
$displaytab = 0;
$nbintab = 0;
$popuptab = 0;
@@ -3073,7 +3077,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
* @param string $alt Force alt for bind people
- * @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty.
+ * @param string $morecss Add more class css on img tag (For example 'myclascss').
* @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No margin left. Works for fontawesome picto only.
* @return string Return img tag
* @see img_object(), img_picto_common()
@@ -4082,11 +4086,22 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
$tmpfield = explode(',', $field);
$field1 = trim($tmpfield[0]); // If $field is 'd.datep,d.id', it becomes 'd.datep'
+ if (empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE)) {
+ $prefix = 'wrapcolumntitle '.$prefix;
+ }
//var_dump('field='.$field.' field1='.$field1.' sortfield='.$sortfield.' sortfield1='.$sortfield1);
// If field is used as sort criteria we use a specific css class liste_titre_sel
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
- if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib.'>';
- else $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib.'>';
+ if ($field1 && ($sortfield1 == $field1 || $sortfield1 == preg_replace("/^[^\.]+\./", "", $field1))) {
+ $out .= '<'.$tag.' class="'.$prefix.'liste_titre_sel" '.$moreattrib;
+ $out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
+ $out .= '>';
+ }
+ else {
+ $out .= '<'.$tag.' class="'.$prefix.'liste_titre" '.$moreattrib;
+ $out .= (($field && empty($conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) && preg_match('/^[a-zA-Z_0-9\s\.\-:]*$/', $name)) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
+ $out .= '>';
+ }
if (empty($thead) && $field && empty($disablesortlink)) // If this is a sort field
{
@@ -4119,7 +4134,9 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin
}
}
$sortordertouseinlink = preg_replace('/,$/', '', $sortordertouseinlink);
- $out .= '';
+ $out .= 'global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE) ? ' title="'.dol_escape_htmltag($langs->trans($name)).'"' : '');
+ $out .= '>';
}
if ($tooltip) $out .= $form->textwithpicto($langs->trans($name), $langs->trans($tooltip));
@@ -4287,7 +4304,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
if ($picto && $titre) print ''.img_picto('', $picto, 'class="valignmiddle pictotitle widthpictotitle"', $pictoisfullpath).' | ';
print '';
print ' '.$titre;
- if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')';
+ if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print '('.$totalnboflines.')';
print ' | ';
// Center
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index ddca8ef1153..dbfeef03259 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -2035,15 +2035,19 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$listofstatus = array_keys($listofoppstatus);
- $statusOppList = array();
- $themeColorId = 0;
- foreach ($listofstatus as $oppStatus) {
- $oppStatusCode = dol_getIdFromCode($db, $oppStatus, 'c_lead_status', 'rowid', 'code');
- if ($oppStatusCode) {
- $statusOppList[$oppStatus]['code'] = $oppStatusCode;
- $statusOppList[$oppStatus]['color'] = isset($theme_datacolor[$themeColorId]) ? implode(', ', $theme_datacolor[$themeColorId]) : '';
+
+ if (is_array($listofstatus) && ! empty($conf->global->USE_COLOR_FOR_PROSPECTION_STATUS)) {
+ // Define $themeColorId and array $statusOppList for each $listofstatus
+ $themeColorId = 0;
+ $statusOppList = array();
+ foreach ($listofstatus as $oppStatus) {
+ $oppStatusCode = dol_getIdFromCode($db, $oppStatus, 'c_lead_status', 'rowid', 'code');
+ if ($oppStatusCode) {
+ $statusOppList[$oppStatus]['code'] = $oppStatusCode;
+ $statusOppList[$oppStatus]['color'] = isset($theme_datacolor[$themeColorId]) ? implode(', ', $theme_datacolor[$themeColorId]) : '';
+ }
+ $themeColorId++;
}
- $themeColorId++;
}
$projectstatic = new Project($db);
@@ -2175,7 +2179,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
if ($userAccess >= 0)
{
$projectstatic->ref = $objp->ref;
- $projectstatic->statut = $objp->status;
+ $projectstatic->statut = $objp->status; // deprecated
+ $projectstatic->status = $objp->status;
$projectstatic->title = $objp->title;
$projectstatic->datee = $db->jdate($objp->datee);
$projectstatic->dateo = $db->jdate($objp->dateo);
@@ -2202,6 +2207,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
print '';
// Because color of prospection status has no meaning yet, it is used if hidden constant is set
if (empty($conf->global->USE_COLOR_FOR_PROSPECTION_STATUS)) {
+ $oppStatusCode = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code');
if ($langs->trans("OppStatus".$oppStatusCode) != "OppStatus".$oppStatusCode) {
print $langs->trans("OppStatus".$oppStatusCode);
}
@@ -2454,7 +2460,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
*/
function getTaskProgressBadge($task, $label = '', $tooltip = '')
{
- global $conf;
+ global $conf, $langs;
$out = '';
$badgeClass = '';
@@ -2472,12 +2478,15 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
$badgeClass .= 'badge-danger';
+ if (empty($tooltip)) $tooltip = $task->progress.'% < '.$langs->trans("Expected").' '.$progressCalculated.'%';
}
elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
$badgeClass .= 'badge-warning';
+ if (empty($tooltip)) $tooltip = $task->progress.'% < '.$langs->trans("Expected").' '.$progressCalculated.'%';
}
else {
$badgeClass .= 'badge-success';
+ if (empty($tooltip)) $tooltip = $task->progress.'% >= '.$langs->trans("Expected").' '.$progressCalculated.'%';
}
}
}
diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php
index 65ad4c091a0..6cf8189f3c8 100644
--- a/htdocs/core/lib/takepos.lib.php
+++ b/htdocs/core/lib/takepos.lib.php
@@ -52,7 +52,12 @@ function takepos_prepare_head()
$h++;
}
- complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
+ $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/other.php';
+ $head[$h][1] = $langs->trans("Other");
+ $head[$h][2] = 'other';
+ $h++;
+
+ complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
return $head;
}
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index 6e23160baf6..9755369793e 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -411,9 +411,11 @@ class doc_generic_bom_odt extends ModelePDFBom
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 4694cdaf6ee..75c5103c4ab 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -427,9 +427,11 @@ class doc_generic_order_odt extends ModelePDFCommandes
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index 190abd86126..c938f40cfb2 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -408,9 +408,11 @@ class doc_generic_contract_odt extends ModelePDFContract
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 01070a6a6c7..acbebd54da8 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -435,9 +435,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php
index b40ca3df78c..11c9f72c4c3 100644
--- a/htdocs/core/modules/modSociete.class.php
+++ b/htdocs/core/modules/modSociete.class.php
@@ -687,7 +687,9 @@ class modSociete extends DolibarrModules
'sr.domiciliation' => "BankAccountDomiciliation",
'sr.proprio' => "BankAccountOwner",
'sr.owner_address' => "BankAccountOwnerAddress",
- 'sr.default_rib' => 'Default'
+ 'sr.default_rib' => 'Default',
+ 'sr.rum' => 'RUM',
+ 'sr.type' => "Type ban is defaut",
);
$this->import_convertvalue_array[$r] = array(
@@ -714,7 +716,9 @@ class modSociete extends DolibarrModules
'sr.domiciliation' => 'bank branch address eg. "PARIS"',
'sr.proprio' => 'name on the bank account',
'sr.owner_address' => 'address of account holder',
- 'sr.default_rib' => '1 (default account) / 0 (not default)'
+ 'sr.default_rib' => '1 (default account) / 0 (not default)',
+ 'sr.rum' => 'RUM code',
+ 'sr.type' => 'ban',
);
// Import Company Sales representatives
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index 398c8670a47..e276fe1f5f7 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -418,9 +418,11 @@ class doc_generic_mo_odt extends ModelePDFMo
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index fde5f08d318..33850c5d882 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -456,9 +456,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index c71fe8f59ec..d7f48915308 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -421,9 +421,11 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index 77503c4b61b..3b4a39288ea 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -445,9 +445,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
}
if ($foundtagforlines)
{
+ $linenumber = 0;
foreach ($object->lines as $line)
{
- $tmparray = $this->get_substitutionarray_lines($line, $outputlangs);
+ $linenumber++;
+ $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
// Call the ODTSubstitutionLine hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line);
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index 17c7cb9e974..dd59b20c964 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -38,6 +38,10 @@ $original_file = GETPOST("file");
$backtourl = GETPOST('backtourl');
$cancel = GETPOST('cancel', 'alpha');
+$file = GETPOST('file', 'alpha');
+$num = GETPOST('num', 'alpha'); // Used for document on bank statement
+
+
// Security check
if (empty($modulepart)) accessforbidden('Bad value for modulepart');
$accessallowed = 0;
@@ -249,19 +253,25 @@ else {
if (empty($backtourl))
{
- if (in_array($modulepart, array('product', 'produit', 'service', 'produit|service'))) $backtourl = DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('expensereport'))) $backtourl = DOL_URL_ROOT."/expensereport/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('holiday'))) $backtourl = DOL_URL_ROOT."/holiday/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('member'))) $backtourl = DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('project'))) $backtourl = DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('propal'))) $backtourl = DOL_URL_ROOT."/comm/propal/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('societe'))) $backtourl = DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('tax'))) $backtourl = DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('ticket'))) $backtourl = DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('user'))) $backtourl = DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ $regs = array();
+
+ if (in_array($modulepart, array('product', 'produit', 'service', 'produit|service'))) $backtourl = DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('expensereport'))) $backtourl = DOL_URL_ROOT."/expensereport/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('holiday'))) $backtourl = DOL_URL_ROOT."/holiday/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('member'))) $backtourl = DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('project'))) $backtourl = DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('propal'))) $backtourl = DOL_URL_ROOT."/comm/propal/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('societe'))) $backtourl = DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('tax'))) $backtourl = DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('ticket'))) $backtourl = DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('user'))) $backtourl = DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('bank')) && preg_match('/\/statement\/([^\/]+)\//', $file, $regs)) {
+ $num = $regs[1];
+ $backtourl = DOL_URL_ROOT."/compta/bank/account_statement_document.php?id=".$id.'&num='.urlencode($num).'&file='.urldecode($file);
+ }
+ elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($file);
+ elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($file);
+ else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($file);
}
@@ -283,11 +293,11 @@ if ($cancel)
}
}
-if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POST["sizex"]) != "") && (isset($_POST["sizey"]) != ""))
+if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") && GETPOSTISSET("sizey"))
{
$fullpath = $dir."/".$original_file;
- $result = dol_imageResizeOrCrop($fullpath, 0, $_POST['sizex'], $_POST['sizey']);
+ $result = dol_imageResizeOrCrop($fullpath, 0, GETPOST('sizex', 'int'), GETPOST('sizey', 'int'));
if ($result == $fullpath)
{
@@ -357,7 +367,7 @@ if ($action == 'confirm_crop')
$fullpath = $dir."/".$original_file;
//var_dump($_POST['w'].'x'.$_POST['h'].'-'.$_POST['x'].'x'.$_POST['y']);exit;
- $result = dol_imageResizeOrCrop($fullpath, 1, $_POST['w'], $_POST['h'], $_POST['x'], $_POST['y']);
+ $result = dol_imageResizeOrCrop($fullpath, 1, GETPOST('w', 'int'), GETPOST('h', 'int'), GETPOST('x', 'int'), GETPOST('y', 'int'));
if ($result == $fullpath)
{
@@ -445,7 +455,7 @@ print ' '."\n";
*/
print ''."\n";
-print ' |