Laurent Destailleur 3 years ago
parent
commit
1a0e416c1a
3 changed files with 10 additions and 4 deletions
  1. 1 1
      htdocs/core/lib/functions.lib.php
  2. 1 1
      htdocs/projet/card.php
  3. 8 2
      htdocs/societe/card.php

+ 1 - 1
htdocs/core/lib/functions.lib.php

@@ -1628,7 +1628,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
 							close: function (event, ui) {
 								returnedid = jQuery("#varforreturndialogid'.$name.'").text();
 								returnedlabel = jQuery("#varforreturndialoglabel'.$name.'").text();
-								console.log("popup has been closed. returnedid="+returnedid+" returnedlabel="+returnedlabel);
+								console.log("popup has been closed. returnedid (js var defined into parent page)="+returnedid+" returnedlabel="+returnedlabel);
 								if (returnedid != "" && returnedid != "div for returned id") {
 									jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid);
 								}

+ 1 - 1
htdocs/projet/card.php

@@ -619,7 +619,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
 		if (!GETPOSTISSET('backtopage')) {
 			$url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create');
 			$newbutton = '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span>';
-			// TODO @LDR Impletment this
+			// TODO @LDR Implement this
 			//$tmpbacktopagejsfields = 'socid:search_socid';
 			//print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
 			print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';

+ 8 - 2
htdocs/societe/card.php

@@ -704,8 +704,14 @@ if (empty($reshook)) {
 							$url = DOL_URL_ROOT."/fourn/card.php?socid=".$object->id;
 						}
 
-						header("Location: ".$url);
-						exit;
+						// TODO @LDR
+						if ($dol_openinpopup && $backtopagejsfields) {
+							print 'TODO Set js var of parent with id, then close popup.';
+							exit;
+						} else {
+							header("Location: ".$url);
+							exit;
+						}
 					}
 				} else {
 					$db->rollback();