';
}
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 9eabd378e11..97d2509b898 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -329,7 +329,8 @@ if ($action == 'create') {
// Account parent
print '
'.$langs->trans("Accountparent").'
';
print '
';
- print $formaccounting->select_account($object->account_parent, 'account_parent', 1);
+ // Note: We accept disabled account as parent account so we can build a hierarchy and use only childs
+ print $formaccounting->select_account($object->account_parent, 'account_parent', 1, array(), 0, 0, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1, '');
print '
';
// Chart of accounts type
diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php
index 7b86902e009..87e6a3b490c 100644
--- a/htdocs/accountancy/admin/categories.php
+++ b/htdocs/accountancy/admin/categories.php
@@ -110,18 +110,22 @@ print '
';
print "";
diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php
index 2e25da59564..9fcfb7e325a 100644
--- a/htdocs/core/boxes/box_members_by_type.php
+++ b/htdocs/core/boxes/box_members_by_type.php
@@ -92,6 +92,7 @@ class box_members_by_type extends ModeleBoxes
if ($user->rights->adherent->lire) {
$MembersToValidate = array();
+ $MembersPending = array();
$MembersValidated = array();
$MembersUpToDate = array();
$MembersExcluded = array();
@@ -169,34 +170,63 @@ class box_members_by_type extends ModeleBoxes
}
$this->db->free($result);
}
+ // Members pendding (Waiting for first subscription)
+ $sql = "SELECT count(*) as somme , d.fk_adherent_type";
+ $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d, " . MAIN_DB_PREFIX . "adherent_type as t";
+ $sql .= " WHERE d.entity IN (" . getEntity('adherent') . ")";
+ $sql .= " AND d.statut = 1 AND (d.datefin IS NULL AND t.subscription = 1)";
+ $sql .= " AND t.rowid = d.fk_adherent_type";
+ $sql .= " GROUP BY d.fk_adherent_type";
+
+ dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG);
+ $result = $this->db->query($sql);
+ if ($result) {
+ $num2 = $this->db->num_rows($result);
+ $i = 0;
+ while ($i < $num2) {
+ $objp = $this->db->fetch_object($result);
+ $MembersPending[$objp->fk_adherent_type] = $objp->somme;
+ $i++;
+ }
+ $this->db->free($result);
+ }
$line = 0;
$this->info_box_contents[$line][] = array(
'td' => 'class=""',
'text' => '',
);
+ // Draft
$labelstatus = $staticmember->LibStatut($staticmember::STATUS_DRAFT, 0, 0, 1);
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
'text' => $labelstatus
);
- $labelstatus = $langs->trans("UpToDate");
+ // Pending (Waiting for first subscription)
+ $labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, 0, 1);
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
+ 'text' => $labelstatus
+ );
+ // Up to date
$labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() + 86400, 1);
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
'text' => $labelstatus,
);
- $labelstatus = $langs->trans("OutOfDate");
+ // Expired
$labelstatus = $staticmember->LibStatut($staticmember::STATUS_VALIDATED, 1, dol_now() - 86400, 1);
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
'text' => $labelstatus
);
+ // Excluded
$labelstatus = $staticmember->LibStatut($staticmember::STATUS_EXCLUDED, 0, 0, 1);
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
'text' => $labelstatus
);
+ // Resiliated
$labelstatus = $staticmember->LibStatut($staticmember::STATUS_RESILIATED, 0, 0, 1);
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax100" width="15%" title="'.dol_escape_htmltag($labelstatus).'"',
@@ -205,7 +235,8 @@ class box_members_by_type extends ModeleBoxes
$line++;
foreach ($AdherentType as $key => $adhtype) {
$SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0;
- $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0;
+ $SumPending += isset($MembersPending[$key]) ? $MembersPending[$key] : 0;
+ $SumExpired += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) - (isset($MembersPending[$key]) ? $MembersPending[$key] : 0): 0;
$SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0;
$SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0;
$SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0;
@@ -220,6 +251,11 @@ class box_members_by_type extends ModeleBoxes
'text' => (isset($MembersToValidate[$key]) && $MembersToValidate[$key] > 0 ? $MembersToValidate[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_DRAFT, 1, 0, 3),
'asis' => 1,
);
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'class="right"',
+ 'text' => (isset($MembersPending[$key]) && $MembersPending[$key] > 0 ? $MembersPending[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 0, 3),
+ 'asis' => 1,
+ );
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
'text' => (isset($MembersUpToDate[$key]) && $MembersUpToDate[$key] > 0 ? $MembersUpToDate[$key] : '') . ' ' . $staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, $now, 3),
@@ -260,6 +296,11 @@ class box_members_by_type extends ModeleBoxes
'text' => $SumToValidate.' '.$staticmember->LibStatut(Adherent::STATUS_DRAFT, 1, 0, 3),
'asis' => 1
);
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'class="liste_total right"',
+ 'text' => $SumPending.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 0, 3),
+ 'asis' => 1
+ );
$this->info_box_contents[$line][] = array(
'td' => 'class="liste_total right"',
'text' => $SumUpToDate.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, $now, 3),
@@ -267,7 +308,7 @@ class box_members_by_type extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="liste_total right"',
- 'text' => $SumValidated.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 1, 3),
+ 'text' => $SumExpired.' '.$staticmember->LibStatut(Adherent::STATUS_VALIDATED, 1, 1, 3),
'asis' => 1
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 37f250bf92f..d1b0ca0164c 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -9600,6 +9600,12 @@ abstract class CommonObject
}
}
+ // Delete linked object
+ $res = $this->deleteObjectLinked();
+ if ($res < 0) {
+ $error++;
+ }
+
if (!$error && !empty($this->isextrafieldmanaged)) {
$result = $this->deleteExtraFields();
if ($result < 0) {
@@ -9723,23 +9729,24 @@ abstract class CommonObject
$tmpforobjectclass = get_class($this);
$tmpforobjectlineclass = ucfirst($tmpforobjectclass).'Line';
+ $this->db->begin();
+
// Call trigger
$result = $this->call_trigger('LINE'.strtoupper($tmpforobjectclass).'_DELETE', $user);
if ($result < 0) {
- return -1;
+ $error++;
}
// End call triggers
- $this->db->begin();
+ if (empty($error)) {
+ $sql = "DELETE FROM ".$this->db->prefix().$this->table_element_line;
+ $sql .= " WHERE rowid = ".((int) $idline);
- $sql = "DELETE FROM ".$this->db->prefix().$this->table_element_line;
- $sql .= " WHERE rowid = ".((int) $idline);
-
- dol_syslog(get_class($this)."::deleteLineCommon", LOG_DEBUG);
- $resql = $this->db->query($sql);
- if (!$resql) {
- $this->error = "Error ".$this->db->lasterror();
- $error++;
+ $resql = $this->db->query($sql);
+ if (!$resql) {
+ $this->error = "Error ".$this->db->lasterror();
+ $error++;
+ }
}
if (empty($error)) {
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 57f0bca4e36..6ef5b69ba3e 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -1211,7 +1211,7 @@ class DolGraph
$tmp = str_replace('#', '', $this->datacolor[$i]);
if (strpos($tmp, '-') !== false) {
$foundnegativecolor++;
- $color = '#FFFFFF'; // If $val is '-123'
+ $color = 'rgba(0,0,0,.0)'; // If $val is '-123'
} else {
$color = "#" . $tmp; // If $val is '123' or '#123'
}
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index 10e23f3d2e4..8ebac3611cb 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -270,12 +270,16 @@ class FormAccounting extends Form
}
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
+
+ $titletoshowhtml = ($maxlen ? dol_trunc($obj->type, $maxlen) : $obj->type).($obj->range_account ? ' ('.$obj->range_account.')' : '');
+ $titletoshow = ($maxlen ? dol_trunc($obj->type, $maxlen) : $obj->type).($obj->range_account ? ' ('.$obj->range_account.')' : '');
+
$out .= '';
$i++;
@@ -331,17 +335,18 @@ class FormAccounting extends Form
/**
* Return list of accounts with label by chart of accounts
*
- * @param string $selectid Preselected id of accounting accounts (depends on $select_in)
- * @param string $htmlname Name of HTML field id. If name start with '.', it is name of HTML css class, so several component with same name in different forms can be used.
- * @param int|string $showempty 1=Add an empty field, 2=Add an empty field+'None' field
- * @param array $event Event options
- * @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number
- * @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
- * @param string $morecss More css non HTML object
- * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
- * @return string String with HTML select
+ * @param string $selectid Preselected id of accounting accounts (depends on $select_in)
+ * @param string $htmlname Name of HTML field id. If name start with '.', it is name of HTML css class, so several component with same name in different forms can be used.
+ * @param int|string $showempty 1=Add an empty field, 2=Add an empty field+'None' field
+ * @param array $event Event options
+ * @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number
+ * @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
+ * @param string $morecss More css non HTML object
+ * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
+ * @param string $active Filter on status active or not: '0', '1' or '' for no filter
+ * @return string String with HTML select
*/
- public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '')
+ public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'minwidth100 maxwidth300 maxwidthonsmartphone', $usecache = '', $active = '1')
{
// phpcs:enable
global $conf, $langs;
@@ -360,14 +365,18 @@ class FormAccounting extends Form
$options = $options + $this->options_cache[$usecache]; // We use + instead of array_merge because we don't want to reindex key from 0
$selected = $selectid;
} else {
- $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT) ? 50 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT;
+ $trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', 50);
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version";
$sql .= " FROM ".$this->db->prefix()."accounting_account as aa";
$sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
$sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
- $sql .= " AND aa.active = 1";
- $sql .= " AND aa.entity=".$conf->entity;
+ if ($active === '1') {
+ $sql .= " AND aa.active = 1";
+ } elseif ($active === '0') {
+ $sql .= " AND aa.active = 0";
+ }
+ $sql .= " AND aa.entity=".((int) $conf->entity);
$sql .= " ORDER BY aa.account_number";
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php
index 9d8832c36ce..31cf6300aff 100644
--- a/htdocs/core/class/validate.class.php
+++ b/htdocs/core/class/validate.class.php
@@ -191,7 +191,7 @@ class Validate
*/
public function isMinLength($string, $length)
{
- if (!strlen($string) < $length) {
+ if (strlen($string) < $length) {
$this->error = $this->outputLang->trans('RequireMinLength', $length);
return false;
}
diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index 3310554e530..c037b86a7b9 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -110,6 +110,7 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) {
console.log("toggle dropdown dt a");
//$(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\');
+ $(".ulselectedfields").removeClass("open");
$(this).parent().parent().find(\'dd ul\').toggleClass("open");
if ($(this).parent().parent().find(\'dd ul\').hasClass("open")) {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index ca7e346b2bd..24e4a332e10 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6914,24 +6914,27 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto =
/**
* Clean a string to keep only desirable HTML tags.
- * WARNING: This also clean HTML comments (used to obfuscate tag name).
+ * WARNING: This also clean HTML comments (because they can be used to obfuscate tag name).
*
* @param string $stringtoclean String to clean
* @param int $cleanalsosomestyles Remove absolute/fixed positioning from inline styles
* @param int $removeclassattribute 1=Remove the class attribute from tags
* @param int $cleanalsojavascript Remove also occurence of 'javascript:'.
* @param int $allowiframe Allow iframe tags.
+ * @param array $allowed_tags List of allowed tags to replace the default list
* @return string String cleaned
*
* @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()
*/
-function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $removeclassattribute = 1, $cleanalsojavascript = 0, $allowiframe = 0)
+function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $removeclassattribute = 1, $cleanalsojavascript = 0, $allowiframe = 0, $allowed_tags = array())
{
- $allowed_tags = array(
- "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
- "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6",
- "comment" // this tags is added to manage comment that are replaced into ...
- );
+ if (empty($allowed_tags)) {
+ $allowed_tags = array(
+ "html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
+ "ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6"
+ );
+ }
+ $allowed_tags[] = "comment"; // this tags is added to manage comment that are replaced into ...
if ($allowiframe) {
$allowed_tags[] = "iframe";
}
@@ -6949,7 +6952,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1,
$stringtoclean = preg_replace('/:/i', ':', $stringtoclean);
$stringtoclean = preg_replace('/:|+58|:/i', '', $stringtoclean); // refused string ':' encoded (no reason to have a : encoded like this) to disable 'javascript:...'
- $temp = strip_tags($stringtoclean, $allowed_tags_string); // Warning: This remove also undesired > changing string obfuscated with > that pass injection detection into harmfull string
+ $temp = strip_tags($stringtoclean, $allowed_tags_string); // Warning: This remove also undesired >, so may changes string obfuscated with > that pass the injection detection into a harmfull string
if ($cleanalsosomestyles) { // Clean for remaining html tags
$temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/i', '', $temp); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless
diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php
index 3a7caa1cb57..a0fb405887e 100644
--- a/htdocs/core/modules/modAsset.class.php
+++ b/htdocs/core/modules/modAsset.class.php
@@ -63,7 +63,7 @@ class modAsset extends DolibarrModules
$this->descriptionlong = "Asset module to manage assets module and depreciation charge on Dolibarr";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
- $this->version = 'experimental';
+ $this->version = 'development';
// Key used in llx_const table to save module status enabled/disabled (where ASSETS is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 6c63da727b7..1a951292f94 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -796,7 +796,7 @@ IMG;
// Export to PDF using LibreOffice
- if ($conf->global->MAIN_ODT_AS_PDF == 'libreoffice') {
+ if (getDolGlobalString('MAIN_ODT_AS_PDF') == 'libreoffice') {
dol_mkdir($conf->user->dir_temp); // We must be sure the directory exists and is writable
// We delete and recreate a subdir because the soffice may have change pemrissions on it
@@ -808,7 +808,7 @@ IMG;
// using linux/mac libreoffice that must be in path
// Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1
$command ='soffice --headless -env:UserInstallation=file:\''.$conf->user->dir_temp.'/odtaspdf\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name);
- } elseif (preg_match('/unoconv/', $conf->global->MAIN_ODT_AS_PDF)) {
+ } elseif (preg_match('/unoconv/', getDolGlobalString('MAIN_ODT_AS_PDF'))) {
// If issue with unoconv, see https://github.com/dagwieers/unoconv/issues/87
// MAIN_ODT_AS_PDF should be "sudo -u unoconv /usr/bin/unoconv" and userunoconv must have sudo to be root by adding file /etc/sudoers.d/unoconv with content www-data ALL=(unoconv) NOPASSWD: /usr/bin/unoconv .
@@ -833,17 +833,17 @@ IMG;
// - set shell of user to bash instead of nologin.
// - set permission to read/write to user on home directory /var/www so user can create the libreoffice , dconf and .cache dir and files then set permission back
- $command = $conf->global->MAIN_ODT_AS_PDF.' '.escapeshellcmd($name);
+ $command = getDolGlobalString('MAIN_ODT_AS_PDF').' '.escapeshellcmd($name);
//$command = '/usr/bin/unoconv -vvv '.escapeshellcmd($name);
} else {
// deprecated old method using odt2pdf.sh (native, jodconverter, ...)
$tmpname=preg_replace('/\.odt/i', '', $name);
- if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) {
- $command = $conf->global->MAIN_DOL_SCRIPTS_ROOT.'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
+ if (getDolGlobalString('MAIN_DOL_SCRIPTS_ROOT')) {
+ $command = getDolGlobalString('MAIN_DOL_SCRIPTS_ROOT').'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF'))?'jodconverter':getDolGlobalString('MAIN_ODT_AS_PDF'));
} else {
dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING);
- $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric($conf->global->MAIN_ODT_AS_PDF)?'jodconverter':$conf->global->MAIN_ODT_AS_PDF);
+ $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF'))?'jodconverter':getDolGlobalString('MAIN_ODT_AS_PDF'));
}
}
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index a3ed5f9b7b6..b6bf1b90aef 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -271,13 +271,13 @@ Reconcilable=Reconcilable
TotalVente=Total turnover before tax
TotalMarge=Total sales margin
-DescVentilCustomer=Consult here the list of customer invoice lines bound (or not) to a product accounting account
-DescVentilMore=In most cases, if you use predefined products or services and you set the account number on the product/service card, the application will be able to make all the binding between your invoice lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on product/service cards or if you still have some lines not bound to an account, you will have to make a manual binding from the menu "%s".
-DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their product accounting account
-DescVentilTodoCustomer=Bind invoice lines not already bound with a product accounting account
-ChangeAccount=Change the product/service accounting account for selected lines with the following accounting account:
+DescVentilCustomer=Consult here the list of customer invoice lines bound (or not) to a product account from chart of account
+DescVentilMore=In most cases, if you use predefined products or services and you set the account (from chart of account) on the product/service card, the application will be able to make all the binding between your invoice lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on product/service cards or if you still have some lines not bound to an account, you will have to make a manual binding from the menu "%s".
+DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their product account from chart of account
+DescVentilTodoCustomer=Bind invoice lines not already bound with a product account from chart of account
+ChangeAccount=Change the product/service account (from chart of account) for the selected lines with the following account:
Vide=-
-DescVentilSupplier=Consult here the list of vendor invoice lines bound or not yet bound to a product accounting account (only record not already transfered in accountancy are visible)
+DescVentilSupplier=Consult here the list of vendor invoice lines bound or not yet bound to a product account from chart of account (only record not already transfered in accountancy are visible)
DescVentilDoneSupplier=Consult here the list of the lines of vendor invoices and their accounting account
DescVentilTodoExpenseReport=Bind expense report lines not already bound with a fee accounting account
DescVentilExpenseReport=Consult here the list of expense report lines bound (or not) to a fee accounting account
@@ -295,14 +295,14 @@ DescValidateMovements=Any modification or deletion of writing, lettering and del
ValidateHistory=Bind Automatically
AutomaticBindingDone=Automatic bindings done (%s) - Automatic binding not possible for some record (%s)
-ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
+ErrorAccountancyCodeIsAlreadyUse=Error, you cannot remove or disable this account of chart of account because it is used
MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s & Credit = %s
Balancing=Balancing
FicheVentilation=Binding card
GeneralLedgerIsWritten=Transactions are written in the Ledger
GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized.
NoNewRecordSaved=No more record to transfer
-ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account
+ListOfProductsWithoutAccountingAccount=List of products not bound to any account of chart of account
ChangeBinding=Change the binding
Accounted=Accounted in ledger
NotYetAccounted=Not yet transferred to accounting
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index f5698ef5f29..28d2c7593fc 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2225,12 +2225,12 @@ MailToPartnership=Partnership
AGENDA_EVENT_DEFAULT_STATUS=Default event status when creating a event from the form
YouShouldDisablePHPFunctions=You should disable PHP functions
IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands in custom code, you shoud disable PHP functions
-PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an anitivurs program), you must keep PHP functions
+PHPFunctionsRequiredForCLI=For shell purpose (like scheduled job backup or running an antivirus program), you must keep PHP functions
NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good)
RecommendedValueIs=Recommended: %s
Recommended=Recommended
NotRecommended=Not recommended
-ARestrictedPath=Some restricted path
+ARestrictedPath=Some restricted path for data files
CheckForModuleUpdate=Check for external modules updates
CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available.
ModuleUpdateAvailable=An update is available
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 2407d4b2d86..6d2f67ee675 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -125,7 +125,8 @@ ValidateProject=Validate projet
ConfirmValidateProject=Are you sure you want to validate this project?
CloseAProject=Close project
ConfirmCloseAProject=Are you sure you want to close this project?
-AlsoCloseAProject=Also close project (keep it open if you still need to follow production tasks on it)
+AlsoCloseAProject=Also close project
+AlsoCloseAProjectTooltip=Keep it open if you still need to follow production tasks on it
ReOpenAProject=Open project
ConfirmReOpenAProject=Are you sure you want to re-open this project?
ProjectContact=Contacts of project
@@ -168,7 +169,7 @@ OpportunityProbability=Lead probability
OpportunityProbabilityShort=Lead probab.
OpportunityAmount=Lead amount
OpportunityAmountShort=Lead amount
-OpportunityWeightedAmount=Opportunity weighted amount
+OpportunityWeightedAmount=Amount of opportunity, weighted by probability
OpportunityWeightedAmountShort=Opp. weighted amount
OpportunityAmountAverageShort=Average lead amount
OpportunityAmountWeigthedShort=Weighted lead amount
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index 0cde40ba20a..ea560012afc 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -27,6 +27,7 @@ Permission56003=Delete tickets
Permission56004=Manage tickets
Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on)
+Tickets=Tickets
TicketDictType=Ticket - Types
TicketDictCategory=Ticket - Groupes
TicketDictSeverity=Ticket - Severities
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b383a6eb7c2..417295cb116 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -998,7 +998,7 @@ if (!defined('NOLOGIN')) {
$hookmanager->initHooks(array('main'));
// Code for search criteria persistence.
- if (!empty($_GET['save_lastsearch_values'])) { // We must use $_GET here
+ if (!empty($_GET['save_lastsearch_values']) && !empty($_SERVER["HTTP_REFERER"])) { // We must use $_GET here
$relativepathstring = preg_replace('/\?.*$/', '', $_SERVER["HTTP_REFERER"]);
$relativepathstring = preg_replace('/^https?:\/\/[^\/]*/', '', $relativepathstring); // Get full path except host server
// Clean $relativepathstring
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 8e60b2a296c..c235dec7e63 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -55,6 +55,9 @@ global $langs, $user;
// Libraries
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once '../lib/mymodule.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+
+
//require_once "../class/myclass.class.php";
// Translations
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 2fe7d983513..afd7b4860fb 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -853,7 +853,7 @@ class MyObject extends CommonObject
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
global $action, $hookmanager;
- $hookmanager->initHooks(array('myobjectdao'));
+ $hookmanager->initHooks(array($this->element.'dao'));
$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 1bdcccbaecf..936633508fa 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -500,11 +500,11 @@ llxHeader("", $title, $help_url);
$titleboth = $langs->trans("LeadsOrProjects");
$titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default
-if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+if (!getDolGlobalInt('PROJECT_USE_OPPORTUNITIES')) {
$titleboth = $langs->trans("Projects");
$titlenew = $langs->trans("NewProject");
}
-if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
+if (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only
$titleboth = $langs->trans("Leads");
$titlenew = $langs->trans("NewLead");
}
@@ -567,7 +567,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '';
// Label
- print '