This commit is contained in:
Laurent Destailleur
2022-05-18 00:51:20 +02:00
parent 7de1fe8646
commit 1a0e416c1a
3 changed files with 10 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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>';

View File

@@ -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();