Look and feel v15. Stay at same position on doc generation
This commit is contained in:
parent
f0703b414a
commit
50470f84c4
@ -102,12 +102,12 @@ if ($action == 'builddoc' && $permissiontoadd) {
|
|||||||
if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders"
|
if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders"
|
||||||
setEventMessages($langs->trans("FileGenerated"), null);
|
setEventMessages($langs->trans("FileGenerated"), null);
|
||||||
|
|
||||||
$urltoredirect = $_SERVER['REQUEST_URI'];
|
/*$urltoredirect = $_SERVER['REQUEST_URI'];
|
||||||
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
|
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
|
||||||
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
|
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
|
||||||
|
|
||||||
header('Location: '.$urltoredirect.'#builddoc');
|
header('Location: '.$urltoredirect.'#builddoc');
|
||||||
exit;
|
exit;*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -220,6 +220,7 @@ abstract class CommonDocGenerator
|
|||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
|
* For example {company_name}, {company_name_alias}
|
||||||
*
|
*
|
||||||
* @param Societe $object Object
|
* @param Societe $object Object
|
||||||
* @param Translate $outputlangs Language object for output
|
* @param Translate $outputlangs Language object for output
|
||||||
|
|||||||
@ -734,9 +734,10 @@ class FormFile
|
|||||||
$urlsource .= '#'.$forname.'_form'; // So we switch to form after a generation
|
$urlsource .= '#'.$forname.'_form'; // So we switch to form after a generation
|
||||||
}
|
}
|
||||||
if (empty($noform)) {
|
if (empty($noform)) {
|
||||||
$out .= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc').'" id="'.$forname.'_form" method="post">';
|
$out .= '<form action="'.$urlsource.'" id="'.$forname.'_form" method="post">';
|
||||||
}
|
}
|
||||||
$out .= '<input type="hidden" name="action" value="builddoc">';
|
$out .= '<input type="hidden" name="action" value="builddoc">';
|
||||||
|
$out .= '<input type="hidden" name="page_y" value="">';
|
||||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
$out .= load_fiche_titre($titletoshow, '', '');
|
$out .= load_fiche_titre($titletoshow, '', '');
|
||||||
@ -786,7 +787,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Button
|
// Button
|
||||||
$genbutton = '<input class="button buttongen" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
|
$genbutton = '<input class="button buttongen reposition" id="'.$forname.'_generatebutton" name="'.$forname.'_generatebutton"';
|
||||||
$genbutton .= ' type="submit" value="'.$buttonlabel.'"';
|
$genbutton .= ' type="submit" value="'.$buttonlabel.'"';
|
||||||
if (!$allowgenifempty && !is_array($modellist) && empty($modellist)) {
|
if (!$allowgenifempty && !is_array($modellist) && empty($modellist)) {
|
||||||
$genbutton .= ' disabled';
|
$genbutton .= ' disabled';
|
||||||
@ -936,14 +937,14 @@ class FormFile
|
|||||||
$out .= '<td class="right nowraponall">';
|
$out .= '<td class="right nowraponall">';
|
||||||
if ($delallowed) {
|
if ($delallowed) {
|
||||||
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
|
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
|
||||||
$out .= '<a href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action='.urlencode($removeaction).'&token='.newToken().'&file='.urlencode($relativepath);
|
$out .= '<a class="reposition" href="'.$tmpurlsource.((strpos($tmpurlsource, '?') === false) ? '?' : '&').'action='.urlencode($removeaction).'&token='.newToken().'&file='.urlencode($relativepath);
|
||||||
$out .= ($param ? '&'.$param : '');
|
$out .= ($param ? '&'.$param : '');
|
||||||
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
|
||||||
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
|
||||||
$out .= '">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
$out .= '">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
if ($printer) {
|
if ($printer) {
|
||||||
$out .= '<a class="marginleftonly" href="'.$urlsource.(strpos($urlsource, '?') ? '&' : '?').'action=print_file&token='.newToken().'printer='.urlencode($modulepart).'&file='.urlencode($relativepath);
|
$out .= '<a class="marginleftonly reposition" href="'.$urlsource.(strpos($urlsource, '?') ? '&' : '?').'action=print_file&token='.newToken().'printer='.urlencode($modulepart).'&file='.urlencode($relativepath);
|
||||||
$out .= ($param ? '&'.$param : '');
|
$out .= ($param ? '&'.$param : '');
|
||||||
$out .= '">'.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').'</a>';
|
$out .= '">'.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user