diff --git a/ChangeLog b/ChangeLog
index 555258f3901..a458f7eea74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,8 @@ NEW: A lot of addition of hooks.
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* There is a new specific permission to be allowed to enter timesheets. If you use timesheet, don't forget to give the new permission (disable and
+ enable the module project if it is not visible).
* The default value for MAIN_SECURITY_CSRF_WITH_TOKEN has been set to 2. It means any POST and any GET request that contains the "action" or "massaction"
with a value of a sensitive action must also a valid token parameter (With previous value 1, only POST was concerned). Note: With value 3, any URL
with parameter "action" or "massaction" need the token, whatever is the value of the action.
@@ -37,7 +39,7 @@ Following changes may create regressions for some external modules, but were nec
* Move massaction 'confirm_createbills' from actions_massactions.inc.php to commande/list.php
* Method fetch_all_resources(), fetch_all_used(), fetch_all_available() of DolResource has been removed (they were not used by core code).
* Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions.
-
+* The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced.
***** ChangeLog for 15.0.1 compared to 15.0.0 *****
FIX: #19777 #20281
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 906601d94d4..b648bd7aff7 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -582,9 +582,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
- $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/common/fontawesome-5/svgs`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index 91d8257ea7f..f2137d84af9 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -300,7 +300,7 @@ if ($action == 'create') {
// Edit mode
if ($action == 'update') {
- print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
+ print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'accounting_account');
print '
\n";
+ print ''."\n";
// Show the file area only when this page is not opend from the Extended POS
if ($contextpage != 'poslist') {
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 6ee1a057664..cb0e38b7a34 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -102,7 +102,7 @@ if ($mode == 'customer') {
$stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')';
}
if (is_array($custcats) && !empty($custcats)) {
- $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat OmdN (f.fk_soc = cat.fk_soc)';
+ $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)';
$stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')';
}
}
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index d2ed6b939c8..3d0698118ff 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -148,7 +148,7 @@ if (empty($reshook)) {
$search_company = '';
$search_status = '';
$option = '';
- $toselect = '';
+ $toselect = array();
$search_array_options = array();
}
}
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 8d63e52256e..082a485f817 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -713,16 +713,35 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++;
}
- print '';
+ print ''."\n";
+
$i++;
}
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
-print '';
-print '';
-print '';
+// If no record found
+if ($num == 0) {
+ $colspan = 1;
+ foreach ($arrayfields as $key => $val) {
+ if (!empty($val['checked'])) {
+ $colspan++;
+ }
+ }
+ print '
'.$langs->trans("NoRecordFound").'
';
+}
+
+$db->free($resql);
+
+$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
+print ''."\n";
+print ''."\n";
+
+print ''."\n";
// End of page
llxFooter();
diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php
index 77230bac407..43e9d5d4668 100644
--- a/htdocs/compta/sociales/payments.php
+++ b/htdocs/compta/sociales/payments.php
@@ -80,7 +80,7 @@ $result = restrictedArea($user, 'tax', '', 'chargesociales', 'charges');
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_sc_type = '';
- //$toselect = '';
+ //$toselect = array();
//$search_array_options = array();
}
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index f1731420852..5f76b2e9190 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -190,8 +190,8 @@ $sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
+ $resql = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($resql);
// if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) {
@@ -202,15 +202,15 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$sql .= $db->plimit($limit + 1, $offset);
-$result = $db->query($sql);
-if (!$result) {
+$resql = $db->query($sql);
+if (!$resql) {
dol_print_error($db);
llxFooter();
$db->close();
exit;
}
-$num = $db->num_rows($result);
+$num = $db->num_rows($resql);
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) {
@@ -429,7 +429,7 @@ print '';
$i = 0;
$totalarray = array();
while ($i < min($num, $limit)) {
- $obj = $db->fetch_object($result);
+ $obj = $db->fetch_object($resql);
$tva_static->id = $obj->rowid;
$tva_static->ref = $obj->rowid;
@@ -549,11 +549,27 @@ $totalarray['nbfield']++;
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
-print '';
-print '';
-print '';
+// If no record found
+if ($num == 0) {
+ $colspan = 1;
+ foreach ($arrayfields as $key => $val) {
+ if (!empty($val['checked'])) {
+ $colspan++;
+ }
+ }
+ print '
'.$langs->trans("NoRecordFound").'
';
+}
-$db->free($result);
+$db->free($resql);
+
+$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+
+print ''."\n";
+print ''."\n";
+
+print ''."\n";
// End of page
llxFooter();
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index 631bf932640..02813cee469 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -355,7 +355,7 @@ if (empty($elementTypeArray) && !$object->thirdparty->client && !$object->thirdp
// Define type of elements
$typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled, '', 'maxwidth150onsmartphone');
-$button = '';
+$button = '';
$param = '';
$param .= "&sref=".urlencode($sref);
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 31b2153c2c8..93d61f8a903 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -1309,19 +1309,31 @@ while ($i < min($num, $limit)) {
$i++;
}
+// Show total line
+include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
+
+// If no record found
+if ($num == 0) {
+ $colspan = 1;
+ foreach ($arrayfields as $key => $val) {
+ if (!empty($val['checked'])) {
+ $colspan++;
+ }
+ }
+ print '
0) {
$out .= ' colspan="'.$nbcol.'"';
}
@@ -268,7 +268,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
$out .= '';
}
- $out .= "
";
+ $out .= "";
$out .= "
\n";
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 5bbb65652c1..6519a8b9e13 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2611,12 +2611,13 @@ abstract class CommonObject
/**
* Change the payments terms
*
- * @param int $id Id of new payment terms
- * @return int >0 if OK, <0 if KO
+ * @param int $id Id of new payment terms
+ * @param string $deposit_percent % of deposit if needed by payment terms
+ * @return int >0 if OK, <0 if KO
*/
- public function setPaymentTerms($id)
+ public function setPaymentTerms($id, $deposit_percent = null)
{
- dol_syslog(get_class($this).'::setPaymentTerms('.$id.')');
+ dol_syslog(get_class($this).'::setPaymentTerms('.$id.', '.var_export($deposit_percent, true).')');
if ($this->statut >= 0 || $this->element == 'societe') {
// TODO uniformize field name
$fieldname = 'fk_cond_reglement';
@@ -2627,8 +2628,17 @@ abstract class CommonObject
$fieldname = 'cond_reglement_supplier';
}
+ if (empty($deposit_percent) || $deposit_percent < 0) {
+ $deposit_percent = getDictionaryValue('c_payment_term', 'deposit_percent', $id);
+ }
+
+ if ($deposit_percent > 100) {
+ $deposit_percent = 100;
+ }
+
$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
+ $sql .= " , deposit_percent = " . (! empty($deposit_percent) ? "'".$this->db->escape($deposit_percent)."'" : 'NULL');
$sql .= ' WHERE rowid='.((int) $this->id);
if ($this->db->query($sql)) {
@@ -2638,6 +2648,7 @@ abstract class CommonObject
$this->cond_reglement_supplier_id = $id;
}
$this->cond_reglement = $id; // for compatibility
+ $this->deposit_percent = $deposit_percent;
return 1;
} else {
dol_syslog(get_class($this).'::setPaymentTerms Error '.$sql.' - '.$this->db->error());
diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php
index d7571b8ca90..dfc22fd37ec 100644
--- a/htdocs/core/class/cunits.class.php
+++ b/htdocs/core/class/cunits.class.php
@@ -463,22 +463,30 @@ class CUnits // extends CommonObject
}
/**
- * get scale of unit factor
- * @param int $id id of unit in dictionary
- * @return float|int
+ * Get scale of unit factor
+ *
+ * @param int $id Id of unit in dictionary
+ * @return float|int Scale of unit
*/
public function scaleOfUnitPow($id)
{
$base = 10;
- // TODO : add base col into unit dictionary table
- $unit = $this->db->getRow("SELECT scale, unit_type from ".$this->db->prefix()."c_units WHERE rowid = ".intval($id));
- if ($unit) {
- // TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
- if ($unit->unit_type == 'time') {
- return floatval($unit->scale);
- }
- return pow($base, floatval($unit->scale));
+ $sql = "SELECT scale, unit_type FROM ".$this->db->prefix()."c_units WHERE rowid = ".((int) $id);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ // TODO : add base col into unit dictionary table
+ $unit = $this->db->fetch_object($sql);
+ if ($unit) {
+ // TODO : if base exists in unit dictionary table, remove this convertion exception and update convertion infos in database.
+ // Example time hour currently scale 3600 will become scale 2 base 60
+ if ($unit->unit_type == 'time') {
+ return floatval($unit->scale);
+ }
+
+ return pow($base, floatval($unit->scale));
+ }
}
return 0;
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 85f0de5de90..3a396e365d7 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -956,6 +956,8 @@ class ExtraFields
$morecss = 'minwidth400';
} elseif ($type == 'boolean') {
$morecss = '';
+ } elseif ($type == 'radio') {
+ $morecss = 'width25';
} else {
if (empty($size) || round($size) < 12) {
$morecss = 'minwidth100';
@@ -1147,7 +1149,7 @@ class ExtraFields
$sql = "SELECT ".$keyList;
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
if (!empty($InfoFieldList[4])) {
- // can use curent entity filter
+ // can use current entity filter
if (strpos($InfoFieldList[4], '$ENTITY$') !== false) {
$InfoFieldList[4] = str_replace('$ENTITY$', $conf->entity, $InfoFieldList[4]);
}
@@ -1262,7 +1264,7 @@ class ExtraFields
$out .= ' value="'.$keyopt.'"';
$out .= ' id="'.$keyprefix.$key.$keysuffix.'_'.$keyopt.'"';
$out .= ($value == $keyopt ? 'checked' : '');
- $out .= '/> ';
+ $out .= '/> ';
}
} elseif ($type == 'chkbxlst') {
if (is_array($value)) {
@@ -1315,6 +1317,10 @@ class ExtraFields
$sql = "SELECT ".$keyList;
$sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0];
if (!empty($InfoFieldList[4])) {
+ // can use current entity filter
+ if (strpos($InfoFieldList[4], '$ENTITY$') !== false) {
+ $InfoFieldList[4] = str_replace('$ENTITY$', $conf->entity, $InfoFieldList[4]);
+ }
// can use SELECT request
if (strpos($InfoFieldList[4], '$SEL$') !== false) {
$InfoFieldList[4] = str_replace('$SEL$', 'SELECT', $InfoFieldList[4]);
@@ -1666,7 +1672,7 @@ class ExtraFields
dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
}
} elseif ($type == 'radio') {
- $value = $param['options'][$value];
+ $value = $langs->trans($param['options'][$value]);
} elseif ($type == 'checkbox') {
$value_arr = explode(',', $value);
$value = '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ee445b1e5bd..0feb7e6519d 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3729,7 +3729,7 @@ class Form
dol_syslog(__METHOD__, LOG_DEBUG);
- $sql = "SELECT rowid, code, libelle as label";
+ $sql = "SELECT rowid, code, libelle as label, deposit_percent";
$sql .= " FROM ".$this->db->prefix().'c_payment_term';
$sql .= " WHERE entity IN (".getEntity('c_payment_term').")";
$sql .= " AND active > 0";
@@ -3746,6 +3746,7 @@ class Form
$label = ($langs->trans("PaymentConditionShort".$obj->code) != ("PaymentConditionShort".$obj->code) ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : ''));
$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code;
$this->cache_conditions_paiements[$obj->rowid]['label'] = $label;
+ $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent;
$i++;
}
@@ -3991,39 +3992,45 @@ class Form
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * print list of payment modes.
- * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
- * See instead to force the default value by the caller.
+ * print list of payment modes.
+ * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
+ * See instead to force the default value by the caller.
*
- * @param int $selected Id of payment term to preselect by default
- * @param string $htmlname Nom de la zone select
- * @param int $filtertype Not used
- * @param int $addempty Add an empty entry
- * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
- * @param string $morecss Add more CSS on select tag
- * @return void
+ * @param int $selected Id of payment term to preselect by default
+ * @param string $htmlname Nom de la zone select
+ * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
+ * @param int $addempty Add an empty entry
+ * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
+ * @param string $morecss Add more CSS on select tag
+ * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
+ * 0 : use default deposit percentage from entry
+ * > 0 : force deposit percentage (for example, from company object)
+ * @return void
*/
- public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '')
+ public function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1)
{
// phpcs:enable
- print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss);
+ print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, $noinfoadmin, $morecss, $deposit_percent = -1);
}
/**
- * Return list of payment modes.
- * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
- * See instead to force the default value by the caller.
+ * Return list of payment modes.
+ * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
+ * See instead to force the default value by the caller.
*
- * @param int $selected Id of payment term to preselect by default
- * @param string $htmlname Nom de la zone select
- * @param int $filtertype Not used
- * @param int $addempty Add an empty entry
- * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
- * @param string $morecss Add more CSS on select tag
- * @return void
+ * @param int $selected Id of payment term to preselect by default
+ * @param string $htmlname Nom de la zone select
+ * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
+ * @param int $addempty Add an empty entry
+ * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
+ * @param string $morecss Add more CSS on select tag
+ * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
+ * 0 : use default deposit percentage from entry
+ * > 0 : force deposit percentage (for example, from company object)
+ * @return string
*/
- public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '')
+ public function getSelectConditionsPaiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '', $deposit_percent = -1)
{
global $langs, $user, $conf;
@@ -4041,20 +4048,59 @@ class Form
if ($addempty) {
$out.= '';
}
+
+ $selectedDepositPercent = null;
+
foreach ($this->cache_conditions_paiements as $id => $arrayconditions) {
- if ($selected == $id) {
- $out.= '';
+
+ if ($selected == $id) {
+ $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent'];
+ $out .= '';
}
$out.= '';
if ($user->admin && empty($noinfoadmin)) {
$out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
$out.= ajax_combobox($htmlname);
+
+ if ($deposit_percent >= 0) {
+ $out .= ' ';
+ $out .= $langs->trans('DepositPercent') . ' : ';
+ $out .= '';
+ $out .= '';
+ $out .= '
+ ';
+ }
+
return $out;
}
@@ -5009,8 +5055,8 @@ class Form
$autoOpen = false;
$dialogconfirm .= '-'.$button;
}
- $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.$action.'&confirm=yes';
- $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'confirm=no' : '');
+ $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes';
+ $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : '');
// Add input fields into list of fields to read during submit (inputok and inputko)
if (is_array($formquestion)) {
@@ -5245,14 +5291,18 @@ class Form
/**
* Show a form to select payment conditions
*
- * @param int $page Page
- * @param string $selected Id condition pre-selectionne
- * @param string $htmlname Name of select html field
- * @param int $addempty Add empty entry
- * @param string $type Type ('direct-debit' or 'bank-transfer')
+ * @param int $page Page
+ * @param string $selected Id condition pre-selectionne
+ * @param string $htmlname Name of select html field
+ * @param int $addempty Add empty entry
+ * @param string $type Type ('direct-debit' or 'bank-transfer')
+ * @param int $filtertype If > 0, include payment terms with deposit percentage (for objects other than invoices and invoice templates)
+ * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
+ * 0 : use default deposit percentage from entry
+ * > 0 : force deposit percentage (for example, from company object)
* @return void
*/
- public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '')
+ public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1)
{
// phpcs:enable
global $langs;
@@ -5263,14 +5313,20 @@ class Form
if ($type) {
print '';
}
- $this->select_conditions_paiements($selected, $htmlname, -1, $addempty, 0, '');
+ $this->select_conditions_paiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
print '';
print '';
} else {
if ($selected) {
$this->load_cache_conditions_paiements();
if (isset($this->cache_conditions_paiements[$selected])) {
- print $this->cache_conditions_paiements[$selected]['label'];
+ $label = $this->cache_conditions_paiements[$selected]['label'];
+
+ if (! empty($this->cache_conditions_paiements[$selected]['deposit_percent'])) {
+ $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label);
+ }
+
+ print $label;
} else {
$langs->load('errors');
print $langs->trans('ErrorNotInDictionaryPaymentConditions');
@@ -8223,10 +8279,11 @@ class Form
* @param string $htmlname Name of HTML field
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
* @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage);
+ * @param string $pos position colon on liste value left or right
* @return string HTML multiselect string
* @see selectarray()
*/
- public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
+ public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage, $pos = '')
{
global $conf, $langs, $user, $extrafields;
@@ -8293,7 +8350,7 @@ class Form
-
+
'.$listoffieldsforselection.'
@@ -9384,13 +9441,19 @@ class Form
/**
* Return HTML to show the search and clear seach button
*
+ * @param string $pos position colon on liste value left or right
* @return string
*/
- public function showFilterButtons()
+ public function showFilterButtons($pos = '')
{
$out = '
'.$langs->trans("SomeTranslationAreUncomplete").'';
// If there's no error, we display the next step button
if ($err == 0) {
diff --git a/htdocs/install/mysql/data/llx_c_partnership_type.sql b/htdocs/install/mysql/data/llx_c_partnership_type-partnership.sql
similarity index 100%
rename from htdocs/install/mysql/data/llx_c_partnership_type.sql
rename to htdocs/install/mysql/data/llx_c_partnership_type-partnership.sql
diff --git a/htdocs/install/mysql/data/llx_c_payment_term.sql b/htdocs/install/mysql/data/llx_c_payment_term.sql
index b5ff008912b..5a48e57a443 100644
--- a/htdocs/install/mysql/data/llx_c_payment_term.sql
+++ b/htdocs/install/mysql/data/llx_c_payment_term.sql
@@ -26,17 +26,18 @@
-- Do not include comments at end of line, this file is parsed during install and string '--' are removed.
--
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (1 ,'RECEP', 1,1, 'Due upon receipt','Due upon receipt',0,1);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (2 ,'30D', 2,1, '30 days','Due in 30 days',0,30);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (3 ,'30DENDMONTH', 3,1, '30 days end of month','Due in 30 days, end of month',1,30);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (4 ,'60D', 4,1, '60 days','Due in 60 days, end of month',0,60);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (5 ,'60DENDMONTH', 5,1, '60 days end of month','Due in 60 days, end of month',1,60);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (6 ,'PT_ORDER', 6,1, 'Due on order','Due on order',0,1);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (7 ,'PT_DELIVERY', 7,1, 'Due on delivery','Due on delivery',0,1);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (8 ,'PT_5050', 8,1, '50 and 50','50% on order, 50% on delivery',0,1);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (1 ,'RECEP', 1,1, 'Due upon receipt','Due upon receipt',0,1,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (2 ,'30D', 2,1, '30 days','Due in 30 days',0,30,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (3 ,'30DENDMONTH', 3,1, '30 days end of month','Due in 30 days, end of month',1,30,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (4 ,'60D', 4,1, '60 days','Due in 60 days, end of month',0,60,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (5 ,'60DENDMONTH', 5,1, '60 days end of month','Due in 60 days, end of month',1,60,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (6 ,'PT_ORDER', 6,1, 'Due on order','Due on order',0,1,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (7 ,'PT_DELIVERY', 7,1, 'Due on delivery','Due on delivery',0,1,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (8 ,'PT_5050', 8,1, '50 and 50','50% on order, 50% on delivery',0,1,NULL);
-- Add additional payment terms often needed in Austria
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (9 ,'10D', 9,1, '10 days','Due in 10 days',0,10);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (10,'10DENDMONTH', 10,1, '10 days end of month','Due in 10 days, end of month',1,10);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (11,'14D', 11,1, '14 days','Due in 14 days',0,14);
-insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour) values (12,'14DENDMONTH', 12,1, '14 days end of month','Due in 14 days, end of month',1,14);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (9 ,'10D', 9,1, '10 days','Due in 10 days',0,10,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (10,'10DENDMONTH', 10,1, '10 days end of month','Due in 10 days, end of month',1,10,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (11,'14D', 11,1, '14 days','Due in 14 days',0,14,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (12,'14DENDMONTH', 12,1, '14 days end of month','Due in 14 days, end of month',1,14,NULL);
+insert into llx_c_payment_term(rowid, code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values (13,'DEP30PCTDEL', 13,0, '__DEPOSIT_PERCENT__% deposit','__DEPOSIT_PERCENT__% deposit, remainder on delivery',0,1,'30');
diff --git a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
index 7355f1d8987..a945f078bbb 100644
--- a/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
+++ b/htdocs/install/mysql/migration/14.0.0-15.0.0.sql
@@ -546,6 +546,9 @@ CREATE TABLE llx_element_tag
import_key varchar(14)
)ENGINE=innodb;
+ALTER TABLE llx_element_tag ADD COLUMN fk_categorie integer;
+ALTER TABLE llx_element_tag ADD COLUMN fk_element integer;
+
ALTER TABLE llx_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element);
ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index daa0e755865..501aa0fe751 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -105,6 +105,8 @@ ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL;
-- v16
+ALTER TABLE llx_societe_account DROP FOREIGN KEY llx_societe_account_fk_website;
+
UPDATE llx_cronjob set label = 'RecurringInvoicesJob' where label = 'RecurringInvoices';
UPDATE llx_cronjob set label = 'RecurringSupplierInvoicesJob' where label = 'RecurringSupplierInvoices';
@@ -325,6 +327,15 @@ UPDATE llx_c_availability SET type_duration = 'w', qty = 2 WHERE code = 'AV_2W';
UPDATE llx_c_availability SET type_duration = 'w', qty = 3 WHERE code = 'AV_3W';
UPDATE llx_c_availability SET type_duration = 'w', qty = 4 WHERE code = 'AV_4W';
+
+-- Deposit generation helper with specific payment terms
+ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage;
+ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement;
+ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
+ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
+INSERT INTO llx_c_payment_term(code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values ('DEP30PCTDEL', 13, 0, '__DEPOSIT_PERCENT__% deposit', '__DEPOSIT_PERCENT__% deposit, remainder on delivery', 0, 1, '30');
+
+
ALTER TABLE llx_boxes_def ADD COLUMN fk_user integer DEFAULT 0 NOT NULL;
ALTER TABLE llx_contratdet ADD COLUMN rang integer DEFAULT 0 AFTER info_bits;
@@ -344,3 +355,10 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
+
+ALTER TABLE llx_c_email_template ADD COLUMN email_from varchar(255);
+ALTER TABLE llx_c_email_template ADD COLUMN email_to varchar(255);
+ALTER TABLE llx_c_email_template ADD COLUMN email_tocc varchar(255);
+ALTER TABLE llx_c_email_template ADD COLUMN email_tobcc varchar(255);
+
+
diff --git a/htdocs/install/mysql/tables/llx_c_email_templates.sql b/htdocs/install/mysql/tables/llx_c_email_templates.sql
index 04130a208fe..4d22767bc58 100644
--- a/htdocs/install/mysql/tables/llx_c_email_templates.sql
+++ b/htdocs/install/mysql/tables/llx_c_email_templates.sql
@@ -32,6 +32,10 @@ create table llx_c_email_templates
position smallint, -- Position
enabled varchar(255) DEFAULT '1', -- Condition to have this module visible
active tinyint DEFAULT 1 NOT NULL,
+ email_from varchar(255), -- default email from
+ email_to varchar(255), -- default email to
+ email_tocc varchar(255), -- default email to cc
+ email_tobcc varchar(255), -- default email to bcc
topic text, -- Predefined topic
joinfiles text, -- Files to attach
content mediumtext, -- Predefined text
diff --git a/htdocs/install/mysql/tables/llx_c_payment_term.sql b/htdocs/install/mysql/tables/llx_c_payment_term.sql
index 087ab63c184..e7b2b606b65 100644
--- a/htdocs/install/mysql/tables/llx_c_payment_term.sql
+++ b/htdocs/install/mysql/tables/llx_c_payment_term.sql
@@ -30,6 +30,7 @@ create table llx_c_payment_term
type_cdr tinyint, -- Type of change date reckoning. 1=Payment at end of current month, 2=the Nth of next month
nbjour smallint,
decalage smallint,
+ deposit_percent varchar(63) DEFAULT NULL,
module varchar(32) NULL,
position integer NOT NULL DEFAULT 0
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql
index 5b8a78c7bf8..94b1f38227d 100644
--- a/htdocs/install/mysql/tables/llx_commande.sql
+++ b/htdocs/install/mysql/tables/llx_commande.sql
@@ -63,6 +63,7 @@ create table llx_commande
fk_account integer, -- bank account
fk_currency varchar(3), -- currency code
fk_cond_reglement integer, -- condition de reglement
+ deposit_percent varchar(63) DEFAULT NULL, -- default deposit % if payment term needs it
fk_mode_reglement integer, -- mode de reglement
date_livraison datetime default NULL,
diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql
index 3499a51e8b8..a8f0aa3e2c9 100644
--- a/htdocs/install/mysql/tables/llx_propal.sql
+++ b/htdocs/install/mysql/tables/llx_propal.sql
@@ -58,6 +58,7 @@ create table llx_propal
fk_account integer, -- bank account
fk_currency varchar(3), -- currency code
fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...)
+ deposit_percent varchar(63) DEFAULT NULL, -- default deposit % if payment term needs it
fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement)
online_sign_ip varchar(48),
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 659616a3307..3c2f8a67be1 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -84,6 +84,7 @@ create table llx_societe
remise_supplier real DEFAULT 0, -- discount by default granted by this supplier
mode_reglement tinyint, -- payment mode customer
cond_reglement tinyint, -- payment term customer
+ deposit_percent varchar(63) DEFAULT NULL, -- default deposit % if payment term needs it
transport_mode tinyint, -- transport mode customer (Intracomm report)
mode_reglement_supplier tinyint, -- payment mode supplier
cond_reglement_supplier tinyint, -- payment term supplier
diff --git a/htdocs/install/mysql/tables/llx_societe_account.key.sql b/htdocs/install/mysql/tables/llx_societe_account.key.sql
index e86c12aa306..e889a38d527 100644
--- a/htdocs/install/mysql/tables/llx_societe_account.key.sql
+++ b/htdocs/install/mysql/tables/llx_societe_account.key.sql
@@ -25,6 +25,8 @@ ALTER TABLE llx_societe_account ADD INDEX idx_societe_account_fk_soc (fk_soc);
ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_login_website_soc(entity, fk_soc, login, site, fk_website);
ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_key_account_soc(entity, fk_soc, key_account, site, fk_website);
-ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
+-- Table website does not always exists
+--ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid);
+
ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
diff --git a/htdocs/install/pgsql/functions/functions-don.sql b/htdocs/install/pgsql/functions/functions-don.sql
new file mode 100644
index 00000000000..a1a51b57e6d
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-don.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-loan.sql b/htdocs/install/pgsql/functions/functions-loan.sql
new file mode 100644
index 00000000000..d63e394e5c9
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-loan.sql
@@ -0,0 +1,19 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-mailing.sql b/htdocs/install/pgsql/functions/functions-mailing.sql
new file mode 100644
index 00000000000..d45d620399f
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-mailing.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-opensurvey.sql b/htdocs/install/pgsql/functions/functions-opensurvey.sql
new file mode 100644
index 00000000000..d42a8311cb2
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-opensurvey.sql
@@ -0,0 +1,21 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_sondage FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_user_studs FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-partnership.sql b/htdocs/install/pgsql/functions/functions-partnership.sql
new file mode 100644
index 00000000000..61e991e1197
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-partnership.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_partnership FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_partnership_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/pgsql/functions/functions-recruitment.sql b/htdocs/install/pgsql/functions/functions-recruitment.sql
new file mode 100644
index 00000000000..9fa6023be1a
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-recruitment.sql
@@ -0,0 +1,23 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+
diff --git a/htdocs/install/pgsql/functions/functions-website.sql b/htdocs/install/pgsql/functions/functions-website.sql
new file mode 100644
index 00000000000..a5597837466
--- /dev/null
+++ b/htdocs/install/pgsql/functions/functions-website.sql
@@ -0,0 +1,21 @@
+-- ============================================================================
+-- Copyright (C) 2010 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ============================================================================
+
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index d73678bcbab..35bc4e05c11 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -100,9 +100,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_contratdet_extrafiel
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_contratdet_log FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_subscription FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_files FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -126,19 +123,13 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter FOR EACH R
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinterdet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_delivery FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_menu FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_production FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_sondage FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_user_studs FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiementcharge FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_paiementfourn FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -165,10 +156,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propal_extrafields F
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propal_merge_pdf_product FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propaldet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_resource FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentjobposition_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_recruitment_recruitmentcandidature_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -187,5 +174,3 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EX
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
-CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index 63b8d66539b..9613e1a86b5 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -261,6 +261,7 @@ if (!$error) {
$error++;
}
}
+
// If we need simple access
if (!$error && (empty($db_create_database) && empty($db_create_user))) {
$db = getDoliDBInstance($db_type, $db_host, $db_user, $db_pass, $db_name, $db_port);
diff --git a/htdocs/install/step4.php b/htdocs/install/step4.php
index e1890656f4b..c8be975c19f 100644
--- a/htdocs/install/step4.php
+++ b/htdocs/install/step4.php
@@ -82,9 +82,9 @@ if ($db->ok) {
print '
';
print '
';
print '
';
- print '
';
+ print '';
print '
';
- print '
';
+ print '';
print '';
if (isset($_GET["error"]) && $_GET["error"] == 1) {
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index 924d251702c..fa5a9041674 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -167,20 +167,25 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
}
$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
- // Chargement config
- if (!$error) {
- $conf->setValues($db);
- // Reset forced setup after the setValues
- if (defined('SYSLOG_FILE')) {
- $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
- }
- $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
- }
+ // Load global conf
+ $conf->setValues($db);
+
+
+ $listofentities = array(1);
// Create the global $hookmanager object
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
- $hookmanager->initHooks(array('upgrade'));
+ $hookmanager->initHooks(array('upgrade2'));
+
+ $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto);
+ $object = new stdClass();
+ $action = "upgrade";
+ $reshook = $hookmanager->executeHooks('doUpgradeBefore', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook >= 0 && is_array($hookmanager->resArray)) {
+ // Example: $hookmanager->resArray = array(2, 3, 10);
+ $listofentities = array_unique(array_merge($listofentities, $hookmanager->resArray));
+ }
/***************************************************************************************
@@ -188,385 +193,399 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
* Migration of data
*
***************************************************************************************/
+
+ // Force to execute this at begin to avoid the new core code into Dolibarr to be broken.
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN birth date';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN dateemployment date';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN dateemploymentend date';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN default_range integer';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN default_c_exp_tax_cat integer';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN langs varchar(24)';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN fieldcomputed text';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN fielddefault varchar(255)';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX."extrafields ADD COLUMN enabled varchar(255) DEFAULT '1'";
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN help text';
+ $db->query($sql, 1);
+ $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user_rights ADD COLUMN entity integer DEFAULT 1 NOT NULL';
+ $db->query($sql, 1);
+
+
$db->begin();
- if (!$error) {
- // Current version is $conf->global->MAIN_VERSION_LAST_UPGRADE
- // Version to install is DOL_VERSION
- $dolibarrlastupgradeversionarray = preg_split('/[\.-]/', isset($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_UPGRADE : (isset($conf->global->MAIN_VERSION_LAST_INSTALL) ? $conf->global->MAIN_VERSION_LAST_INSTALL : ''));
-
- // Chaque action de migration doit renvoyer une ligne sur 4 colonnes avec
- // dans la 1ere colonne, la description de l'action a faire
- // dans la 4eme colonne, le texte 'OK' si fait ou 'AlreadyDone' si rien n'est fait ou 'Error'
-
- $versiontoarray = explode('.', $versionto);
- $versionranarray = explode('.', DOL_VERSION);
-
-
- // Force to execute this at begin to avoid the new core code into Dolibarr to be broken.
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN birth date';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN dateemployment date';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN dateemploymentend date';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN default_range integer';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user ADD COLUMN default_c_exp_tax_cat integer';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN langs varchar(24)';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN fieldcomputed text';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN fielddefault varchar(255)';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX."extrafields ADD COLUMN enabled varchar(255) DEFAULT '1'";
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'extrafields ADD COLUMN help text';
- $db->query($sql, 1);
- $sql = 'ALTER TABLE '.MAIN_DB_PREFIX.'user_rights ADD COLUMN entity integer DEFAULT 1 NOT NULL';
- $db->query($sql, 1);
-
-
- $afterversionarray = explode('.', '2.0.0');
- $beforeversionarray = explode('.', '2.7.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- // Script pour V2 -> V2.1
- migrate_paiements($db, $langs, $conf);
-
- migrate_contracts_det($db, $langs, $conf);
-
- migrate_contracts_date1($db, $langs, $conf);
-
- migrate_contracts_date2($db, $langs, $conf);
-
- migrate_contracts_date3($db, $langs, $conf);
-
- migrate_contracts_open($db, $langs, $conf);
-
- migrate_modeles($db, $langs, $conf);
-
- migrate_price_propal($db, $langs, $conf);
-
- migrate_price_commande($db, $langs, $conf);
-
- migrate_price_commande_fournisseur($db, $langs, $conf);
-
- migrate_price_contrat($db, $langs, $conf);
-
- migrate_paiementfourn_facturefourn($db, $langs, $conf);
-
-
- // Script pour V2.1 -> V2.2
- migrate_paiements_orphelins_1($db, $langs, $conf);
-
- migrate_paiements_orphelins_2($db, $langs, $conf);
-
- migrate_links_transfert($db, $langs, $conf);
-
-
- // Script pour V2.2 -> V2.4
- migrate_commande_expedition($db, $langs, $conf);
-
- migrate_commande_livraison($db, $langs, $conf);
-
- migrate_detail_livraison($db, $langs, $conf);
-
-
- // Script pour V2.5 -> V2.6
- migrate_stocks($db, $langs, $conf);
-
-
- // Script pour V2.6 -> V2.7
- migrate_menus($db, $langs, $conf);
-
- migrate_commande_deliveryaddress($db, $langs, $conf);
-
- migrate_restore_missing_links($db, $langs, $conf);
-
- migrate_rename_directories($db, $langs, $conf, '/compta', '/banque');
-
- migrate_rename_directories($db, $langs, $conf, '/societe', '/mycompany');
+ foreach ($listofentities as $entity) {
+ // Set $conf context for entity
+ $conf->setEntityValues($db, $entity);
+ // Reset forced setup after the setValues
+ if (defined('SYSLOG_FILE')) {
+ $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
}
+ $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
- // Script for 2.8
- $afterversionarray = explode('.', '2.7.9');
- $beforeversionarray = explode('.', '2.8.9');
- //print $versionto.' '.versioncompare($versiontoarray,$afterversionarray).' '.versioncompare($versiontoarray,$beforeversionarray);
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_price_facture($db, $langs, $conf); // Code of this function works for 2.8+ because need a field tva_tx
+ if (!$error) {
+ if (count($listofentities) > 1) {
+ print '
*** '.$langs->trans("Entity").' '.$entity.'
'."\n";
+ }
- migrate_relationship_tables($db, $langs, $conf, 'co_exp', 'fk_commande', 'commande', 'fk_expedition', 'shipping');
+ // Current version is $conf->global->MAIN_VERSION_LAST_UPGRADE
+ // Version to install is DOL_VERSION
+ $dolibarrlastupgradeversionarray = preg_split('/[\.-]/', isset($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_UPGRADE : (isset($conf->global->MAIN_VERSION_LAST_INSTALL) ? $conf->global->MAIN_VERSION_LAST_INSTALL : ''));
- migrate_relationship_tables($db, $langs, $conf, 'pr_exp', 'fk_propal', 'propal', 'fk_expedition', 'shipping');
+ // Chaque action de migration doit renvoyer une ligne sur 4 colonnes avec
+ // dans la 1ere colonne, la description de l'action a faire
+ // dans la 4eme colonne, le texte 'OK' si fait ou 'AlreadyDone' si rien n'est fait ou 'Error'
- migrate_relationship_tables($db, $langs, $conf, 'pr_liv', 'fk_propal', 'propal', 'fk_livraison', 'delivery');
+ $versiontoarray = explode('.', $versionto);
+ $versionranarray = explode('.', DOL_VERSION);
- migrate_relationship_tables($db, $langs, $conf, 'co_liv', 'fk_commande', 'commande', 'fk_livraison', 'delivery');
- migrate_relationship_tables($db, $langs, $conf, 'co_pr', 'fk_propale', 'propal', 'fk_commande', 'commande');
+ $afterversionarray = explode('.', '2.0.0');
+ $beforeversionarray = explode('.', '2.7.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ // Script pour V2 -> V2.1
+ migrate_paiements($db, $langs, $conf);
- migrate_relationship_tables($db, $langs, $conf, 'fa_pr', 'fk_propal', 'propal', 'fk_facture', 'facture');
+ migrate_contracts_det($db, $langs, $conf);
- migrate_relationship_tables($db, $langs, $conf, 'co_fa', 'fk_commande', 'commande', 'fk_facture', 'facture');
+ migrate_contracts_date1($db, $langs, $conf);
- migrate_project_user_resp($db, $langs, $conf);
+ migrate_contracts_date2($db, $langs, $conf);
- migrate_project_task_actors($db, $langs, $conf);
- }
+ migrate_contracts_date3($db, $langs, $conf);
- // Script for 2.9
- $afterversionarray = explode('.', '2.8.9');
- $beforeversionarray = explode('.', '2.9.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_project_task_time($db, $langs, $conf);
+ migrate_contracts_open($db, $langs, $conf);
- migrate_customerorder_shipping($db, $langs, $conf);
+ migrate_modeles($db, $langs, $conf);
- migrate_shipping_delivery($db, $langs, $conf);
+ migrate_price_propal($db, $langs, $conf);
- migrate_shipping_delivery2($db, $langs, $conf);
- }
+ migrate_price_commande($db, $langs, $conf);
- // Script for 3.0
- $afterversionarray = explode('.', '2.9.9');
- $beforeversionarray = explode('.', '3.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- // No particular code
- }
+ migrate_price_commande_fournisseur($db, $langs, $conf);
- // Script for 3.1
- $afterversionarray = explode('.', '3.0.9');
- $beforeversionarray = explode('.', '3.1.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_rename_directories($db, $langs, $conf, '/rss', '/externalrss');
+ migrate_price_contrat($db, $langs, $conf);
- migrate_actioncomm_element($db, $langs, $conf);
- }
+ migrate_paiementfourn_facturefourn($db, $langs, $conf);
- // Script for 3.2
- $afterversionarray = explode('.', '3.1.9');
- $beforeversionarray = explode('.', '3.2.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_price_contrat($db, $langs, $conf);
- migrate_mode_reglement($db, $langs, $conf);
+ // Script pour V2.1 -> V2.2
+ migrate_paiements_orphelins_1($db, $langs, $conf);
- migrate_clean_association($db, $langs, $conf);
- }
+ migrate_paiements_orphelins_2($db, $langs, $conf);
- // Script for 3.3
- $afterversionarray = explode('.', '3.2.9');
- $beforeversionarray = explode('.', '3.3.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_categorie_association($db, $langs, $conf);
- }
+ migrate_links_transfert($db, $langs, $conf);
- // Script for 3.4
- // No specific scripts
- // Tasks to do always and only into last targeted version
- $afterversionarray = explode('.', '3.6.9'); // target is after this
- $beforeversionarray = explode('.', '3.7.9'); // target is before this
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_event_assignement($db, $langs, $conf);
- }
+ // Script pour V2.2 -> V2.4
+ migrate_commande_expedition($db, $langs, $conf);
- // Scripts for 3.9
- $afterversionarray = explode('.', '3.7.9');
- $beforeversionarray = explode('.', '3.8.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- // No particular code
- }
+ migrate_commande_livraison($db, $langs, $conf);
- // Scripts for 4.0
- $afterversionarray = explode('.', '3.9.9');
- $beforeversionarray = explode('.', '4.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_rename_directories($db, $langs, $conf, '/fckeditor', '/medias');
- }
+ migrate_detail_livraison($db, $langs, $conf);
- // Scripts for 5.0
- $afterversionarray = explode('.', '4.0.9');
- $beforeversionarray = explode('.', '5.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- // Migrate to add entity value into llx_societe_remise
- migrate_remise_entity($db, $langs, $conf);
- // Migrate to add entity value into llx_societe_remise_except
- migrate_remise_except_entity($db, $langs, $conf);
- }
+ // Script pour V2.5 -> V2.6
+ migrate_stocks($db, $langs, $conf);
- // Scripts for 6.0
- $afterversionarray = explode('.', '5.0.9');
- $beforeversionarray = explode('.', '6.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- if (!empty($conf->multicompany->enabled)) {
- global $multicompany_transverse_mode;
- // Only if the transverse mode is not used
- if (empty($multicompany_transverse_mode)) {
- // Migrate to add entity value into llx_user_rights
- migrate_user_rights_entity($db, $langs, $conf);
+ // Script pour V2.6 -> V2.7
+ migrate_menus($db, $langs, $conf);
- // Migrate to add entity value into llx_usergroup_rights
- migrate_usergroup_rights_entity($db, $langs, $conf);
+ migrate_commande_deliveryaddress($db, $langs, $conf);
+
+ migrate_restore_missing_links($db, $langs, $conf);
+
+ migrate_rename_directories($db, $langs, $conf, '/compta', '/banque');
+
+ migrate_rename_directories($db, $langs, $conf, '/societe', '/mycompany');
+ }
+
+ // Script for 2.8
+ $afterversionarray = explode('.', '2.7.9');
+ $beforeversionarray = explode('.', '2.8.9');
+ //print $versionto.' '.versioncompare($versiontoarray,$afterversionarray).' '.versioncompare($versiontoarray,$beforeversionarray);
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_price_facture($db, $langs, $conf); // Code of this function works for 2.8+ because need a field tva_tx
+
+ migrate_relationship_tables($db, $langs, $conf, 'co_exp', 'fk_commande', 'commande', 'fk_expedition', 'shipping');
+
+ migrate_relationship_tables($db, $langs, $conf, 'pr_exp', 'fk_propal', 'propal', 'fk_expedition', 'shipping');
+
+ migrate_relationship_tables($db, $langs, $conf, 'pr_liv', 'fk_propal', 'propal', 'fk_livraison', 'delivery');
+
+ migrate_relationship_tables($db, $langs, $conf, 'co_liv', 'fk_commande', 'commande', 'fk_livraison', 'delivery');
+
+ migrate_relationship_tables($db, $langs, $conf, 'co_pr', 'fk_propale', 'propal', 'fk_commande', 'commande');
+
+ migrate_relationship_tables($db, $langs, $conf, 'fa_pr', 'fk_propal', 'propal', 'fk_facture', 'facture');
+
+ migrate_relationship_tables($db, $langs, $conf, 'co_fa', 'fk_commande', 'commande', 'fk_facture', 'facture');
+
+ migrate_project_user_resp($db, $langs, $conf);
+
+ migrate_project_task_actors($db, $langs, $conf);
+ }
+
+ // Script for 2.9
+ $afterversionarray = explode('.', '2.8.9');
+ $beforeversionarray = explode('.', '2.9.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_project_task_time($db, $langs, $conf);
+
+ migrate_customerorder_shipping($db, $langs, $conf);
+
+ migrate_shipping_delivery($db, $langs, $conf);
+
+ migrate_shipping_delivery2($db, $langs, $conf);
+ }
+
+ // Script for 3.0
+ $afterversionarray = explode('.', '2.9.9');
+ $beforeversionarray = explode('.', '3.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ // No particular code
+ }
+
+ // Script for 3.1
+ $afterversionarray = explode('.', '3.0.9');
+ $beforeversionarray = explode('.', '3.1.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_rename_directories($db, $langs, $conf, '/rss', '/externalrss');
+
+ migrate_actioncomm_element($db, $langs, $conf);
+ }
+
+ // Script for 3.2
+ $afterversionarray = explode('.', '3.1.9');
+ $beforeversionarray = explode('.', '3.2.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_price_contrat($db, $langs, $conf);
+
+ migrate_mode_reglement($db, $langs, $conf);
+
+ migrate_clean_association($db, $langs, $conf);
+ }
+
+ // Script for 3.3
+ $afterversionarray = explode('.', '3.2.9');
+ $beforeversionarray = explode('.', '3.3.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_categorie_association($db, $langs, $conf);
+ }
+
+ // Script for 3.4
+ // No specific scripts
+
+ // Tasks to do always and only into last targeted version
+ $afterversionarray = explode('.', '3.6.9'); // target is after this
+ $beforeversionarray = explode('.', '3.7.9'); // target is before this
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_event_assignement($db, $langs, $conf);
+ }
+
+ // Scripts for 3.9
+ $afterversionarray = explode('.', '3.7.9');
+ $beforeversionarray = explode('.', '3.8.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ // No particular code
+ }
+
+ // Scripts for 4.0
+ $afterversionarray = explode('.', '3.9.9');
+ $beforeversionarray = explode('.', '4.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ migrate_rename_directories($db, $langs, $conf, '/fckeditor', '/medias');
+ }
+
+ // Scripts for 5.0
+ $afterversionarray = explode('.', '4.0.9');
+ $beforeversionarray = explode('.', '5.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ // Migrate to add entity value into llx_societe_remise
+ migrate_remise_entity($db, $langs, $conf);
+
+ // Migrate to add entity value into llx_societe_remise_except
+ migrate_remise_except_entity($db, $langs, $conf);
+ }
+
+ // Scripts for 6.0
+ $afterversionarray = explode('.', '5.0.9');
+ $beforeversionarray = explode('.', '6.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ if (!empty($conf->multicompany->enabled)) {
+ global $multicompany_transverse_mode;
+
+ // Only if the transverse mode is not used
+ if (empty($multicompany_transverse_mode)) {
+ // Migrate to add entity value into llx_user_rights
+ migrate_user_rights_entity($db, $langs, $conf);
+
+ // Migrate to add entity value into llx_usergroup_rights
+ migrate_usergroup_rights_entity($db, $langs, $conf);
+ }
}
}
- }
- // Scripts for 7.0
- $afterversionarray = explode('.', '6.0.9');
- $beforeversionarray = explode('.', '7.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- // Migrate contact association
- migrate_event_assignement_contact($db, $langs, $conf);
+ // Scripts for 7.0
+ $afterversionarray = explode('.', '6.0.9');
+ $beforeversionarray = explode('.', '7.0.9');
+ if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
+ // Migrate contact association
+ migrate_event_assignement_contact($db, $langs, $conf);
- migrate_reset_blocked_log($db, $langs, $conf);
- }
-
- // Scripts for 8.0
- $afterversionarray = explode('.', '7.0.9');
- $beforeversionarray = explode('.', '8.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_rename_directories($db, $langs, $conf, '/contracts', '/contract');
- }
-
- // Scripts for 9.0
- $afterversionarray = explode('.', '8.0.9');
- $beforeversionarray = explode('.', '9.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_user_photospath();
- }
-
- // Scripts for 11.0
- $afterversionarray = explode('.', '10.0.9');
- $beforeversionarray = explode('.', '11.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_users_socialnetworks();
- migrate_members_socialnetworks();
- migrate_contacts_socialnetworks();
- migrate_thirdparties_socialnetworks();
- }
-
- // Scripts for 14.0
- $afterversionarray = explode('.', '13.0.9');
- $beforeversionarray = explode('.', '14.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_export_import_profiles('export');
- migrate_export_import_profiles('import');
- }
-
- // Scripts for 16.0
- $afterversionarray = explode('.', '15.0.9');
- $beforeversionarray = explode('.', '16.0.9');
- if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) {
- migrate_user_photospath2();
- }
- }
-
-
- // Code executed only if migration is LAST ONE. Must always be done.
- if (versioncompare($versiontoarray, $versionranarray) >= 0 || versioncompare($versiontoarray, $versionranarray) <= -3) {
- // Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
- $listofmodule = array(
- 'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
- 'MAIN_MODULE_AGENDA'=>'newboxdefonly',
- 'MAIN_MODULE_BOM'=>'menuonly',
- 'MAIN_MODULE_BANQUE'=>'menuonly',
- 'MAIN_MODULE_BARCODE'=>'newboxdefonly',
- 'MAIN_MODULE_CRON'=>'newboxdefonly',
- 'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
- 'MAIN_MODULE_BLOCKEDLOG'=>'noboxes',
- 'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
- 'MAIN_MODULE_DON'=>'newboxdefonly',
- 'MAIN_MODULE_ECM'=>'newboxdefonly',
- 'MAIN_MODULE_EXTERNALSITE'=>'newboxdefonly',
- 'MAIN_MODULE_EXPENSEREPORT'=>'newboxdefonly',
- 'MAIN_MODULE_FACTURE'=>'newboxdefonly',
- 'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
- 'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
- 'MAIN_MODULE_MARGIN'=>'menuonly',
- 'MAIN_MODULE_MRP'=>'menuonly',
- 'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
- 'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
- 'MAIN_MODULE_PRINTING'=>'newboxdefonly',
- 'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
- 'MAIN_MODULE_RECRUITMENT'=>'menuonly',
- 'MAIN_MODULE_RESOURCE'=>'noboxes',
- 'MAIN_MODULE_SALARIES'=>'newboxdefonly',
- 'MAIN_MODULE_SERVICE'=>'newboxdefonly',
- 'MAIN_MODULE_SYSLOG'=>'newboxdefonly',
- 'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
- 'MAIN_MODULE_STRIPE'=>'menuonly',
- 'MAIN_MODULE_TICKET'=>'newboxdefonly',
- 'MAIN_MODULE_TAKEPOS'=>'newboxdefonly',
- 'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
- 'MAIN_MODULE_VARIANTS'=>'newboxdefonly',
- 'MAIN_MODULE_WEBSITE'=>'newboxdefonly',
- );
-
- $result = migrate_reload_modules($db, $langs, $conf, $listofmodule);
- if ($result < 0) {
- $error++;
- }
- // Reload menus (this must be always and only into last targeted version)
- $result = migrate_reload_menu($db, $langs, $conf);
- if ($result < 0) {
- $error++;
- }
- }
-
- // Can force activation of some module during migration with parameter 'enablemodules=MAIN_MODULE_XXX,MAIN_MODULE_YYY,...'
- // In most cases (online install or upgrade) $enablemodules is empty. Can be forced when ran from command line.
- if (!$error && $enablemodules) {
- // Reload modules (this must be always done and only into last targeted version)
- $listofmodules = array();
- $enablemodules = preg_replace('/enablemodules=/', '', $enablemodules);
- $tmplistofmodules = explode(',', $enablemodules);
- foreach ($tmplistofmodules as $value) {
- $listofmodules[$value] = 'forceactivate';
- }
-
- $resultreloadmodules = migrate_reload_modules($db, $langs, $conf, $listofmodules, 1);
- if ($resultreloadmodules < 0) {
- $error++;
- }
- }
-
-
- // Can call a dedicated external upgrade process
- if (!$error) {
- $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto);
- $object = new stdClass();
- $action = "upgrade";
- $reshook = $hookmanager->executeHooks('doUpgrade2', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
- if ($hookmanager->resNbOfHooks > 0) {
- if ($reshook < 0) {
- print '
';
+ migrate_reset_blocked_log($db, $langs, $conf);
}
- } else {
- //if (! empty($conf->modules))
- if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done
- print '
';
+ }
+ } else {
+ //if (! empty($conf->modules))
+ if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done
+ print '
';
+ }
}
}
}
print '';
-
if (!$error) {
// Set constant to ask to remake a new ping to inform about upgrade (if first ping was done and OK)
$sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'";
@@ -576,23 +595,68 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
// We always commit.
// Process is designed so we can run it several times whatever is situation.
$db->commit();
+
+
+ /***************************************************************************************
+ *
+ * Migration of files
+ *
+ ***************************************************************************************/
+
+ foreach ($listofentities as $entity) {
+ // Set $conf context for entity
+ $conf->setEntityValues($db, $entity);
+ // Reset forced setup after the setValues
+ if (defined('SYSLOG_FILE')) {
+ $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE');
+ }
+ $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
+
+
+ // Copy directory medias
+ $srcroot = DOL_DOCUMENT_ROOT.'/install/medias';
+ $destroot = DOL_DATA_ROOT.'/medias';
+ dolCopyDir($srcroot, $destroot, 0, 0);
+
+
+ // Actions for all versions (no database change but delete some files and directories)
+ migrate_delete_old_files($db, $langs, $conf);
+ migrate_delete_old_dir($db, $langs, $conf);
+ // Actions for all versions (no database change but create some directories)
+ dol_mkdir(DOL_DATA_ROOT.'/bank');
+ // Actions for all versions (no database change but rename some directories)
+ migrate_rename_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits');
+
+
+ $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto, 'conf'=>$conf);
+ $object = new stdClass();
+ $action = "upgrade";
+ $reshook = $hookmanager->executeHooks('doUpgradeAfterFiles', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+ if ($hookmanager->resNbOfHooks > 0) {
+ if ($reshook < 0) {
+ print '
';
+ }
+ } else {
+ //if (! empty($conf->modules))
+ if (!empty($conf->modules_parts['hooks'])) { // If there is at least one module with one hook, we show message to say nothing was done
+ print '
';
+ }
+ }
+ }
+
$db->close();
-
- // Copy directory medias
- $srcroot = DOL_DOCUMENT_ROOT.'/install/medias';
- $destroot = DOL_DATA_ROOT.'/medias';
- dolCopyDir($srcroot, $destroot, 0, 0);
-
-
- // Actions for all versions (no database change but delete some files and directories)
- migrate_delete_old_files($db, $langs, $conf);
- migrate_delete_old_dir($db, $langs, $conf);
- // Actions for all versions (no database change but create some directories)
- dol_mkdir(DOL_DATA_ROOT.'/bank');
- // Actions for all versions (no database change but rename some directories)
- migrate_rename_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits');
-
$silent = 0;
if (!$silent) {
print '
';
@@ -4560,7 +4624,7 @@ function migrate_user_photospath2()
if ($entity > 1) {
$dir = DOL_DATA_ROOT.'/'.$entity.'/users';
} else {
- $dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module
+ $dir = DOL_DATA_ROOT.'/users';
}
if ($dir) {
diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php
index feadd8d9800..b644546d8b9 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_list.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_list.php
@@ -189,7 +189,7 @@ if (empty($reshook)) {
$search[$key.'_dtend'] = '';
}
}
- $toselect = '';
+ $toselect = array();
$search_array_options = array();
}
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 8283da55f41..0f85c4b1c33 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -182,6 +182,7 @@ DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations
ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions
ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT=Accounting account by default to register customer deposit
+UseAuxiliaryAccountOnCustomerDeposit=Use sub-accounts on customer deposit lines
ACCOUNTING_PRODUCT_BUY_ACCOUNT=Accounting account by default for the bought products (used if not defined in the product sheet)
ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT=Accounting account by default for the bought products in EEC (used if not defined in the product sheet)
@@ -289,7 +290,7 @@ 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
-MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s | Credit = %s
+MvtNotCorrectlyBalanced=Movement not correctly balanced. Debit = %s & Credit = %s
Balancing=Balancing
FicheVentilation=Binding card
GeneralLedgerIsWritten=Transactions are written in the Ledger
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 69dfc6bd478..352db2e0910 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -718,7 +718,8 @@ Permission34=Delete products
Permission36=See/manage hidden products
Permission38=Export products
Permission39=Ignore minimum price
-Permission41=Read projects and tasks (shared project and projects I'm contact for). Can also enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
+Permission41=Read projects and tasks (shared project and projects I'm contact for).
+Permission145=Can enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
Permission42=Create/modify projects (shared project and projects I'm contact for). Can also create tasks and assign users to project and tasks
Permission44=Delete projects (shared project and projects I'm contact for)
Permission45=Export projects
@@ -2252,3 +2253,4 @@ HashForPing=Hash used for ping
ReadOnlyMode=Is instance in "Read Only" mode
DEBUGBAR_USE_LOG_FILE=Use the dolibarr.log file to trap Logs
UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended.
+FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
\ No newline at end of file
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index a70d2eb8f21..22ca3f4cec1 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -429,10 +429,19 @@ PaymentConditionShort14D=14 days
PaymentCondition14D=14 days
PaymentConditionShort14DENDMONTH=14 days of month-end
PaymentCondition14DENDMONTH=Within 14 days following the end of the month
+PaymentConditionShortDEP30PCTDEL=__DEPOSIT_PERCENT__%% deposit
+PaymentConditionDEP30PCTDEL=__DEPOSIT_PERCENT__%% deposit, remainder on delivery
FixAmount=Fixed amount - 1 line with label '%s'
VarAmount=Variable amount (%% tot.)
VarAmountOneLine=Variable amount (%% tot.) - 1 line with label '%s'
VarAmountAllLines=Variable amount (%% tot.) - all lines from origin
+DepositPercent=Deposit %%
+DepositGenerationPermittedByThePaymentTermsSelected=This is permitted by the payment terms selected
+GenerateDeposit=Generate a %s%% deposit invoice
+ValidateGeneratedDeposit=Validate the generated deposit
+DepositGenerated=Deposit generated
+ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder=You can only automatically generate a deposit from a proposal or an order
+ErrorPaymentConditionsNotEligibleToDepositCreation=The chose payment conditions are not eligible for automatic deposit generation
# PaymentType
PaymentTypeVIR=Bank transfer
PaymentTypeShortVIR=Bank transfer
diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang
index 989f6aa9793..9d76ad15d43 100644
--- a/htdocs/langs/en_US/install.lang
+++ b/htdocs/langs/en_US/install.lang
@@ -8,6 +8,7 @@ ConfFileIsNotWritable=Configuration file %s is not writable. Check permis
ConfFileIsWritable=Configuration file %s is writable.
ConfFileMustBeAFileNotADir=Configuration file %s must be a file, not a directory.
ConfFileReload=Reloading parameters from configuration file.
+NoReadableConfFileSoStartInstall=The configuration file conf/conf.php does not exists or is not reabable. We will run the installation process to try to initialize it.
PHPSupportPOSTGETOk=This PHP supports variables POST and GET.
PHPSupportPOSTGETKo=It's possible your PHP setup does not support variables POST and/or GET. Check the parameter variables_order in php.ini.
PHPSupportSessions=This PHP supports sessions.
@@ -16,13 +17,6 @@ PHPMemoryOK=Your PHP max session memory is set to %s. This should be enou
PHPMemoryTooLow=Your PHP max session memory is set to %s bytes. This is too low. Change your php.ini to set memory_limit parameter to at least %s bytes.
Recheck=Click here for a more detailed test
ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions. This feature is required to allow Dolibarr to work. Check your PHP setup and permissions of the sessions directory.
-ErrorPHPDoesNotSupportGD=Your PHP installation does not support GD graphical functions. No graphs will be available.
-ErrorPHPDoesNotSupportCurl=Your PHP installation does not support Curl.
-ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions.
-ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr.
-ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions.
-ErrorPHPDoesNotSupportMbstring=Your PHP installation does not support mbstring functions.
-ErrorPHPDoesNotSupportxDebug=Your PHP installation does not support extend debug functions.
ErrorPHPDoesNotSupport=Your PHP installation does not support %s functions.
ErrorDirDoesNotExists=Directory %s does not exist.
ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters.
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index 2d8ef240ef1..4b38515924b 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -424,3 +424,6 @@ PMPExpected=Expected PMP
ExpectedValuation=Expected Valuation
PMPReal=Real PMP
RealValuation=Real Valuation
+ConfirmEditExtrafield = Select the extrafield you want modify
+ConfirmEditExtrafieldQuestion = Are you sure you want to modify this extrafield?
+ModifyValueExtrafields = Modify value of an extrafield
diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang
index fa9e2203eea..4c3ee5f939f 100644
--- a/htdocs/langs/fr_FR/accountancy.lang
+++ b/htdocs/langs/fr_FR/accountancy.lang
@@ -289,7 +289,7 @@ ValidateHistory=Lier automatiquement
AutomaticBindingDone=Liaisons automatiques effectuées (%s) - Liaison automatique impossible pour certains enregistrements (%s)
ErrorAccountancyCodeIsAlreadyUse=Erreur, vous ne pouvez pas détruire de compte comptable car il est utilisé
-MvtNotCorrectlyBalanced=Mouvement non équilibré. Débit = %s| Crédit = %s
+MvtNotCorrectlyBalanced=Mouvement non équilibré. Débit = %s & Crédit = %s
Balancing=Équilibrage
FicheVentilation=Fiche lien
GeneralLedgerIsWritten=Les transactions sont enregistrées dans le grand livre
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 034f105f6d8..8aa317ca305 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -718,7 +718,8 @@ Permission34=Supprimer les produits
Permission36=Voir/gérer les produits cachés
Permission38=Exporter les produits
Permission39=Ignorer le prix minimum
-Permission41=Lire les projets et tâches (partagés ou dont vous n'êtes pas contact). Permet la saisie de temps passé, pour vous-même et votre hiérarchie (vos subordonnés), sur les tâches assignées (Feuilles de temps).
+Permission41=Lire les projets et tâches (partagés ou dont vous n'êtes pas contact).
+Permission145=Permet la saisie de temps passé, pour vous-même et votre hiérarchie (vos subordonnés), sur les tâches assignées (Feuilles de temps).
Permission42=Créer/modifier les projets (projets partagés et projets pour lesquels je suis contact). Permet aussi de créer des tâches et d'assigner des utilisateurs aux projets et tâches.
Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact)
Permission45=Exporter les projets
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 7e2cb072913..21218f099fe 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2083,6 +2083,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
print "\n"; // end div class="login_block"
print '';
+ //print '';
print '';
print "\n\n";
@@ -2149,7 +2150,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
$dropdownBody .= ' '.$langs->transcountry("ProfId6", $mysoc->country_code).': '.dol_print_profids(getDolGlobalString("MAIN_INFO_PROFID6"), 6).'';
}
$dropdownBody .= ' '.$langs->trans("VATIntraShort").': '.dol_print_profids(getDolGlobalString("MAIN_INFO_TVAINTRA"), 'VAT').'';
- $dropdownBody .= ' '.$langs->trans("Country").': '.$langs->trans("Country".$mysoc->country_code).'';
+ $dropdownBody .= ' '.$langs->trans("Country").': '.($mysoc->country_code ? $langs->trans("Country".$mysoc->country_code) : '').'';
$dropdownBody .= '';
diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php
index 01a02d0c7dd..e7c42578bd6 100644
--- a/htdocs/modulebuilder/admin/setup.php
+++ b/htdocs/modulebuilder/admin/setup.php
@@ -89,7 +89,8 @@ if (preg_match('/del_(.*)/', $action, $reg)) {
$form = new Form($db);
-llxHeader('', $langs->trans("ModulebuilderSetup"));
+$help_url = '';
+llxHeader('', $langs->trans("ModulebuilderSetup"), $help_url);
$linkback = ''.$langs->trans("BackToModuleList").'';
diff --git a/htdocs/modulebuilder/template/admin/myobject_extrafields.php b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
index 5ce224c8528..e5ed6469fa2 100644
--- a/htdocs/modulebuilder/template/admin/myobject_extrafields.php
+++ b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
@@ -91,6 +91,8 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
+$textobject = $langs->transnoentitiesnoconv("MyObject");
+
$help_url = '';
$page_name = "MyModuleSetup";
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index fe92596d228..84b394da808 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -531,7 +531,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
$constforvar = 'MYMODULE_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index d843687157a..b6327e230fb 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -428,7 +428,7 @@ class modMyModule extends DolibarrModules
{
global $conf, $langs;
- //$result = $this->_load_tables('/install/mysql/tables/', 'mymodule');
+ //$result = $this->_load_tables('/install/mysql/', 'mymodule');
$result = $this->_load_tables('/mymodule/sql/');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 8771ad0f9b6..9638eb4ce7f 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -811,7 +811,7 @@ if ($num == 0) {
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
-$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '
';
}
if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) {
// Actions or link to stock movement
@@ -1020,7 +1023,13 @@ if ($object->id > 0) {
if (!empty($conf->productbatch->enabled)) {
print '
';
$constforvar = 'RECRUITMENT_'.strtoupper($myTmpObjectKey).'_ADDON_PDF';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 726e24e89b1..58172c2e767 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -328,7 +328,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '
';
$constforvar = 'RECRUITMENT_'.strtoupper($myTmpObjectKey).'_ADDON';
- if ($conf->global->$constforvar == $name) {
+ if (getDolGlobalString($constforvar) == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'';
diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
index e2b7c545aa9..c28bd4a9589 100644
--- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
+++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
@@ -130,7 +130,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
// List of directories area
$texte .= '
\n";
@@ -1399,6 +1418,19 @@ while ($i < min($num, $limit)) {
print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.urlencode($place).'\'"';
}
print '>';
+
+ // Action column (Show the massaction button only when this page is not opend from the Extended POS)
+ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ print '
';
+ if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print '';
+ }
+ print '
';
+ }
if (!empty($arrayfields['s.rowid']['checked'])) {
print '
';
print $obj->rowid;
@@ -1707,17 +1739,18 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++;
}
}
-
// Action column (Show the massaction button only when this page is not opend from the Extended POS)
- print '
';
- if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
+ if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ print '
';
+ if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
+ $selected = 0;
+ if (in_array($obj->rowid, $arrayofselected)) {
+ $selected = 1;
+ }
+ print '';
}
- print '';
+ print '
';
}
$htmlforlines .= '';
+
+ // complete line by hook
+ $parameters=array('line' => $line);
+ $reshook=$hookmanager->executeHooks('completeTakePosInvoiceLine', $parameters, $invoice, $action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ $htmlforlines .= $hookmanager->resPrint;
+
$htmlforlines .= '