forked from Wavyzz/dolibarr
Fix: use getDocumentsLink method
This commit is contained in:
@@ -251,19 +251,19 @@ if (! empty($categ[$categidx]))
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
|
||||
{
|
||||
$form = new Form($db);
|
||||
$categidx='expdev';
|
||||
$categidx='expdev';
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
||||
$head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);
|
||||
$head[$h][2] = 'expdev';
|
||||
$h++;
|
||||
$head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);
|
||||
$head[$h][2] = 'expdev';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$categidx='marketplace';
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
||||
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
|
||||
$head[$h][2] = 'marketplace';
|
||||
$h++;
|
||||
|
||||
$categidx='marketplace';
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
|
||||
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
|
||||
$head[$h][2] = 'marketplace';
|
||||
$h++;
|
||||
|
||||
|
||||
dol_fiche_head($head, $mode, $langs->trans("Modules"));
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print "</td>";
|
||||
|
||||
@@ -257,7 +257,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
|
||||
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print "</td>";
|
||||
@@ -418,7 +418,7 @@ if ($conf->propal->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -490,7 +490,7 @@ if ($conf->propal->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -320,8 +320,7 @@ if ($result)
|
||||
$filename=dol_sanitizeFileName($objp->ref);
|
||||
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid;
|
||||
//$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink('propal', $filename, $filedir);
|
||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
if ($objp->client == 1)
|
||||
|
||||
@@ -3140,7 +3140,7 @@ class OrderLine
|
||||
$sql.= " , total_ht=".price2num($this->total_ht)."";
|
||||
$sql.= " , total_tva=".price2num($this->total_tva)."";
|
||||
$sql.= " , total_ttc=".price2num($this->total_ttc)."";
|
||||
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
|
||||
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
|
||||
$sql.= " , total_localtax2=".price2num($this->total_localtax2);
|
||||
}
|
||||
$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null");
|
||||
|
||||
@@ -262,7 +262,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -331,7 +331,7 @@ if ($conf->commande->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -402,7 +402,7 @@ if ($conf->commande->enabled)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -308,7 +308,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($objp->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -469,10 +469,10 @@ if ($action == 'create')
|
||||
while ($i < $n)
|
||||
{
|
||||
print '<input type="hidden" name="orders_to_invoice[]" value="'.$orders_id[$i].'">';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
// Button "Create Draft"
|
||||
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></center>';
|
||||
@@ -496,7 +496,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
|
||||
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
@@ -535,18 +535,18 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||
{
|
||||
$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
|
||||
}
|
||||
|
||||
|
||||
//Date filter
|
||||
if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
|
||||
if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
|
||||
|
||||
|
||||
if (!empty($sref_client))
|
||||
{
|
||||
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
|
||||
}
|
||||
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
|
||||
$resql = $db->query($sql);
|
||||
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
if ($socid)
|
||||
@@ -569,7 +569,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||
print '<h3>';
|
||||
$companystatic->id=$socid;
|
||||
$companystatic->nom=$soc->nom;
|
||||
|
||||
|
||||
print $companystatic->getNomUrl(1,'customer');
|
||||
print '</h3>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@@ -581,7 +581,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
|
||||
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="get" action="orderstoinvoice.php">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
@@ -593,88 +593,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
|
||||
//print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
|
||||
|
||||
|
||||
//DATE ORDER
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $period;
|
||||
print '</td>';
|
||||
|
||||
|
||||
//DATE DELIVERY
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $periodely;
|
||||
print '</td>';
|
||||
|
||||
|
||||
//SEARCH BUTTON
|
||||
print '</td><td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
|
||||
|
||||
//ALL/NONE
|
||||
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 '</td></tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
|
||||
$var=True;
|
||||
$generic_commande = new Commande($db);
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">';
|
||||
|
||||
|
||||
$generic_commande->id=$objp->rowid;
|
||||
$generic_commande->ref=$objp->ref;
|
||||
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
print '<td class="nobordernopadding" nowrap="nowrap">';
|
||||
print $generic_commande->getNomUrl(1,$objp->fk_statut);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
|
||||
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td width="16" align="right" class="nobordernopadding">';
|
||||
$filename=dol_sanitizeFileName($objp->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td>'.$objp->ref_client.'</td>';
|
||||
|
||||
|
||||
// Order date
|
||||
print '<td align="center" nowrap>';
|
||||
print dol_print_date($db->jdate($objp->date_commande),'day');
|
||||
print '</td>';
|
||||
|
||||
|
||||
//Delivery date
|
||||
print '<td align="center" nowrap>';
|
||||
print dol_print_date($db->jdate($objp->date_livraison),'day');
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Statut
|
||||
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
|
||||
|
||||
|
||||
// Checkbox
|
||||
print '<td align="center">';
|
||||
print '<input class="flat checkformerge" type="checkbox" name="orders_to_invoice[]" value="'.$objp->rowid.'">';
|
||||
print '</td>' ;
|
||||
|
||||
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$total = $total + $objp->price;
|
||||
$subtotal = $subtotal + $objp->price;
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
||||
@@ -3446,7 +3446,7 @@ class FactureLigne
|
||||
$sql.= ",total_ht=".price2num($this->total_ht)."";
|
||||
$sql.= ",total_tva=".price2num($this->total_tva)."";
|
||||
$sql.= ",total_ttc=".price2num($this->total_ttc)."";
|
||||
$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
|
||||
$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
|
||||
$sql.= ",total_localtax2=".price2num($this->total_localtax2)."";
|
||||
}
|
||||
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
|
||||
|
||||
@@ -301,10 +301,10 @@ if ($action == 'create')
|
||||
$prodprice=$product_static->price; // price HT
|
||||
print '<td align="right">'.price($prodprice)."</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>";
|
||||
|
||||
@@ -340,7 +340,7 @@ if ($resql)
|
||||
print '<td width="16" align="right" class="nobordernopadding">';
|
||||
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param);
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td>';
|
||||
|
||||
print '</tr></table>';
|
||||
@@ -365,8 +365,10 @@ if ($resql)
|
||||
|
||||
// Checkbox
|
||||
print '<td align="center">';
|
||||
if ($foundpdf) print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
|
||||
else print ' ';
|
||||
if (! empty($formfile->numoffiles))
|
||||
print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
|
||||
else
|
||||
print ' ';
|
||||
print '</td>' ;
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -341,7 +341,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($objp->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
|
||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
@@ -320,7 +320,7 @@ print '</td>';
|
||||
print '<td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
|
||||
// Last modified customer invoices
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
$facstatic=new Facture($db);
|
||||
@@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire)
|
||||
/*
|
||||
* Customers orders to be billed
|
||||
*/
|
||||
if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire)
|
||||
if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
$commandestatic=new Commande($db);
|
||||
$langs->load("orders");
|
||||
@@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
|
||||
/*
|
||||
* Unpaid customers invoices
|
||||
*/
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$facstatic=new Facture($db);
|
||||
|
||||
@@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">';
|
||||
|
||||
@@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -25,9 +25,9 @@ $maxsizestring=255;
|
||||
$maxsizeint=10;
|
||||
|
||||
$extrasize=GETPOST('size');
|
||||
if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
|
||||
if (GETPOST('type')=='date') $extrasize='';
|
||||
if (GETPOST('type')=='datetime') $extrasize='';
|
||||
if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
|
||||
if (GETPOST('type')=='date') $extrasize='';
|
||||
if (GETPOST('type')=='datetime') $extrasize='';
|
||||
|
||||
|
||||
// Add attribute
|
||||
@@ -38,10 +38,10 @@ if ($action == 'add')
|
||||
// Check values
|
||||
if (! GETPOST('type'))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$action = 'create';
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
|
||||
$action = 'create';
|
||||
}
|
||||
|
||||
if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring)
|
||||
|
||||
@@ -369,8 +369,8 @@ class Form
|
||||
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
|
||||
$s="";
|
||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||
if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
|
||||
if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').'</'.$tag.'>';
|
||||
if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
|
||||
if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').'</'.$tag.'>';
|
||||
if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
|
||||
if (empty($notabs)) $s.='</tr></table>';
|
||||
|
||||
|
||||
@@ -199,9 +199,9 @@ class FormFile
|
||||
|
||||
global $langs,$bc,$conf;
|
||||
|
||||
// For backward compatibility
|
||||
if (! empty($iconPDF)) {
|
||||
return $this->getDocumentsLink($modulepart, $filename, $filedir);
|
||||
// For backward compatibility
|
||||
if (! empty($iconPDF)) {
|
||||
return $this->getDocumentsLink($modulepart, $filename, $filedir);
|
||||
}
|
||||
|
||||
$forname='builddoc';
|
||||
@@ -470,15 +470,15 @@ class FormFile
|
||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||
$out.= '>';
|
||||
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
|
||||
$out.= '</a>'."\n";
|
||||
$out.= '</a>'."\n";
|
||||
$out.= '</td>';
|
||||
|
||||
|
||||
// Show file size
|
||||
$size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
|
||||
$size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
|
||||
$out.= '<td align="right" nowrap="nowrap">'.dol_print_size($size).'</td>';
|
||||
|
||||
|
||||
// Show file date
|
||||
$date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
|
||||
$date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
|
||||
$out.= '<td align="right" nowrap="nowrap">'.dol_print_date($date, 'dayhour').'</td>';
|
||||
|
||||
if ($delallowed)
|
||||
@@ -526,35 +526,39 @@ class FormFile
|
||||
}
|
||||
|
||||
$out='';
|
||||
|
||||
|
||||
$this->numoffiles=0;
|
||||
|
||||
$file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$');
|
||||
|
||||
// For ajax treatment
|
||||
// For ajax treatment
|
||||
$out.= '<div id="gen_pdf_'.$filename.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n";
|
||||
|
||||
if (! empty($file_list))
|
||||
{
|
||||
// Loop on each file found
|
||||
foreach($file_list as $file)
|
||||
{
|
||||
// Define relative path for download link (depends on module)
|
||||
$relativepath=$file["name"]; // Cas general
|
||||
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') {
|
||||
$relativepath = get_exdir($filename,2).$file["name"];
|
||||
}
|
||||
if ($modulepart == 'export') {
|
||||
$relativepath = $file["name"];
|
||||
}
|
||||
|
||||
// Show file name with link to download
|
||||
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||
$mime=dol_mimetype($relativepath,'',0);
|
||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||
$out.= '>';
|
||||
$out.= img_pdf($file["name"],2);
|
||||
$out.= '</a>'."\n";
|
||||
// Loop on each file found
|
||||
foreach($file_list as $file)
|
||||
{
|
||||
// Define relative path for download link (depends on module)
|
||||
$relativepath=$file["name"]; // Cas general
|
||||
if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture...
|
||||
// Autre cas
|
||||
if ($modulepart == 'donation') {
|
||||
$relativepath = get_exdir($filename,2).$file["name"];
|
||||
}
|
||||
if ($modulepart == 'export') {
|
||||
$relativepath = $file["name"];
|
||||
}
|
||||
|
||||
// Show file name with link to download
|
||||
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||
$mime=dol_mimetype($relativepath,'',0);
|
||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||
$out.= '>';
|
||||
$out.= img_pdf($file["name"],2);
|
||||
$out.= '</a>'."\n";
|
||||
|
||||
$this->numoffiles++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -739,12 +739,12 @@ function dol_format_address($object)
|
||||
}
|
||||
else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country
|
||||
{
|
||||
$ret .= ($ret ? "\n" : '' ).$object->town;
|
||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||
{
|
||||
$ret.=", ".$object->departement;
|
||||
}
|
||||
if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||
$ret .= ($ret ? "\n" : '' ).$object->town;
|
||||
if ($object->state && in_array($object->country_code,$countriesusingstate))
|
||||
{
|
||||
$ret.=", ".$object->departement;
|
||||
}
|
||||
if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
|
||||
}
|
||||
else // Other: title firstname name \n address lines \n zip town \n country
|
||||
{
|
||||
|
||||
@@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
|
||||
$result=array();
|
||||
|
||||
// TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller.
|
||||
if ($localtax1_type == '?')
|
||||
{
|
||||
if ($mysoc->country_code=='ES') $localtax1_type='1';
|
||||
else $localtax1_type='0';
|
||||
}
|
||||
if ($localtax2_type == '?')
|
||||
{
|
||||
if ($mysoc->country_code=='ES') $localtax2_type='1';
|
||||
else $localtax2_type='0';
|
||||
}
|
||||
if ($localtax1_type == '?')
|
||||
{
|
||||
if ($mysoc->country_code=='ES') $localtax1_type='1';
|
||||
else $localtax1_type='0';
|
||||
}
|
||||
if ($localtax2_type == '?')
|
||||
{
|
||||
if ($mysoc->country_code=='ES') $localtax2_type='1';
|
||||
else $localtax2_type='0';
|
||||
}
|
||||
|
||||
// initialize total (may be HT or TTC depending on price_base_type)
|
||||
$tot_sans_remise = $pu * $qty;
|
||||
@@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
|
||||
$apply_tax = false;
|
||||
|
||||
//If price is 'TTC' we need to have the totals without VAT for a correct calculation
|
||||
if ($price_base_type=='TTC')
|
||||
{
|
||||
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
|
||||
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
|
||||
if ($price_base_type=='TTC')
|
||||
{
|
||||
$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
|
||||
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
|
||||
}
|
||||
|
||||
switch($localtax1_type) {
|
||||
|
||||
@@ -162,7 +162,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("Sending"));
|
||||
@@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$tab_top = 52;
|
||||
$tab_top_newpage = 10;
|
||||
$tab_top_newpage = 10;
|
||||
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
|
||||
$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
|
||||
$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
|
||||
|
||||
$pdf->SetFillColor(240,240,240);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
@@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
|
||||
//Creation des cases a cocher
|
||||
$pdf->Rect(10+3, $curY, 3, 3);
|
||||
$pdf->Rect(20+3, $curY, 3, 3);
|
||||
//Insertion de la reference du produit
|
||||
$pdf->SetXY(30, $curY);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
|
||||
//Creation des cases a cocher
|
||||
$pdf->Rect(10+3, $curY, 3, 3);
|
||||
$pdf->Rect(20+3, $curY, 3, 3);
|
||||
//Insertion de la reference du produit
|
||||
$pdf->SetXY(30, $curY);
|
||||
$pdf->SetFont('','B', $default_font_size - 3);
|
||||
$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
|
||||
|
||||
$pdf->SetXY(140, $curY);
|
||||
$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0);
|
||||
@@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
||||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
// Show square
|
||||
if ($pagenb == 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
|
||||
@@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
|
||||
@@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
{
|
||||
$curY = $nexY;
|
||||
|
||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposbefore=$pdf->getPage();
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size - 1);
|
||||
$pdf->SetXY($this->marge_gauche, $curY);
|
||||
@@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
$pageposafter=$pdf->getPage();
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
while ($pagenb < $pageposafter)
|
||||
|
||||
@@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
@@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
*/
|
||||
class pdf_azur extends ModelePDFPropales
|
||||
{
|
||||
var $db;
|
||||
var $name;
|
||||
var $description;
|
||||
var $type;
|
||||
|
||||
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
|
||||
var $version = 'dolibarr';
|
||||
|
||||
var $page_largeur;
|
||||
var $page_hauteur;
|
||||
var $format;
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
var $db;
|
||||
var $name;
|
||||
var $description;
|
||||
var $type;
|
||||
|
||||
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
|
||||
var $version = 'dolibarr';
|
||||
|
||||
var $page_largeur;
|
||||
var $page_hauteur;
|
||||
var $format;
|
||||
var $marge_gauche;
|
||||
var $marge_droite;
|
||||
var $marge_haute;
|
||||
var $marge_basse;
|
||||
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
@@ -279,7 +279,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
@@ -1057,7 +1057,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFillColor(230,230,230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
|
||||
// Show sender name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
|
||||
@@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
// We suppose that a too long description is moved completely on next page
|
||||
if ($pageposafter > $pageposbefore) {
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ if ($resql)
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
@@ -416,7 +416,7 @@ print '<td width="16" align="right" class="nobordernopadding">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
|
||||
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
@@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php';
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("holiday");
|
||||
$langs->load("admin");
|
||||
$langs->load("holiday");
|
||||
|
||||
// Si pas administrateur
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
@@ -248,7 +248,7 @@ print '</form>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ $extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
||||
$type2label=array('');
|
||||
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
||||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
Reference in New Issue
Block a user