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) { close: function (event, ui) {
returnedid = jQuery("#varforreturndialogid'.$name.'").text(); returnedid = jQuery("#varforreturndialogid'.$name.'").text();
returnedlabel = jQuery("#varforreturndialoglabel'.$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") { if (returnedid != "" && returnedid != "div for returned id") {
jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid); jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid);
} }

View File

@@ -619,7 +619,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
if (!GETPOSTISSET('backtopage')) { if (!GETPOSTISSET('backtopage')) {
$url = '/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create'); $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>'; $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'; //$tmpbacktopagejsfields = 'socid:search_socid';
//print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields); //print dolButtonToOpenUrlInDialogPopup('addthirdparty', $langs->transnoentitiesnoconv('AddThirdParty'), $newbutton, $url, '', '', $tmpbacktopagejsfields);
print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>'; print ' <a href="'.DOL_URL_ROOT.$url.'">'.$newbutton.'</a>';

View File

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