Qual: Code is now simpler using jQuery. Removed rubbish javascript.
This commit is contained in:
parent
e7506405c8
commit
75395dd4c1
@ -72,11 +72,11 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||||
//$pdf->SetCompression(false);
|
//$pdf->SetCompression(false);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
}
|
}
|
||||||
$pdf->SetFont('Helvetica');
|
$pdf->SetFont('Helvetica');
|
||||||
|
|
||||||
//$pdf->Open();
|
//$pdf->Open();
|
||||||
@ -91,12 +91,12 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
// Charge un document PDF depuis un fichier.
|
// Charge un document PDF depuis un fichier.
|
||||||
$pagecount = $pdf->setSourceFile($file);
|
$pagecount = $pdf->setSourceFile($file);
|
||||||
for ($i = 1; $i <= $pagecount; $i++)
|
for ($i = 1; $i <= $pagecount; $i++)
|
||||||
{
|
{
|
||||||
$tplidx = $pdf->importPage($i);
|
$tplidx = $pdf->importPage($i);
|
||||||
$s = $pdf->getTemplatesize($tplidx);
|
$s = $pdf->getTemplatesize($tplidx);
|
||||||
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create output dir if not exists
|
// Create output dir if not exists
|
||||||
@ -110,7 +110,7 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
|
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date(mktime(),'dayhourlog').'.pdf';
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file,'F');
|
||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -125,8 +125,6 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -138,23 +136,25 @@ llxHeader('',$title);
|
|||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
?><script type="text/javascript">
|
|
||||||
<!--
|
?>
|
||||||
function checkall(checked){
|
<script language="javascript" type="text/javascript">
|
||||||
var checkboxes = [];
|
jQuery(document).ready(function() {
|
||||||
checkboxes = $$('input').each(function(e){ if(e.type == 'checkbox') checkboxes.push(e) });
|
jQuery("#checkall").click(function() {
|
||||||
checkboxes.each(function(e){ e.checked = checked });
|
jQuery(".checkformerge").attr('checked', true);
|
||||||
}
|
});
|
||||||
-->
|
jQuery("#checknone").click(function() {
|
||||||
|
jQuery(".checkformerge").attr('checked', false);
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* *
|
* *
|
||||||
* Mode Liste *
|
* Mode Liste *
|
||||||
* *
|
* *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
$now=gmmktime();
|
$now=gmmktime();
|
||||||
|
|
||||||
@ -299,7 +299,9 @@ if ($result)
|
|||||||
print '</td><td class="liste_titre" colspan="2" align="right">';
|
print '</td><td class="liste_titre" colspan="2" align="right">';
|
||||||
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="checkbox" onclick="checkall(this.checked);"></td>';
|
print '<td class="liste_titre" align="center">';
|
||||||
|
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||||
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -371,7 +373,7 @@ if ($result)
|
|||||||
|
|
||||||
// Checkbox
|
// Checkbox
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($foundpdf) print '<input id="cb'.$objp->facid.'" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
|
if ($foundpdf) print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>' ;
|
print '</td>' ;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user