diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 0096ba9a285..70b86338db8 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1510,7 +1510,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
- $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
+ $labeltouse = getDolGlobalString("ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION");
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 4b51a519223..57f2662bcfc 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -914,8 +914,10 @@ if ($object->id > 0) {
* Latest orders
*/
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
+ $param ="";
+
$sql = "SELECT s.nom, s.rowid";
- $sql .= ", c.rowid as cid, c.total_ht";
+ $sql .= ", c.rowid as cid, c.entity, c.total_ht";
$sql .= ", c.total_tva";
$sql .= ", c.total_ttc";
$sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture";
@@ -1024,7 +1026,7 @@ if ($object->id > 0) {
*/
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
$sql = 'SELECT e.rowid as id';
- $sql .= ', e.ref';
+ $sql .= ', e.ref, e.entity';
$sql .= ', e.date_creation';
$sql .= ', e.fk_statut as statut';
$sql .= ', s.nom';
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 9e3036e29a0..6650cd140d7 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -1197,6 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Categories
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ $arrayselected = array();
print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).' ';
print '';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, null, null, null, 1);
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index 41a6a74dd4b..0ba88228666 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -167,7 +167,7 @@ if ($object->thirdparty->client) {
}
}
-if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) {
+if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index e68274ecff2..8a1765118da 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -341,6 +341,9 @@ $formother = new FormOther($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
+$morejs=array();
+$morecss = array();
+
if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
$contactstatic->loadCacheOfProspStatus();
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 77ab8eab79a..13490de9886 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7447,8 +7447,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__MEMBER_PHONEMOBILE__'] = (isset($object->phone_mobile) ? dol_print_phone($object->phone_mobile) : '');
$substitutionarray['__MEMBER_TYPE__'] = (isset($object->type) ? $object->type : '');
$substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE__'] = dol_print_date($object->first_subscription_date, 'dayrfc');
- $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->first_subscription_date_start, 'dayrfc');
- $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->first_subscription_date_end, 'dayrfc');
+ $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_START__'] = (isset($object->first_subscription_date_start) ? dol_print_date($object->first_subscription_date_start, 'dayrfc') : '');
+ $substitutionarray['__MEMBER_FIRST_SUBSCRIPTION_DATE_END__'] = (isset($object->first_subscription_date_end) ? dol_print_date($object->first_subscription_date_end, 'dayrfc') : '');
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE__'] = dol_print_date($object->last_subscription_date, 'dayrfc');
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_START__'] = dol_print_date($object->last_subscription_date_start, 'dayrfc');
$substitutionarray['__MEMBER_LAST_SUBSCRIPTION_DATE_END__'] = dol_print_date($object->last_subscription_date_end, 'dayrfc');
diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php
index 0fc13cbe134..842495c242d 100644
--- a/htdocs/core/modules/member/doc/pdf_standard.class.php
+++ b/htdocs/core/modules/member/doc/pdf_standard.class.php
@@ -173,7 +173,7 @@ class pdf_standard extends CommonStickerGenerator
$widthtouse = $maxwidthtouse;
$heighttouse = 0; // old value for image
$tmp = dol_getImageSize($photo, false);
- if ($tmp['height']) {
+ if (isset($tmp['height'])) {
$imgratio = $tmp['width'] / $tmp['height'];
if ($imgratio >= $defaultratio) {
$widthtouse = $maxwidthtouse;
@@ -314,10 +314,10 @@ class pdf_standard extends CommonStickerGenerator
complete_substitutions_array($substitutionarray, $langs);
// For business cards
- $textleft = make_substitutions($conf->global->ADHERENT_CARD_TEXT, $substitutionarray);
- $textheader = make_substitutions($conf->global->ADHERENT_CARD_HEADER_TEXT, $substitutionarray);
- $textfooter = make_substitutions($conf->global->ADHERENT_CARD_FOOTER_TEXT, $substitutionarray);
- $textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
+ $textleft = make_substitutions(getDolGlobalString("ADHERENT_CARD_TEXT"), $substitutionarray);
+ $textheader = make_substitutions(getDolGlobalString("ADHERENT_CARD_HEADER_TEXT"), $substitutionarray);
+ $textfooter = make_substitutions(getDolGlobalString("ADHERENT_CARD_FOOTER_TEXT"), $substitutionarray);
+ $textright = make_substitutions(getDolGlobalString("ADHERENT_CARD_TEXT_RIGHT"), $substitutionarray);
$nb = $_Avery_Labels[$this->code]['NX'] * $_Avery_Labels[$this->code]['NY'];
if ($nb <= 0) {
@@ -330,8 +330,8 @@ class pdf_standard extends CommonStickerGenerator
'textheader'=>$textheader,
'textfooter'=>$textfooter,
'textright'=>$textright,
- 'id'=>$object->rowid,
- 'photo'=>$object->photo
+ 'id'=>(isset($object->rowid) ? $object->rowid : ""),
+ 'photo'=>(isset($object->photo) ? $object->photo : "")
);
}
diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
index aeafac07962..2a12a07fd23 100644
--- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php
@@ -68,6 +68,9 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
}
if (is_numeric($obj->$tmpkey)) {
+ if (!isset($totalarray['totalizable'][$key]['total'])) {
+ $totalarray['totalizable'][$key]['total'] = 0;
+ }
$totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
}
}
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 3ef85adeb84..02797fdbb37 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -715,7 +715,9 @@ if ($action == 'create') {
$productstatic->type = $objp->type;
$productstatic->entity = $objp->entity;
$productstatic->status_batch = $objp->tobatch;
- $productstatic->fk_unit = $objp->fk_unit;
+ if (!empty($conf->global->PRODUCT_USE_UNITS)) {
+ $productstatic->fk_unit = $objp->fk_unit;
+ }
$productstatic->status = $objp->tosell;
$productstatic->status_buy = $objp->tobuy;
$productstatic->barcode = $objp->barcode;
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index de9f72fbcd6..29e337c3728 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -35,7 +35,7 @@ $ref = GETPOST('ref', 'alpha');
// Security check
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result = restrictedArea($user, 'stock');
-
+$usercancreate = $user->rights->stock->creer;
/*
* View
@@ -75,7 +75,7 @@ if (!empty($conf->project->enabled)) {
$morehtmlref .= ' ';
$morehtmlref .= '';
} else {
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!empty($object->socid) ? $object->socid : 0), $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (!empty($object->fk_project)) {
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 34a2a074ec5..ab3afad20b0 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -59,6 +59,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'movementlist';
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
+$backtopage = GETPOST("backtopage", "alpha");
$idproduct = GETPOST('idproduct', 'int');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index 2743c4a5ea7..ba6b81abd79 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -42,6 +42,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'productlotlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
+$mode = GETPOST('mode', 'alpha');
$search_entity = GETPOST('search_entity', 'int');
$search_product = GETPOST('search_product', 'alpha');
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index cfb46231a72..53803b0929d 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -112,12 +112,12 @@ if (!empty($conf->productbatch->enabled) &&
print ' ';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print ''.$langs->trans("SellByDate").' ';
- print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print $form->selectDate((!empty($d_sellby) ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print ' ';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print ''.$langs->trans("EatByDate").' ';
- print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
+ print $form->selectDate((!empty($d_eatby) ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print ' ';
}
print ' ';