瀏覽代碼

Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0

Conflicts:
	htdocs/adherents/type.php
	htdocs/asset/type.php
	htdocs/categories/edit.php
	htdocs/comm/action/card.php
	htdocs/compta/bank/card.php
	htdocs/contact/card.php
	htdocs/contact/list.php
	htdocs/core/class/extrafields.class.php
	htdocs/don/card.php
	htdocs/product/stock/card.php
	htdocs/projet/card.php
	htdocs/projet/tasks/task.php
	htdocs/user/group/card.php
Laurent Destailleur 3 年之前
父節點
當前提交
c3bfd5caa4

+ 1 - 1
htdocs/adherents/card.php

@@ -312,7 +312,7 @@ if (empty($reshook)) {
 			$object->public      = GETPOST("public", 'alpha');
 
 			// Fill array 'array_options' with data from add form
-			$ret = $extrafields->setOptionalsFromPost(null, $object);
+			$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 			if ($ret < 0) {
 				$error++;
 			}

+ 1 - 1
htdocs/adherents/type.php

@@ -180,7 +180,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
 	$object->vote = (boolean) trim($vote);
 
 	// Fill array 'array_options' with data from add form
-	$ret = $extrafields->setOptionalsFromPost(null, $object);
+	$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 	if ($ret < 0) {
 		$error++;
 	}

+ 1 - 1
htdocs/asset/type.php

@@ -158,7 +158,7 @@ if ($action == 'update' && $user->rights->asset->write) {
 	$object->note = trim($comment);
 
 	// Fill array 'array_options' with data from add form
-	$ret = $extrafields->setOptionalsFromPost(null, $object);
+	$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 	if ($ret < 0) {
 		$error++;
 	}

+ 1 - 1
htdocs/categories/edit.php

@@ -105,7 +105,7 @@ if ($action == 'update' && $user->rights->categorie->creer) {
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
 	}
 	if (!$error && empty($object->error)) {
-		$ret = $extrafields->setOptionalsFromPost(null, $object);
+		$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 		if ($ret < 0) {
 			$error++;
 		}

+ 1 - 1
htdocs/comm/action/card.php

@@ -585,7 +585,7 @@ if (empty($reshook) && $action == 'update') {
 		}
 
 		// Fill array 'array_options' with data from add form
-		$ret = $extrafields->setOptionalsFromPost(null, $object);
+		$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 		if ($ret < 0) {
 			$error++;
 		}

+ 1 - 1
htdocs/compta/bank/card.php

@@ -156,7 +156,7 @@ if (empty($reshook)) {
 		}
 
 		// Fill array 'array_options' with data from add form
-		$ret = $extrafields->setOptionalsFromPost(null, $object);
+		$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 
 		if (!$error) {
 			$id = $object->create($user);

+ 1 - 1
htdocs/contact/card.php

@@ -420,7 +420,7 @@ if (empty($reshook)) {
 			$object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
 
 			// Fill array 'array_options' with data from add form
-			$ret = $extrafields->setOptionalsFromPost(null, $object);
+			$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 			if ($ret < 0) {
 				$error++;
 			}

+ 4 - 1
htdocs/contact/list.php

@@ -101,9 +101,12 @@ $search_roles = GETPOST("search_roles", 'array');
 $search_level = GETPOST("search_level", "array");
 $search_stcomm = GETPOST('search_stcomm', 'int');
 
-if ($search_status == '') {
+if ($search_status === '') {
 	$search_status = 1; // always display active customer first
 }
+if ($search_no_email === '') {
+	$search_no_email = -1;
+}
 
 $optioncss = GETPOST('optioncss', 'alpha');
 

+ 2 - 1
htdocs/core/class/extrafields.class.php

@@ -2069,7 +2069,8 @@ class ExtraFields
 				if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) {
 					continue;
 				}
-				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key)) {
+				if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && $this->attributes[$object->table_element]['type'][$key] != 'boolean') {
+	                //when unticking boolean field, it's not set in POST
 					continue;
 				}
 

+ 1 - 1
htdocs/don/card.php

@@ -161,7 +161,7 @@ if ($action == 'update') {
 		$object->modepaymentid = (int) GETPOST('modepayment', 'int');
 
 		// Fill array 'array_options' with data from add form
-		$ret = $extrafields->setOptionalsFromPost(null, $object);
+		$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 		if ($ret < 0) {
 			$error++;
 		}

+ 1 - 1
htdocs/product/stock/card.php

@@ -183,7 +183,7 @@ if (empty($reshook)) {
 			$object->fax = GETPOST("fax");
 
 			// Fill array 'array_options' with data from add form
-			$ret = $extrafields->setOptionalsFromPost(null, $object);
+	        $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 			if ($ret < 0) {
 				$error++;
 			}

+ 1 - 1
htdocs/projet/card.php

@@ -270,7 +270,7 @@ if (empty($reshook)) {
 			$object->usage_organize_event = (GETPOST('usage_organize_event', 'alpha') == 'on' ? 1 : 0);
 
 			// Fill array 'array_options' with data from add form
-			$ret = $extrafields->setOptionalsFromPost(null, $object);
+			$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 			if ($ret < 0) {
 				$error++;
 			}

+ 1 - 1
htdocs/projet/tasks/task.php

@@ -107,7 +107,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
 		$object->progress = price2num(GETPOST('progress', 'alphanohtml'));
 
 		// Fill array 'array_options' with data from add form
-		$ret = $extrafields->setOptionalsFromPost(null, $object);
+		$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 		if ($ret < 0) {
 			$error++;
 		}

+ 1 - 1
htdocs/resource/card.php

@@ -139,7 +139,7 @@ if (empty($reshook)) {
 				$object->country_id             = $country_id;
 
 				// Fill array 'array_options' with data from add form
-				$ret = $extrafields->setOptionalsFromPost(null, $object);
+				$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 				if ($ret < 0) {
 					$error++;
 				}

+ 1 - 1
htdocs/user/card.php

@@ -462,7 +462,7 @@ if (empty($reshook)) {
 				}
 
 				// Fill array 'array_options' with data from add form
-				$ret = $extrafields->setOptionalsFromPost(null, $object);
+				$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 				if ($ret < 0) {
 					$error++;
 				}

+ 1 - 1
htdocs/user/group/card.php

@@ -210,7 +210,7 @@ if (empty($reshook)) {
 			$object->note	= dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
 
 			// Fill array 'array_options' with data from add form
-			$ret = $extrafields->setOptionalsFromPost(null, $object);
+			$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
 			if ($ret < 0) {
 				$error++;
 			}