Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/action/card.php htdocs/comm/propal/card.php htdocs/compta/bank/releve.php htdocs/compta/paiement/rapport.php htdocs/core/class/extrafields.class.php htdocs/core/modules/expedition/doc/pdf_espadon.modules.php htdocs/reception/card.php htdocs/societe/societecontact.php
This commit is contained in:
commit
9973085613
@ -1063,7 +1063,7 @@ while ($i < min($num, $limit)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="nowrap left">';
|
print '<td class="nowrap left">';
|
||||||
if ($obj->subscription == 'yes') {
|
if (!empty($obj->subscription)) {
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($obj->statut > 0) {
|
if ($obj->statut > 0) {
|
||||||
print " ".img_warning();
|
print " ".img_warning();
|
||||||
|
|||||||
@ -717,7 +717,7 @@ if ($rowid > 0) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="nowrap left">';
|
print '<td class="nowrap left">';
|
||||||
if ($objp->subscription == 'yes') {
|
if (!empty($objp->subscription)) {
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($objp->status > 0) {
|
if ($objp->status > 0) {
|
||||||
print " ".img_warning();
|
print " ".img_warning();
|
||||||
|
|||||||
@ -1170,6 +1170,7 @@ if ($action == 'create') {
|
|||||||
if (GETPOST('contactid', 'int')) {
|
if (GETPOST('contactid', 'int')) {
|
||||||
$preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
|
$preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int');
|
||||||
}
|
}
|
||||||
|
if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
|
||||||
print img_picto('', 'contact', 'class="paddingrightonly"');
|
print img_picto('', 'contact', 'class="paddingrightonly"');
|
||||||
print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
print $form->selectcontacts(GETPOST('socid', 'int'), $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 quatrevingtpercent', false, 0, array(), false, 'multiple', 'contactid');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -302,9 +302,26 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
} elseif ($action == 'setecheance' && $usercancreate) {
|
} elseif ($action == 'setecheance' && $usercancreate) {
|
||||||
$result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
|
$result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
|
||||||
$result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
if ($result >= 0) {
|
||||||
if ($result < 0) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
dol_print_error($db, $object->error);
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||||
|
if (!empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
$model = $object->model_pdf;
|
||||||
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
if ($ret > 0) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
}
|
||||||
|
|
||||||
|
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action == 'setdate_livraison' && $usercancreate) {
|
} elseif ($action == 'setdate_livraison' && $usercancreate) {
|
||||||
$result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear']));
|
$result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear']));
|
||||||
|
|||||||
@ -179,8 +179,8 @@ $sqlrequestforbankline = $sql;
|
|||||||
|
|
||||||
if ($action == 'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) {
|
if ($action == 'confirm_editbankreceipt' && !empty($oldbankreceipt) && !empty($newbankreceipt)) {
|
||||||
// TODO Add a test to check newbankreceipt does not exists yet
|
// TODO Add a test to check newbankreceipt does not exists yet
|
||||||
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX.'bank';
|
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."bank SET num_releve = '".$db->escape($newbankreceipt)."'";
|
||||||
$sqlupdate .= ' SET num_releve = "'.$db->escape($newbankreceipt).'" WHERE num_releve = "'.$db->escape($oldbankreceipt).'" AND fk_account = '.((int) $id);
|
$sqlupdate .= " WHERE num_releve = '".$db->escape($oldbankreceipt)."' AND fk_account = ".((int) $id);
|
||||||
$result = $db->query($sqlupdate);
|
$result = $db->query($sqlupdate);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
|
|||||||
@ -111,31 +111,17 @@ print '<br>';
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
// Show link on other years
|
// Show link on other years
|
||||||
$linkforyear = array();
|
$year_dirs = dol_dir_list($dir, 'directories', 0, '^[0-9]{4}$', '', 'DESC');
|
||||||
$found = 0;
|
foreach ($year_dirs as $d)
|
||||||
if (is_dir($dir)) {
|
{
|
||||||
$handle = opendir($dir);
|
print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$d['name'].'">'.$d['name'].'</a> ';
|
||||||
if (is_resource($handle)) {
|
|
||||||
while (($file = readdir($handle)) !== false) {
|
|
||||||
if (is_dir($dir.'/'.$file) && !preg_match('/^\./', $file) && is_numeric($file)) {
|
|
||||||
$found = 1;
|
|
||||||
$linkforyear[] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
asort($linkforyear);
|
|
||||||
foreach ($linkforyear as $cursoryear) {
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?year='.$cursoryear.'">'.$cursoryear.'</a> ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($year) {
|
if ($year)
|
||||||
if (is_dir($dir.'/'.$year)) {
|
{
|
||||||
$handle = opendir($dir.'/'.$year);
|
if (is_dir($dir.'/'.$year))
|
||||||
|
{
|
||||||
if ($found) {
|
if (!empty($year_dirs)) print '<br>';
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table width="100%" class="noborder">';
|
print '<table width="100%" class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -144,20 +130,15 @@ if ($year) {
|
|||||||
print '<td class="right">'.$langs->trans("Date").'</td>';
|
print '<td class="right">'.$langs->trans("Date").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (is_resource($handle)) {
|
$files = (dol_dir_list($dir.'/'.$year, 'files', 0, '^payments-[0-9]{4}-[0-9]{2}\.pdf$', '', 'name', 'DESC', 1));
|
||||||
while (($file = readdir($handle)) !== false) {
|
foreach ($files as $f) {
|
||||||
if (preg_match('/^payment/i', $file)) {
|
$relativepath = $f['level1name'].'/'.$f['name'];
|
||||||
$tfile = $dir.'/'.$year.'/'.$file;
|
|
||||||
$relativepath = $year.'/'.$file;
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a>'.$formfile->showPreview($file, 'facture_paiement', $relativepath, 0).'</td>';
|
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&file='.urlencode($relativepath).'">'.img_pdf().' '.$f['name'].'</a>'.$formfile->showPreview($f['name'], 'facture_paiement', $relativepath, 0).'</td>';
|
||||||
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
|
print '<td class="right">'.dol_print_size($f['size']).'</td>';
|
||||||
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td>';
|
print '<td class="right">'.dol_print_date($f['date'], "dayhour").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
closedir($handle);
|
|
||||||
}
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -198,7 +198,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="center"',
|
'td' => 'class="center"',
|
||||||
'text' => $objp->total_stock.' / '.$objp->seuil_stock_alerte,
|
'text' => price2num($objp->total_stock, 'MS').' / '.$objp->seuil_stock_alerte,
|
||||||
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit", $objp->seuil_stock_alerte)),
|
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit", $objp->seuil_stock_alerte)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1345,7 +1345,10 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
$out .= '</select>';
|
$out .= '</select>';
|
||||||
} elseif ($type == 'checkbox') {
|
} elseif ($type == 'checkbox') {
|
||||||
|
$value_arr = $value;
|
||||||
|
if (!is_array($value)) {
|
||||||
$value_arr = explode(',', $value);
|
$value_arr = explode(',', $value);
|
||||||
|
}
|
||||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
|
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
|
||||||
} elseif ($type == 'radio') {
|
} elseif ($type == 'radio') {
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|||||||
@ -939,11 +939,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
't.email',
|
't.email',
|
||||||
);
|
);
|
||||||
//Social media
|
//Social media
|
||||||
foreach ($socialnetworks as $key => $value) {
|
// foreach ($socialnetworks as $key => $value) {
|
||||||
if ($value['active']) {
|
// if ($value['active']) {
|
||||||
$searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
|
// $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!$sortorder) {
|
if (!$sortorder) {
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
|
|||||||
@ -318,13 +318,13 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0, 0, 0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 : 10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift: 10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
@ -361,17 +361,14 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($notetoshow) || !empty($object->tracking_number)) {
|
if (!empty($notetoshow) || !empty($object->tracking_number)) {
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
$tab_top_alt = $tab_top;
|
|
||||||
|
|
||||||
|
// Tracking number
|
||||||
|
if (!empty($object->tracking_number)) {
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top_alt = $pdf->GetY();
|
$tab_top_alt = $pdf->GetY();
|
||||||
//$tab_top_alt += 1;
|
|
||||||
|
|
||||||
// Tracking number
|
|
||||||
if (!empty($object->tracking_number)) {
|
|
||||||
$object->getUrlTrackingStatus($object->tracking_number);
|
$object->getUrlTrackingStatus($object->tracking_number);
|
||||||
if (!empty($object->tracking_url)) {
|
if (!empty($object->tracking_url)) {
|
||||||
if ($object->shipping_method_id > 0) {
|
if ($object->shipping_method_id > 0) {
|
||||||
@ -390,29 +387,129 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top_alt = $pdf->GetY();
|
$tab_top = $pdf->GetY();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
if (!empty($notetoshow)) {
|
$pagenb = $pdf->getPage();
|
||||||
$pdf->SetFont('', '', $default_font_size - 1); // In loop to manage multi-page
|
if (!empty($notetoshow))
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top_alt, dol_htmlentitiesbr($notetoshow), 0, 1);
|
{
|
||||||
|
$tab_top -= 2;
|
||||||
|
|
||||||
|
$tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
|
||||||
|
$pageposbeforenote = $pagenb;
|
||||||
|
|
||||||
|
$substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||||
|
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
|
||||||
|
|
||||||
|
$pdf->startTransaction();
|
||||||
|
|
||||||
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
|
// Description
|
||||||
|
$pageposafternote = $pdf->getPage();
|
||||||
|
$posyafter = $pdf->GetY();
|
||||||
|
|
||||||
|
if ($pageposafternote > $pageposbeforenote)
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
|
||||||
|
// prepare pages to receive notes
|
||||||
|
while ($pagenb < $pageposafternote) {
|
||||||
|
$pdf->AddPage();
|
||||||
|
$pagenb++;
|
||||||
|
if (!empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
// $this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
// The only function to edit the bottom margin of current page to set it.
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
||||||
}
|
}
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
// back to start
|
||||||
$height_note = $nexY - $tab_top;
|
$pdf->setPage($pageposbeforenote);
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
||||||
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
|
$pageposafternote = $pdf->getPage();
|
||||||
|
|
||||||
// Rect takes a length in 3rd parameter
|
$posyafter = $pdf->GetY();
|
||||||
$pdf->SetDrawColor(192, 192, 192);
|
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) // There is no space left for total+free text
|
||||||
|
{
|
||||||
|
$pdf->AddPage('', '', true);
|
||||||
|
$pagenb++;
|
||||||
|
$pageposafternote++;
|
||||||
|
$pdf->setPage($pageposafternote);
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
// The only function to edit the bottom margin of current page to set it.
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
||||||
|
//$posyafter = $tab_top_newpage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// apply note frame to previous pages
|
||||||
|
$i = $pageposbeforenote;
|
||||||
|
while ($i < $pageposafternote) {
|
||||||
|
$pdf->setPage($i);
|
||||||
|
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
|
// Draw note frame
|
||||||
|
if ($i > $pageposbeforenote) {
|
||||||
|
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
|
||||||
|
} else {
|
||||||
|
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add footer
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// apply note frame to last page
|
||||||
|
$pdf->setPage($pageposafternote);
|
||||||
|
if (!empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$height_note = $posyafter - $tab_top_newpage;
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
|
||||||
|
} else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
$posyafter = $pdf->GetY();
|
||||||
|
$height_note = $posyafter - $tab_top;
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
|
||||||
|
|
||||||
|
|
||||||
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20)))
|
||||||
|
{
|
||||||
|
// not enough space, need to add page
|
||||||
|
$pdf->AddPage('', '', true);
|
||||||
|
$pagenb++;
|
||||||
|
$pageposafternote++;
|
||||||
|
$pdf->setPage($pageposafternote);
|
||||||
|
if (!empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
|
||||||
|
$posyafter = $tab_top_newpage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
$tab_top = $nexY + 6;
|
$tab_top = $posyafter + 6;
|
||||||
} else {
|
} else {
|
||||||
$height_note = 0;
|
$height_note = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Use new auto column system
|
// Use new auto column system
|
||||||
@ -420,14 +517,17 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Table simulation to know the height of the title line
|
// Table simulation to know the height of the title line
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs);
|
||||||
$pdf->rollbackTransaction(true);
|
$pdf->rollbackTransaction(true);
|
||||||
|
|
||||||
|
|
||||||
$nexY = $tab_top + $this->tabTitleHeight;
|
$nexY = $tab_top + $this->tabTitleHeight;
|
||||||
|
|
||||||
// Loop on each lines
|
// Loop on each lines
|
||||||
for ($i = 0; $i < $nblines; $i++) {
|
$pageposbeforeprintlines = $pdf->getPage();
|
||||||
|
$pagenb = $pageposbeforeprintlines;
|
||||||
|
for ($i = 0; $i < $nblines; $i++)
|
||||||
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||||
$pdf->SetTextColor(0, 0, 0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
@ -590,7 +690,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
// Detect if some page were added automatically and output _tableau for past pages
|
// Detect if some page were added automatically and output _tableau for past pages
|
||||||
while ($pagenb < $pageposafter) {
|
while ($pagenb < $pageposafter) {
|
||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
if ($pagenb == 1) {
|
if ($pagenb == $pageposbeforeprintlines) {
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||||
} else {
|
} else {
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||||
|
|||||||
@ -785,7 +785,7 @@ if ($action == 'create') {
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
||||||
print img_picto('', 'project', 'class="paddingright"');
|
print img_picto('', 'project', 'class="paddingright"');
|
||||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
print $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -316,7 +316,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="left nowrap">';
|
print '<td class="left nowrap">';
|
||||||
if ($objp->subscription == 'yes') {
|
if (!empty($objp->subscription)) {
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($objp->statut > 0) {
|
if ($objp->statut > 0) {
|
||||||
print " ".img_warning();
|
print " ".img_warning();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user