Browse Source

Fix creation of thirdparty when module supplier not enabled
NEw can use the clicktoclipboard feature when clicking on value

Laurent Destailleur 3 years ago
parent
commit
2e6f4862f9
2 changed files with 4 additions and 13 deletions
  1. 1 1
      htdocs/core/js/lib_foot.js.php
  2. 3 12
      htdocs/societe/card.php

+ 1 - 1
htdocs/core/js/lib_foot.js.php

@@ -230,7 +230,7 @@ print '
 					}
 				);
 
-				jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() {
+				jQuery(\'.clipboardCPValue, .clipboardCPButton, .clipboardCPValueToPrint\').click(function() {
 					/* console.log(this.parentNode); */
 					console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class and we want to copy content of clipboardCPValue class");
 

+ 3 - 12
htdocs/societe/card.php

@@ -84,6 +84,7 @@ $error = 0; $errors = array();
 $action		= (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view');
 $cancel		= GETPOST('cancel', 'alpha');
 $backtopage = GETPOST('backtopage', 'alpha');
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
 $confirm	= GETPOST('confirm', 'alpha');
 
 $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
@@ -135,16 +136,6 @@ $upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->
 // Security check
 $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
 
-/*
-if ($object->id > 0) {
-	if ($object->client == 0 && $object->fournisseur > 0) {
-		if (!empty($user->rights->fournisseur->lire)) {
-			accessforbidden();
-		}
-	}
-}
-*/
-
 
 
 /*
@@ -413,11 +404,11 @@ if (empty($reshook)) {
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors');
 			$error++;
 		}
-		if (GETPOST('client') < 0) {
+		if (GETPOST('client', 'int') && GETPOST('client', 'int') < 0) {
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors');
 			$error++;
 		}
-		if (GETPOST('fournisseur') < 0) {
+		if (GETPOSTISSET('fournisseur') && GETPOST('fournisseur', 'int') < 0) {
 			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors');
 			$error++;
 		}