Merge pull request #12235 from frederic34/scopeindent

clean indent
This commit is contained in:
Laurent Destailleur 2019-10-30 02:57:59 +01:00 committed by GitHub
commit 66a288a343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
278 changed files with 6024 additions and 6104 deletions

View File

@ -65,21 +65,33 @@ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $productsid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$productsid[$i] = $row[0];
$i++;
}
} }
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array(); $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $societesid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$societesid[$i] = $row[0];
$i++;
}
} else { print "err"; } } else { print "err"; }
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array(); $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $commandesid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$commandesid[$i] = $row[0];
$i++;
}
} else { print "err"; } } else { print "err"; }

View File

@ -186,7 +186,7 @@
<!-- Check indent are done with spaces and with correct number --> <!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/> <arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"> <rule ref="Generic.WhiteSpace.ScopeIndent">
<properties> <properties>
@ -194,7 +194,7 @@
<property name="tabIndent" value="true"/> <property name="tabIndent" value="true"/>
</properties> </properties>
</rule> </rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" /> <rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />

View File

@ -56,30 +56,33 @@ $langs->loadLangs(array("main","bills","cashdesk"));
</td> </td>
<td class="select_design maxwidthonsmartphone"> <td class="select_design maxwidthonsmartphone">
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');"> <select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
<?php <?php
print '<option value="0">'.$top_liste_produits.'</option>'."\n"; print '<option value="0">'.$top_liste_produits.'</option>'."\n";
$id = $obj_facturation->id(); $id = $obj_facturation->id();
// Si trop d'articles ont ete trouves, on n'affiche que les X premiers (defini dans le fichier de configuration) ... // Si trop d'articles ont ete trouves, on n'affiche que les X premiers (defini dans le fichier de configuration) ...
$nbtoshow = $nbr_enreg; $nbtoshow = $nbr_enreg;
if (! empty($conf_taille_listes) && $nbtoshow > $conf_taille_listes) $nbtoshow = $conf_taille_listes; if (! empty($conf_taille_listes) && $nbtoshow > $conf_taille_listes) $nbtoshow = $conf_taille_listes;
for ($i = 0; $i < $nbtoshow; $i++) for ($i = 0; $i < $nbtoshow; $i++)
{ {
if ( $id == $tab_designations[$i]['rowid'] ) if ($id == $tab_designations[$i]['rowid']) {
$selected = 'selected'; $selected = 'selected';
else } else {
$selected = ''; $selected = '';
}
$label = $tab_designations[$i]['label']; $label = $tab_designations[$i]['label'];
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle'); print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle');
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')'; if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) {
print '</option>'."\n"; print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
} }
?> print '</option>'."\n";
}
?>
</select> </select>
</td> </td>
</tr> </tr>

View File

@ -36,16 +36,16 @@ $langs->loadLangs(array("main","bills","banks"));
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
<?php <?php
// Affichage de la tva par taux // Affichage de la tva par taux
if ( $obj_facturation->montantTva() ) { if ( $obj_facturation->montantTva() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
else else
{ {
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
} }
?> ?>
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td> <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
<?php <?php
@ -82,20 +82,20 @@ $langs->loadLangs(array("main","bills","banks"));
?> ?>
</td></tr> </td></tr>
<?php <?php
// Affichage des infos en fonction du mode de paiement // Affichage des infos en fonction du mode de paiement
if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) { if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
} else { } else {
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
// Affichage du montant rendu (reglement en especes) // Affichage du montant rendu (reglement en especes)
if ( $obj_facturation->montantRendu() ) { if ( $obj_facturation->montantRendu() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
?> ?>
</table> </table>

View File

@ -1582,8 +1582,9 @@ if ($id > 0)
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -12,7 +12,7 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -170,9 +170,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -125,9 +125,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -86,9 +86,10 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -280,8 +280,9 @@ $sql.= ' u.login';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook

View File

@ -101,9 +101,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -29,11 +29,8 @@ if (empty($conf) || ! is_object($conf)) {
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
@ -45,51 +42,46 @@ $langs->load("propal");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > print '<td class="linkedcol-element" >'.$langs->trans("Proposal");
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?> if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
<?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{ {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>'; print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
} }
?> print '</td>';
</td> print '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td> print '<td class="linkedcol-ref" >'.$objectlink->ref_client.'</td>';
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td> print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> print '<td class="linkedcol-amount right">';
<td class="linkedcol-amount right"><?php
if ($user->rights->propale->lire) { if ($user->rights->propale->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> }
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> print '</td>';
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
</tr> print '<td class="linkedcol-action right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
<?php print "</tr>\n";
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
?> print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>"> print '<td>'.$langs->trans("Total").'</td>';
<td><?php echo $langs->trans("Total"); ?></td> print '<td></td>';
<td></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="right">'.price($total).'</td>';
<td class="right"><?php echo price($total); ?></td> print '<td class="right"></td>';
<td class="right"></td> print '<td class="right"></td>';
<td class="right"></td> print "</tr>\n";
</tr>
<?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -306,7 +306,7 @@ else
$log="graph.php: min=".$min." max=".$max; $log="graph.php: min=".$min." max=".$max;
dol_syslog($log); dol_syslog($log);
// CRED PART // CRED PART
// Chargement du tableau des années // Chargement du tableau des années
$tblyear[0] = array(); $tblyear[0] = array();
$tblyear[1] = array(); $tblyear[1] = array();
@ -393,7 +393,7 @@ else
unset($tblyear[1]); unset($tblyear[1]);
unset($tblyear[2]); unset($tblyear[2]);
// DEDBT PART // DEDBT PART
// Chargement du tableau des années // Chargement du tableau des années
$tblyear[0] = array(); $tblyear[0] = array();
$tblyear[1] = array(); $tblyear[1] = array();

View File

@ -427,8 +427,9 @@ if ($id)
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -92,8 +92,9 @@ if ($object->id)
$morehtmlref.=$langs->trans('Project') . ' : '; $morehtmlref.=$langs->trans('Project') . ' : ';
if ($user->rights->banque->modifier && 0) if ($user->rights->banque->modifier && 0)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -61,8 +61,9 @@ if (! empty($conf->projet->enabled))
$morehtmlref.=$langs->trans('Project') . ' : '; $morehtmlref.=$langs->trans('Project') . ' : ';
if ($user->rights->banque->modifier && 0) if ($user->rights->banque->modifier && 0)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -14,7 +14,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -815,7 +815,9 @@ if (empty($reshook))
$sql .= " WHERE fk_facture = " . $object->id; $sql .= " WHERE fk_facture = " . $object->id;
$resql = $db->query($sql); $resql = $db->query($sql);
if (!empty($resql)) { if (!empty($resql)) {
while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc; while ($obj = $db->fetch_object($resql)) {
$total_creditnote_and_deposit += $obj->amount_ttc;
}
} else dol_print_error($db); } else dol_print_error($db);
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; $discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
@ -3274,11 +3276,11 @@ if ($action == 'create')
print '<td colspan="2">'; print '<td colspan="2">';
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
$liste = ModelePDFFactures::liste_modeles($db); $liste = ModelePDFFactures::liste_modeles($db);
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){ // Hidden conf if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){
// Hidden conf
$paramkey='FACTURE_ADDON_PDF_'.$object->type; $paramkey='FACTURE_ADDON_PDF_'.$object->type;
$curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF; $curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF;
} } else {
else{
$curent = $conf->global->FACTURE_ADDON_PDF; $curent = $conf->global->FACTURE_ADDON_PDF;
} }
print $form->selectarray('model', $liste, $curent); print $form->selectarray('model', $liste, $curent);
@ -3803,8 +3805,9 @@ elseif ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($usercancreate) if ($usercancreate)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -529,8 +529,7 @@ class Invoices extends DolibarrApi
// update bank account // update bank account
if (!empty($this->invoice->fk_account)) if (!empty($this->invoice->fk_account))
{ {
if($this->invoice->setBankAccount($this->invoice->fk_account) == 0) if ($this->invoice->setBankAccount($this->invoice->fk_account) == 0) {
{
throw new RestException(400, $this->invoice->error); throw new RestException(400, $this->invoice->error);
} }
} }
@ -909,11 +908,11 @@ class Invoices extends DolibarrApi
$result = $this->invoice->fetch($id); $result = $this->invoice->fetch($id);
if( ! $result ) { if (! $result) {
throw new RestException(404, 'Invoice not found'); throw new RestException(404, 'Invoice not found');
} }
if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }

View File

@ -2587,10 +2587,12 @@ class Facture extends CommonInvoice
$next_invoice->brouillon = 1; $next_invoice->brouillon = 1;
foreach ($next_invoice->lines as $line) foreach ($next_invoice->lines as $line)
{ {
$result = $next_invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $result = $next_invoice->updateline(
$line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent,
$line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type,
$line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent,
$line->fk_unit); $line->fk_unit
);
if ($result < 0) if ($result < 0)
{ {

View File

@ -163,9 +163,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -1242,8 +1242,9 @@ else
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -223,8 +223,9 @@ $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,
$sql.= " f.datec, f.tms,"; $sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
@ -632,8 +633,7 @@ if ($resql)
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Status // Status
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked'])) {
{
print '<td align="center">'; print '<td align="center">';
print $invoicerectmp->getLibStatut(3, 0); print $invoicerectmp->getLibStatut(3, 0);
print '</td>'; print '</td>';

View File

@ -400,8 +400,9 @@ $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@ -1352,8 +1353,7 @@ if ($resql)
|| isset($totalarray['totalttcfield']) || isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield']) || isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield']) || isset($totalarray['totalrtpfield'])
) ) {
{
print '<tr class="liste_total">'; print '<tr class="liste_total">';
$i=0; $i=0;
while ($i < $totalarray['nbfield']) while ($i < $totalarray['nbfield'])

View File

@ -189,9 +189,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -233,48 +233,45 @@ foreach ($tmp_companies as $value) {
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
//if (empty($socid)) // Show filter box
//{ print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
// Show filter box print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<table class="noborder" width="100%">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
print '<table class="noborder" width="100%">'; // Company
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
// Company if ($mode == 'customer') $filter='s.client in (1,2,3)';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; if ($mode == 'supplier') $filter='s.fournisseur = 1';
if ($mode == 'customer') $filter='s.client in (1,2,3)'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
if ($mode == 'supplier') $filter='s.fournisseur = 1'; print '</td></tr>';
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); // User
print '</td></tr>'; print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
// User print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'; print '</td></tr>';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); // Status
print '</td></tr>'; print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
// Status if ($mode == 'customer')
print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">'; {
if ($mode == 'customer')
{
$liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); $liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled"));
print $form->selectarray('object_status', $liststatus, $object_status, 1); print $form->selectarray('object_status', $liststatus, $object_status, 1);
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid")); $liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"));
print $form->selectarray('object_status', $liststatus, $object_status, 1); print $form->selectarray('object_status', $liststatus, $object_status, 1);
} }
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year; if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year;
if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear; if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear;
arsort($arrayyears); arsort($arrayyears);
print $form->selectarray('year', $arrayyears, $year, 0); print $form->selectarray('year', $arrayyears, $year, 0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
print '<br><br>'; print '<br><br>';
//}
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?> print "<!-- BEGIN PHP TEMPLATE -->\n";
<!-- BEGIN PHP TEMPLATE -->
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -40,16 +36,16 @@ $langs->load("bills");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > print '<td class="linkedcol-element">';
<td class="linkedcol-element"><?php
switch ($objectlink->type) { switch ($objectlink->type) {
case Facture::TYPE_REPLACEMENT: case Facture::TYPE_REPLACEMENT:
echo $langs->trans("InvoiceReplacement"); echo $langs->trans("InvoiceReplacement");
@ -70,16 +66,16 @@ foreach($linkedObjectBlock as $key => $objectlink)
echo $langs->trans("CustomerInvoice"); echo $langs->trans("CustomerInvoice");
break; break;
} }
?></td> print '</td>';
<td class="linkedcol-name nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td> print '<td class="linkedcol-name nowraponall">'.$objectlink->getNomUrl(1).'</td>';
<td class="linkedcol-ref left"><?php echo $objectlink->ref_client; ?></td> print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
<td class="linkedcol-amount right"><?php print '<td class="linkedcol-amount right">';
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$sign = 1; $sign = 1;
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
if ($objectlink->statut != 3) // If not abandonned if ($objectlink->statut != 3) {
{ // If not abandonned
$total = $total + $sign * $objectlink->total_ht; $total = $total + $sign * $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} }
@ -87,26 +83,23 @@ foreach($linkedObjectBlock as $key => $objectlink)
{ {
echo '<strike>'.price($objectlink->total_ht).'</strike>'; echo '<strike>'.price($objectlink->total_ht).'</strike>';
} }
} ?></td> }
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> print '</td>';
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
</tr> print '<td class="linkedcol-action right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
<?php print "</tr>\n";
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
?> print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>"> print '<td>'.$langs->trans("Total").'</td>';
<td><?php echo $langs->trans("Total"); ?></td> print '<td></td>';
<td></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="right">'.price($total).'</td>';
<td class="right"><?php echo price($total); ?></td> print '<td class="right"></td>';
<td class="right"></td> print '<td class="right"></td>';
<td class="right"></td> print '</tr>';
</tr>
<?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -24,11 +24,9 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -38,14 +36,15 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("bills"); $langs->load("bills");
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> ?>
<tr class="<?php echo $trclass; ?>" > <tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td> <td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td>
@ -55,11 +54,12 @@ foreach($linkedObjectBlock as $key => $objectlink)
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> }
?></td>
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>
<?php <?php
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
@ -75,6 +75,5 @@ if (count($linkedObjectBlock) > 1)
</tr> </tr>
<?php <?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -320,8 +320,6 @@ else
$span=$columns; $span=$columns;
if ($modetax != 1) $span+=2; if ($modetax != 1) $span+=2;
//if ($modetax == 0 || $modetax == 2)
//{
// Customers invoices // Customers invoices
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="left">'.$elementcust.'</td>'; print '<td class="left">'.$elementcust.'</td>';
@ -481,9 +479,7 @@ else
print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>'; print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>';
print '</table>'; print '</table>';
$diff=$x_coll_sum; $diff=$x_coll_sum;
//}
//if($conf->global->$calc ==0 || $conf->global->$calc == 1){
echo '<table class="noborder" width="100%">'; echo '<table class="noborder" width="100%">';
//print table headers for this quadri - expenses now //print table headers for this quadri - expenses now
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -636,7 +632,6 @@ else
} }
print '</table>'; print '</table>';
//}
// Total to pay // Total to pay
print '<br><br>'; print '<br><br>';

View File

@ -271,7 +271,7 @@ if ($id > 0 || $ref)
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode", $object->methodes_trans); print $form->selectarray("methode", $object->methodes_trans);
print '</td></tr>'; print '</td></tr>';
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>'; /*print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">'; print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>'; print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';*/ print '</td></tr>';*/

View File

@ -1887,15 +1887,15 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf; $XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
$XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf; $XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf;
$XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf; $XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf;
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf; /* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf; $XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf; $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf; $XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
*/ $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf;
$XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf; $XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf;
$XML_SEPA_INFO .= ' <Id>'.$CrLf; $XML_SEPA_INFO .= ' <Id>'.$CrLf;
$XML_SEPA_INFO .= ' <PrvtId>'.$CrLf; $XML_SEPA_INFO .= ' <PrvtId>'.$CrLf;

View File

@ -749,17 +749,17 @@ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$sql.= " AND fk_statut in (1,2)"; $sql.= " AND fk_statut in (1,2)";
if (! empty($date_start) && ! empty($date_end)) if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
} } elseif ($modecompta == 'RECETTES-DEPENSES') {
elseif ($modecompta == 'RECETTES-DEPENSES') {
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";
$sql.= " WHERE p.entity IN (".getEntity('donation').")"; $sql.= " WHERE p.entity IN (".getEntity('donation').")";
$sql.= " AND fk_statut >= 2"; $sql.= " AND fk_statut >= 2";
if (! empty($date_start) && ! empty($date_end)) if (! empty($date_start) && ! empty($date_end)) {
$sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'"; $sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'";
} }
}
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";

View File

@ -454,8 +454,9 @@ if ($id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->tax->charges->creer) if ($user->rights->tax->charges->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -241,47 +241,45 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
} }
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES') {
{ print '<table class="noborder" width="100%">';
print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("TurnoverbyVatrate") . '</td>';
print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("TurnoverbyVatrate") . '</td>'; print '<td class="left">' . $langs->trans("ProductOrService") . '</td>';
print '<td class="left">' . $langs->trans("ProductOrService") . '</td>'; print '<td class="left">' . $langs->trans("Country") . '</td>';
print '<td class="left">' . $langs->trans("Country") . '</td>'; $i=0;
$i=0; while($i < 12) {
while($i < 12)
{
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12; if ($j > 12) $j -= 12;
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
$i++; $i++;
} }
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>'; print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
$sql = "SELECT fd.tva_tx AS vatrate,"; $sql = "SELECT fd.tva_tx AS vatrate,";
$sql .= " fd.product_type AS product_type,"; $sql .= " fd.product_type AS product_type,";
$sql .= " cc.label AS country,"; $sql .= " cc.label AS country,";
for ($i = 1; $i <= 12; $i ++) { for ($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
$sql .= " SUM(fd.total_ht) as total"; $sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = f.fk_soc"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
$sql .= " WHERE f.datef >= '" . $db->idate($date_start) . "'"; $sql .= " WHERE f.datef >= '" . $db->idate($date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " AND f.datef <= '" . $db->idate($date_end) . "'";
$sql.= " AND f.fk_statut in (1,2)"; $sql.= " AND f.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (0,1,2,5)"; $sql.= " AND f.type IN (0,1,2,5)";
} else { } else {
$sql.= " AND f.type IN (0,1,2,3,5)"; $sql.= " AND f.type IN (0,1,2,3,5)";
} }
$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")";
$sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label "; $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label ";
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$totalpermonth = array(); $totalpermonth = array();
while ( $obj = $db->fetch_object($resql)) { while ( $obj = $db->fetch_object($resql)) {
@ -317,50 +315,50 @@ if ($resql) {
} }
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>'; print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
print '</tr>'; print '</tr>';
} else { } else {
print $db->lasterror(); // Show last sql error print $db->lasterror(); // Show last sql error
} }
print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("PurchasebyVatrate") . '</td>'; print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("PurchasebyVatrate") . '</td>';
print '<td class="left">' . $langs->trans("ProductOrService") . '</td>'; print '<td class="left">' . $langs->trans("ProductOrService") . '</td>';
print '<td class="left">' . $langs->trans("Country") . '</td>'; print '<td class="left">' . $langs->trans("Country") . '</td>';
$i=0; $i=0;
while($i < 12) while($i < 12)
{ {
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12; if ($j > 12) $j -= 12;
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
$i++; $i++;
} }
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>'; print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
$sql2 = "SELECT ffd.tva_tx AS vatrate,"; $sql2 = "SELECT ffd.tva_tx AS vatrate,";
$sql2 .= " ffd.product_type AS product_type,"; $sql2 .= " ffd.product_type AS product_type,";
$sql2 .= " cc.label AS country,"; $sql2 .= " cc.label AS country,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql2 .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql2 .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
$sql2 .= " SUM(ffd.total_ht) as total"; $sql2 .= " SUM(ffd.total_ht) as total";
$sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
$sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
$sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = ff.fk_soc"; $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = ff.fk_soc";
$sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays"; $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
$sql2 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'"; $sql2 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'";
$sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'"; $sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'";
$sql.= " AND ff.fk_statut in (1,2)"; $sql.= " AND ff.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND ff.type IN (0,1,2,5)"; $sql.= " AND ff.type IN (0,1,2,5)";
} else { } else {
$sql.= " AND ff.type IN (0,1,2,3,5)"; $sql.= " AND ff.type IN (0,1,2,3,5)";
} }
$sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; $sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")";
$sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label"; $sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label";
//print $sql2; //print $sql2;
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
$resql2 = $db->query($sql2); $resql2 = $db->query($sql2);
if ($resql2) { if ($resql2) {
$num = $db->num_rows($resql2); $num = $db->num_rows($resql2);
$totalpermonth = array(); $totalpermonth = array();
while ( $obj = $db->fetch_object($resql2)) { while ( $obj = $db->fetch_object($resql2)) {
@ -396,10 +394,10 @@ if ($resql2) {
} }
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>'; print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
print '</tr>'; print '</tr>';
} else { } else {
print $db->lasterror(); // Show last sql error print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
} else { } else {
// $modecompta != 'CREANCES-DETTES' // $modecompta != 'CREANCES-DETTES'
// "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an

View File

@ -326,7 +326,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Array header // Array header
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Product"), $langs->trans("Product"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"ref", "ref",
@ -336,7 +336,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('Quantity'), $langs->trans('Quantity'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -346,7 +346,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -356,7 +356,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('AmountHT'), $langs->trans('AmountHT'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount", "amount",
@ -366,7 +366,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("AmountTTC"), $langs->trans("AmountTTC"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",
@ -376,7 +376,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",

View File

@ -172,7 +172,7 @@ if ($modecompta == 'CREANCES-DETTES')
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
else $sql.= " AND f.type IN (0,1,2,3,5)"; else $sql.= " AND f.type IN (0,1,2,3,5)";
$sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid; if ($socid) $sql.= " AND f.fk_soc = ".$socid;
} }
elseif ($modecompta=="RECETTES-DEPENSES") elseif ($modecompta=="RECETTES-DEPENSES")
{ {
@ -187,7 +187,7 @@ elseif ($modecompta=="RECETTES-DEPENSES")
$sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " WHERE p.rowid = pf.fk_paiement";
$sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid; if ($socid) $sql.= " AND f.fk_soc = ".$socid;
} }
elseif ($modecompta=="BOOKKEEPING") elseif ($modecompta=="BOOKKEEPING")
{ {

View File

@ -135,13 +135,15 @@ echo $this->control->tpl['ajax_selectcountry'];
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td> <td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
</tr> </tr>
<?php if (! empty($this->control->tpl['contact_element'])) { ?> <?php
<?php foreach ($this->control->tpl['contact_element'] as $element) { ?> if (! empty($this->control->tpl['contact_element'])) {
<tr> foreach ($this->control->tpl['contact_element'] as $element) {
<td><?php echo $element['linked_element_label']; ?></td> print '<tr>';
<td colspan="3"><?php echo $element['linked_element_value']; ?></td> print '<td>'.$element['linked_element_label'].'</td>';
</tr> print '<td colspan="3">'.$element['linked_element_value'].'</td>';
<?php } } ?> print '</tr>';
}
} ?>
<tr> <tr>
<td><?php echo $langs->trans("DolibarrLogin"); ?></td> <td><?php echo $langs->trans("DolibarrLogin"); ?></td>

View File

@ -24,17 +24,14 @@ if (empty($conf) || ! is_object($conf))
$contact = $GLOBALS['objcanvas']->control->object; $contact = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT --> print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
<?php echo $this->control->tpl['showhead']; ?> echo $this->control->tpl['showhead'];
<?php
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
?>
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?> if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?> if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
<table class="border allwidth"> <table class="border allwidth">
@ -134,29 +131,27 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
</table> </table>
<?php echo $this->control->tpl['showend']; ?> <?php echo $this->control->tpl['showend'];
<?php if (empty($user->societe_id)) { ?> if (empty($user->societe_id)) {
<div class="tabsAction"> print '<div class="tabsAction">';
if ($user->rights->societe->contact->creer) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
}
<?php if ($user->rights->societe->contact->creer) { ?> if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a> print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
<?php } ?> }
<?php if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { ?> if ($user->rights->societe->contact->supprimer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a> print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
<?php } ?> }
<?php if ($user->rights->societe->contact->supprimer) { ?> print '</div><br>';
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a> }
<?php } ?>
</div><br>
<?php }
echo $this->control->tpl['actionstodo']; echo $this->control->tpl['actionstodo'];
echo $this->control->tpl['actionsdone']; echo $this->control->tpl['actionsdone'];
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -151,7 +151,7 @@ if ($object->thirdparty->fournisseur)
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders'); if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders');
// There no contact type for supplier proposals // There no contact type for supplier proposals
// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); // if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
} }
print '</table>'; print '</table>';
@ -298,7 +298,7 @@ if (!empty($sql_select))
$sql.= " "; $sql.= " ";
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label"; if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
$sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from; $sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from;
// if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; // if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid ';
$sql.= $where; $sql.= $where;
$sql.= dolSqlDateFilter($dateprint, 0, $month, $year); $sql.= dolSqlDateFilter($dateprint, 0, $month, $year);
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";

View File

@ -63,8 +63,8 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield=$conf->global->MAIN_DOC_SORT_FIELD; } if (! empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield=$conf->global->MAIN_DOC_SORT_FIELD; }
if (! empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder=$conf->global->MAIN_DOC_SORT_ORDER; } if (! empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder=$conf->global->MAIN_DOC_SORT_ORDER; }
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name"; if (! $sortfield) $sortfield="name";

View File

@ -164,8 +164,9 @@ if ($id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -331,9 +331,8 @@ if (empty($reshook))
// Extrafields // Extrafields
$array_options = array(); $array_options = array();
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if // For avoid conflicts if trigger used
// trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
{
$lines[$i]->fetch_optionals($lines[$i]->rowid); $lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options; $array_options = $lines[$i]->array_options;
} }
@ -1419,8 +1418,9 @@ else
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
@ -2254,7 +2254,7 @@ $db->close();
if (! empty($conf->margin->enabled) && $action == 'editline') if (! empty($conf->margin->enabled) && $action == 'editline')
{ {
// TODO Why this ? To manage margin on contracts ? // TODO Why this ? To manage margin on contracts ?
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var idprod = $("input[name='idprod']").val(); var idprod = $("input[name='idprod']").val();
@ -2309,5 +2309,5 @@ $(document).ready(function() {
} }
}); });
</script> </script>
<?php <?php
} }

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -706,8 +706,9 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))
{ {
print '<td class="right">'; print '<td class="right">';
if ($obj->cstatut == 0) // If contract is draft, we say line is also draft if ($obj->cstatut == 0)
{ {
// If contract is draft, we say line is also draft
print $contractstatic->LibStatut(0, 5); print $contractstatic->LibStatut(0, 5);
} }
else else

View File

@ -23,11 +23,9 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -45,7 +43,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> ?>
<tr class="<?php echo $trclass; ?>"> <tr class="<?php echo $trclass; ?>">
<td><?php echo $langs->trans("Contract"); ?></td> <td><?php echo $langs->trans("Contract"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td> <td><?php echo $objectlink->getNomUrl(1); ?></td>
@ -65,8 +63,9 @@ foreach($linkedObjectBlock as $key => $objectlink)
echo price($totalcontrat); echo price($totalcontrat);
} ?></td> } ?></td>
<td class="right"><?php echo $objectlink->getLibStatut(7); ?></td> <td class="right"><?php echo $objectlink->getLibStatut(7); ?></td>
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>
<?php } ?> <?php
}
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -82,8 +82,8 @@ elseif (GETPOST('linkit', 'none') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($action == 'confirm_deletefile' && $confirm == 'yes')
{ {
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir if (GETPOST('section', 'alpha')) {
{ // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
$file = $upload_dir . (preg_match('/\/$/', $upload_dir) ? '' : '/') . $urlfile; $file = $upload_dir . (preg_match('/\/$/', $upload_dir) ? '' : '/') . $urlfile;
} }
else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
@ -94,8 +94,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
$linkid = GETPOST('linkid', 'int'); $linkid = GETPOST('linkid', 'int');
if ($urlfile) // delete of a file if ($urlfile) {
{ // delete of a file
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine $dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette (if file is an image) $dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette (if file is an image)
@ -118,8 +118,11 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
} }
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs'); if ($ret) {
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors'); setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
}
} }
elseif ($linkid) // delete of external link elseif ($linkid) // delete of external link
{ {
@ -140,10 +143,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
} }
if (is_object($object) && $object->id > 0) if (is_object($object) && $object->id > 0) {
{ if ($backtopage) {
if ($backtopage)
{
header('Location: ' . $backtopage); header('Location: ' . $backtopage);
exit; exit;
} }

View File

@ -12,7 +12,7 @@
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com> * Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -4612,7 +4612,7 @@ abstract class CommonObject
$parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams); $parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams);
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if(empty($reshook)) if (empty($reshook))
{ {
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null')); dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
@ -4631,7 +4631,9 @@ abstract class CommonObject
} }
// Search template files // Search template files
$file=''; $classname=''; $filefound=0; $file='';
$classname='';
$filefound=0;
$dirmodels=array('/'); $dirmodels=array('/');
if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels, $conf->modules_parts['models']); if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels, $conf->modules_parts['models']);
foreach($dirmodels as $reldir) foreach($dirmodels as $reldir)
@ -4771,8 +4773,7 @@ abstract class CommonObject
$setsharekey=true; $setsharekey=true;
} }
if ($setsharekey) if ($setsharekey) {
{
if (empty($ecmfile->share)) // Because object not found or share not set yet if (empty($ecmfile->share)) // Because object not found or share not set yet
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
@ -4788,8 +4789,7 @@ abstract class CommonObject
$ecmfile->description = ''; // indexed content $ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content $ecmfile->keyword = ''; // keyword content
$result = $ecmfile->update($user); $result = $ecmfile->update($user);
if ($result < 0) if ($result < 0) {
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
} }
} }
@ -4807,8 +4807,7 @@ abstract class CommonObject
$ecmfile->src_object_id = $this->id; $ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user); $result = $ecmfile->create($user);
if ($result < 0) if ($result < 0) {
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
} }
} }
@ -4827,9 +4826,9 @@ abstract class CommonObject
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) dol_print_error($this->db); if (! $resql) {
else dol_print_error($this->db);
{ } else {
$this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename; $this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename;
} }
} }
@ -6063,8 +6062,9 @@ abstract class CommonObject
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18); $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
} }
} }
if (empty($labeltoshow)) if (empty($labeltoshow)) {
$labeltoshow = '(not defined)'; $labeltoshow = '(not defined)';
}
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
$data[$obj->rowid]=$labeltoshow; $data[$obj->rowid]=$labeltoshow;

View File

@ -76,10 +76,9 @@ class FormContract
if ($socid > 0) if ($socid > 0)
{ {
// CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. // CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) {
$sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') } elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') {
{
$sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") ";
$sql.= " OR c.fk_soc IS NULL)"; $sql.= " OR c.fk_soc IS NULL)";
} }

View File

@ -139,8 +139,7 @@ class Menubase
{ {
$sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu"; $sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu";
$resqlrowid=$this->db->query($sql); $resqlrowid=$this->db->query($sql);
if ($resqlrowid) if ($resqlrowid) {
{
$obj=$this->db->fetch_object($resqlrowid); $obj=$this->db->fetch_object($resqlrowid);
$maxrowid=$obj->maxrowid; $maxrowid=$obj->maxrowid;

View File

@ -220,8 +220,7 @@ class DoliDBMssql extends DoliDB
*/ */
public function close() public function close()
{ {
if ($this->db) if ($this->db) {
{
if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened, LOG_ERR); if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened, LOG_ERR);
$this->connected=false; $this->connected=false;
return mssql_close($this->db); return mssql_close($this->db);

View File

@ -1135,13 +1135,16 @@ class DoliDBPgsql extends DoliDB
$sql .= " ".$field_desc['attribute']; $sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i", $field_desc['null'])) if (preg_match("/^[^\s]/i", $field_desc['null']))
$sql .= " ".$field_desc['null']; $sql .= " ".$field_desc['null'];
if (preg_match("/^[^\s]/i", $field_desc['default'])) if (preg_match("/^[^\s]/i", $field_desc['default'])) {
if (preg_match("/null/i", $field_desc['default'])) if (preg_match("/null/i", $field_desc['default'])) {
$sql .= " default ".$field_desc['default']; $sql .= " default ".$field_desc['default'];
else } else {
$sql .= " default '".$field_desc['default']."'"; $sql .= " default '".$field_desc['default']."'";
if (preg_match("/^[^\s]/i", $field_desc['extra'])) }
}
if (preg_match("/^[^\s]/i", $field_desc['extra'])) {
$sql .= " ".$field_desc['extra']; $sql .= " ".$field_desc['extra'];
}
$sql .= " ".$field_position; $sql .= " ".$field_position;
dol_syslog($sql, LOG_DEBUG); dol_syslog($sql, LOG_DEBUG);

View File

@ -1081,7 +1081,7 @@ function price2numjs(amount) {
<?php <?php
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) { if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) {
?> ?>
// Defined properties for JNotify // Defined properties for JNotify
$(document).ready(function() { $(document).ready(function() {
if (typeof $.jnotify == 'function') if (typeof $.jnotify == 'function')

View File

@ -835,7 +835,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$start = "{user_extra_"; $start = "{user_extra_";
$end = "\}"; $end = "\}";
$extra= get_string_between($mask, "user_extra_", "}"); $extra= get_string_between($mask, "user_extra_", "}");
if(!empty($user->array_options['options_'.$extra])){ if (!empty($user->array_options['options_'.$extra])) {
$mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask); $mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask);
} }
} }

View File

@ -137,7 +137,7 @@ function invoice_admin_prepare_head()
$head[$h][2] = 'payment'; $head[$h][2] = 'payment';
$h++; $h++;
if($conf->global->INVOICE_USE_SITUATION){ if ($conf->global->INVOICE_USE_SITUATION) {
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
$head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][1] = $langs->trans("InvoiceSituation");
$head[$h][2] = 'situation'; $head[$h][2] = 'situation';

View File

@ -1417,7 +1417,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
//print '>'.$outputlangs->charset_output.','.$period; //print '>'.$outputlangs->charset_output.','.$period;
if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){ if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){
$libelleproduitservice.= '<b style="color:#333666;" ><em>'."__N__</b> ".$period.'</em>'; $libelleproduitservice.= '<b style="color:#333666;" ><em>'."__N__</b> ".$period.'</em>';
}else{ } else {
$libelleproduitservice.="__N__".$period; $libelleproduitservice.="__N__".$period;
} }
//print $libelleproduitservice; //print $libelleproduitservice;

View File

@ -313,8 +313,14 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{ {
if (empty($user->rights->$feature->$subfeature->creer) if (empty($user->rights->$feature->$subfeature->creer)
&& empty($user->rights->$feature->$subfeature->write) && empty($user->rights->$feature->$subfeature->write)
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; } && empty($user->rights->$feature->$subfeature->create)) {
else { $createok=1; break; } // Break to bypass second test if the first is ok $createok=0;
$nbko++;
} else {
$createok=1;
// Break to bypass second test if the first is ok
break;
}
} }
} }
elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write') elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write')
@ -322,7 +328,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
//print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write; //print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
if (empty($user->rights->$feature->creer) if (empty($user->rights->$feature->creer)
&& empty($user->rights->$feature->write) && empty($user->rights->$feature->write)
&& empty($user->rights->$feature->create)) { $createok=0; $nbko++; } && empty($user->rights->$feature->create)) {
$createok=0;
$nbko++;
}
} }
} }

View File

@ -690,10 +690,10 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.=$actionstatic->getNomUrl(1, -1).' '; $out.=$actionstatic->getNomUrl(1, -1).' ';
} }
// if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id) //if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)
// { //{
// $out.='<a href="'.$url.'" class="timeline-btn" title="'.$langs->trans('Show').'" ><i class="fa fa-calendar" ></i>'.$langs->trans('Show').'</a>'; // $out.='<a href="'.$url.'" class="timeline-btn" title="'.$langs->trans('Show').'" ><i class="fa fa-calendar" ></i>'.$langs->trans('Show').'</a>';
// } //}
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
@ -723,10 +723,8 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.="</span>\n"; $out.="</span>\n";
// Ref // Ref
$out.='<h3 class="timeline-header">'; $out.='<h3 class="timeline-header">';
// Author of event // Author of event
$out.='<span class="messaging-author">'; $out.='<span class="messaging-author">';
if ($histo[$key]['userid'] > 0) if ($histo[$key]['userid'] > 0)
@ -739,11 +737,9 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
} }
$out.='</span>'; $out.='</span>';
// Title // Title
$out .= ' <span class="messaging-title">'; $out .= ' <span class="messaging-title">';
if($actionstatic->code == 'TICKET_MSG') { if($actionstatic->code == 'TICKET_MSG') {
$out .= $langs->trans('TicketNewMessage'); $out .= $langs->trans('TicketNewMessage');
} }

View File

@ -240,7 +240,6 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('main', 'other', 'errors')); $langs->loadLangs(array('main', 'other', 'errors'));
;
$_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword")); $_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword"));
} }

View File

@ -307,10 +307,12 @@ class MenuManager
print $val2['titre']; print $val2['titre'];
if ($relurl2) if ($relurl2)
{ {
if ($val2['enabled']) // Allowed if ($val2['enabled']) {
// Allowed
print '</a>'; print '</a>';
else } else {
print '</a>'; print '</a>';
}
} }
print '</li>'."\n"; print '</li>'."\n";
} }
@ -448,7 +450,7 @@ class MenuManager
unset($this->menu->liste); unset($this->menu->liste);
} }
} }
/* /*
if ($mode == 'jmobile') if ($mode == 'jmobile')
{ {
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
@ -506,7 +508,7 @@ class MenuManager
break; // Only first menu entry (so home) break; // Only first menu entry (so home)
} }
} }
*/ */
unset($this->menu); unset($this->menu);
return $res; return $res;

View File

@ -952,8 +952,6 @@ class pdf_einstein extends ModelePDFCommandes
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@ -7,7 +7,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1107,7 +1107,6 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@ -1139,8 +1138,6 @@ class pdf_eratosthene extends ModelePDFCommandes
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@ -324,8 +324,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) { if ($unite[$i]==1) {
$secon[$i]='vingt et'; $secon[$i]='vingt et';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} } else {
else {
$secon[$i]='vingt'; $secon[$i]='vingt';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} }
@ -334,8 +333,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) { if ($unite[$i]==1) {
$secon[$i]='trente et'; $secon[$i]='trente et';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} } else {
else {
$secon[$i]='trente'; $secon[$i]='trente';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} }

View File

@ -218,10 +218,9 @@ class pdf_rouget extends ModelePdfExpedition
$realpath=''; $realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
{ if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename= $obj['photo_vignette']; $filename= $obj['photo_vignette'];

View File

@ -139,19 +139,19 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
$result = $db->query($sql); $result = $db->query($sql);
if($db->num_rows($result) > 0): if ($db->num_rows($result) > 0) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$newref = $objp->max; $newref = $objp->max;
$newref++; $newref++;
while(strlen($newref) < $num_car): while (strlen($newref) < $num_car) {
$newref = "0".$newref; $newref = "0".$newref;
endwhile; }
else: } else {
$newref = 1; $newref = 1;
while(strlen($newref) < $num_car): while (strlen($newref) < $num_car) {
$newref = "0".$newref; $newref = "0".$newref;
endwhile; }
endif; }
$ref_number_int = ($newref+1)-1; $ref_number_int = ($newref+1)-1;

View File

@ -1271,8 +1271,7 @@ class pdf_crabe extends ModelePDFFactures
//Local tax 1 after VAT //Local tax 1 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{ //{
foreach($this->localtax1 as $localtax_type => $localtax_rate) foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach($localtax_rate as $tvakey => $tvaval) foreach($localtax_rate as $tvakey => $tvaval)

View File

@ -371,7 +371,7 @@ class pdf_sponge extends ModelePDFFactures
// Does we have at least one line with discount $this->atleastonediscount // Does we have at least one line with discount $this->atleastonediscount
foreach ($object->lines as $line) { foreach ($object->lines as $line) {
if ($line->remise_percent){ if ($line->remise_percent) {
$this->atleastonediscount = true; $this->atleastonediscount = true;
break; break;
} }
@ -769,10 +769,12 @@ class pdf_sponge extends ModelePDFFactures
} }
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0) {
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2_type && $localtax2ligne != 0) }
if ($localtax2_type && $localtax2ligne != 0) {
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
}
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0; if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
@ -781,8 +783,7 @@ class pdf_sponge extends ModelePDFFactures
$nexY = max($nexY, $posYAfterImage); $nexY = max($nexY, $posYAfterImage);
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
{
$pdf->setPage($pageposafter); $pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
@ -793,11 +794,9 @@ class pdf_sponge extends ModelePDFFactures
$nexY+=2; // Add space between lines $nexY+=2; // Add space between lines
// 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 == $pageposbeforeprintlines) if ($pagenb == $pageposbeforeprintlines) {
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
} }
else else
@ -811,10 +810,8 @@ class pdf_sponge extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) {
{ if ($pagenb == $pageposafter) {
if ($pagenb == $pageposafter)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
} }
else else
@ -1266,14 +1263,11 @@ class pdf_sponge extends ModelePDFFactures
$deja_paye = 0; $deja_paye = 0;
$i = 1; $i = 1;
if(!empty($TPreviousIncoice)){ if (!empty($TPreviousIncoice)) {
$pdf->setY($tab2_top); $pdf->setY($tab2_top);
$posy = $pdf->GetY(); $posy = $pdf->GetY();
foreach ($TPreviousIncoice as &$fac) {
foreach ($TPreviousIncoice as &$fac){
if($posy > $this->page_hauteur - 4 ) { if($posy > $this->page_hauteur - 4 ) {
$this->_pagefoot($pdf, $object, $outputlangs, 1); $this->_pagefoot($pdf, $object, $outputlangs, 1);
$pdf->addPage(); $pdf->addPage();
@ -1290,7 +1284,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if ($i>1) {
$facSign = $fac->total_ht>=0?'+':''; $facSign = $fac->total_ht>=0?'+':'';
} }
@ -1312,11 +1306,11 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if ($i>1) {
$facSign = $object->total_ht>=0?'+':''; // management of a particular customer case $facSign = $object->total_ht>=0?'+':''; // management of a particular customer case
} }
if($fac->type === facture::TYPE_CREDIT_NOTE){ if ($fac->type === facture::TYPE_CREDIT_NOTE) {
$facSign = '-'; // les avoirs $facSign = '-'; // les avoirs
} }
@ -1453,8 +1447,6 @@ class pdf_sponge extends ModelePDFFactures
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@ -1473,7 +1465,6 @@ class pdf_sponge extends ModelePDFFactures
} }
} }
} }
//} //}
// VAT // VAT

View File

@ -502,7 +502,7 @@ class pdf_soleil extends ModelePDFFicheinter
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
/* /*
$pdf->SetXY($this->marge_gauche, $tab_top); $pdf->SetXY($this->marge_gauche, $tab_top);
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8); $pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8);
@ -526,7 +526,7 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also. $pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
*/ */
// Output Rect // Output Rect
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter

View File

@ -255,7 +255,9 @@ class mailing_fraise extends MailingTargets
$sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false $sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")"; $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")";
// Filter on status // Filter on status
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1"; if (isset($_POST["filter"]) && $_POST["filter"] == '-1') {
$sql.= " AND a.statut=-1";
}
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)"; if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)";
if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)"; if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0"; if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0";

View File

@ -291,8 +291,7 @@ class mailing_thirdparties extends MailingTargets
$s.= $langs->trans('ProspectCustomer'); $s.= $langs->trans('ProspectCustomer');
$s.=': <select name="filter_client" class="flat">'; $s.=': <select name="filter_client" class="flat">';
$s.= '<option value="-1">&nbsp;</option>'; $s.= '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
{
$s.= '<option value="2">'.$langs->trans('Prospect').'</option>'; $s.= '<option value="2">'.$langs->trans('Prospect').'</option>';
} }
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
@ -303,14 +302,14 @@ class mailing_thirdparties extends MailingTargets
} }
$s.= '<option value="0">'.$langs->trans('NorProspectNorCustomer').'</option>'; $s.= '<option value="0">'.$langs->trans('NorProspectNorCustomer').'</option>';
$s.='</select> '; $s.= '</select> ';
$s.=$langs->trans("Status"); $s.= $langs->trans("Status");
$s.=': <select name="filter_status" class="flat">'; $s.= ': <select name="filter_status" class="flat">';
$s.='<option value="-1">&nbsp;</option>'; $s.= '<option value="-1">&nbsp;</option>';
$s.='<option value="1" selected>'.$langs->trans("Enabled").'</option>'; $s.= '<option value="1" selected>'.$langs->trans("Enabled").'</option>';
$s.='<option value="0">'.$langs->trans("Disabled").'</option>'; $s.= '<option value="0">'.$langs->trans("Disabled").'</option>';
$s.='</select>'; $s.= '</select>';
return $s; return $s;
} }

View File

@ -72,7 +72,8 @@ class modComptabilite extends DolibarrModules
$this->const = array(); $this->const = array();
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/comptabilite/temp", $this->dirs = array(
"/comptabilite/temp",
"/comptabilite/rapport", "/comptabilite/rapport",
"/comptabilite/export", "/comptabilite/export",
"/comptabilite/bordereau" "/comptabilite/bordereau"

View File

@ -298,8 +298,7 @@ class modExpedition extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object';
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) {
{
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@ -223,8 +223,7 @@ class modReception extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) {
{
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@ -148,7 +148,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
/* $r++; /*$r++;
$this->rights[$r][0] = 241; $this->rights[$r][0] = 241;
$this->rights[$r][1] = 'Read thirdparties customers'; $this->rights[$r][1] = 'Read thirdparties customers';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
@ -163,7 +163,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
*/ */
$r++; $r++;
$this->rights[$r][0] = 122; // id de la permission $this->rights[$r][0] = 122; // id de la permission
@ -172,7 +172,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
/* $r++; /* $r++;
$this->rights[$r][0] = 251; $this->rights[$r][0] = 251;
$this->rights[$r][1] = 'Create thirdparties customers'; $this->rights[$r][1] = 'Create thirdparties customers';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
@ -187,7 +187,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
*/ */
$r++; $r++;
$this->rights[$r][0] = 125; // id de la permission $this->rights[$r][0] = 125; // id de la permission

View File

@ -82,8 +82,8 @@ class modStripe extends DolibarrModules
// New pages on tabs // New pages on tabs
$this->tabs = array(); $this->tabs = array();
// Boxes // List of boxes
$this->boxes = array(); // List of boxes $this->boxes = array();
$r=0; $r=0;
// Permissions // Permissions

View File

@ -92,7 +92,7 @@ class modVariants extends DolibarrModules
// Array to add new pages in new tabs // Array to add new pages in new tabs
$this->tabs = array( $this->tabs = array(
// 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__' // 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__'
); );
// Dictionaries // Dictionaries

View File

@ -185,14 +185,12 @@ class modWebsite extends DolibarrModules
dol_mkdir($destroot); dol_mkdir($destroot);
$docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$'); $docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$');
foreach($docs as $cursorfile) foreach($docs as $cursorfile) {
{
$src=$srcroot.'/'.$cursorfile['name']; $src=$srcroot.'/'.$cursorfile['name'];
$dest=$destroot.'/'.$cursorfile['name']; $dest=$destroot.'/'.$cursorfile['name'];
$result=dol_copy($src, $dest, 0, 0); $result=dol_copy($src, $dest, 0, 0);
if ($result < 0) if ($result < 0) {
{
$langs->load("errors"); $langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest); $this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
} }

View File

@ -668,8 +668,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1); $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
'C');
} }
} }

View File

@ -142,10 +142,9 @@ class pdf_squille extends ModelePdfReception
$realpath=''; $realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
{ if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename= $obj['photo_vignette']; $filename= $obj['photo_vignette'];
@ -461,8 +460,7 @@ class pdf_squille extends ModelePdfReception
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C'); $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C'); //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
{
$pdf->SetXY($this->posxqtyordered, $curY); $pdf->SetXY($this->posxqtyordered, $curY);
if($object->lines[$i]->fk_commandefourndet!=$fk_commandefourndet){ if($object->lines[$i]->fk_commandefourndet!=$fk_commandefourndet){
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked, '', 'C'); $pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked, '', 'C');

View File

@ -198,8 +198,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
} }
// Add odtgeneration hook // Add odtgeneration hook
if (! is_object($hookmanager)) if (! is_object($hookmanager)) {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db); $hookmanager=new HookManager($this->db);
} }
@ -412,8 +411,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler->title = $object->builddoc_filename; $odfHandler->title = $object->builddoc_filename;
$odfHandler->subject = $object->builddoc_filename; $odfHandler->subject = $object->builddoc_filename;
if (! empty($conf->global->ODT_ADD_DOLIBARR_ID)) if (! empty($conf->global->ODT_ADD_DOLIBARR_ID)) {
{
$odfHandler->userdefined['dol_id'] = $object->id; $odfHandler->userdefined['dol_id'] = $object->id;
$odfHandler->userdefined['dol_element'] = $object->element; $odfHandler->userdefined['dol_element'] = $object->element;
} }

View File

@ -715,8 +715,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{ //{
//Local tax 1 //Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval) foreach ($this->localtax1 as $tvakey => $tvaval) {
{
if ($tvakey != 0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -743,8 +742,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{ //{
//Local tax 2 //Local tax 2
foreach($this->localtax2 as $tvakey => $tvaval) foreach($this->localtax2 as $tvakey => $tvaval) {
{
if ($tvakey != 0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;

View File

@ -4,7 +4,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Tim Otte <otte@meuser.it> * Copyright (C) 2019 Tim Otte <otte@meuser.it>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -674,7 +674,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
$text=$this->emetteur->name; $text=$this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
} }
/* /*
$pdf->SetFont('','B', $default_font_size + 3); $pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
@ -734,7 +734,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
// Show list of linked objects // Show list of linked objects
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
*/ */
if ($showaddress) if ($showaddress)
{ {
// Sender properties // Sender properties

View File

@ -1345,12 +1345,12 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->SetTextColor(0, 0, 60); $pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
} }
/* PHFAVRE /* PHFAVRE
$posy+=4; $posy+=4;
$pdf->SetXY($posx,$posy); $pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R'); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison, "day", false, $outputlangs, true), '', 'R');
*/ */
if ($object->thirdparty->code_fournisseur) if ($object->thirdparty->code_fournisseur)
{ {

View File

@ -47,195 +47,195 @@ print '<script type="text/javascript" language="javascript">
</script>'; </script>';
print load_fiche_titre($langs->trans("AdvTgtTitle")); print load_fiche_titre($langs->trans("AdvTgtTitle"));
print '<div class="tabBar">' . "\n"; print '<div class="tabBar">' . "\n";
print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n"; print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n";
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n";
print '<input type="hidden" name="action" value="">' . "\n"; print '<input type="hidden" name="action" value="">' . "\n";
print '<table class="border centpercent">' . "\n"; print '<table class="border centpercent">' . "\n";
print '<tr>' . "\n"; print '<tr>' . "\n";
print '<td colspan="3" class="right">' . "\n"; print '<td colspan="3" class="right">' . "\n";
print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n";
print '</td>' . "\n"; print '</td>' . "\n";
print '</tr>' . "\n"; print '</tr>' . "\n";
print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>'; print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>';
if (! empty($template_id)) { if (! empty($template_id)) {
$default_template = $template_id; $default_template = $template_id;
} else { } else {
$default_template = $advTarget->id; $default_template = $advTarget->id;
} }
print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element); print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template, 0, $advTarget->type_element);
print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>'; print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>';
print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>'; print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>';
print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>'; print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>';
print $langs->trans('AdvTgtOrCreateNewFilter'); print $langs->trans('AdvTgtOrCreateNewFilter');
print '<input type="text" name="template_name" id="template_name" value=""/>'; print '<input type="text" name="template_name" id="template_name" value=""/>';
print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>'; print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>'; print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>';
print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']); print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Customer name // Customer name
print '<tr><td>' . $langs->trans('ThirdPartyName'); print '<tr><td>' . $langs->trans('ThirdPartyName');
if (! empty($array_query['cust_name'])) { if (! empty($array_query['cust_name'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Code Client // Code Client
print '<tr><td>' . $langs->trans('CustomerCode'); print '<tr><td>' . $langs->trans('CustomerCode');
if (! empty($array_query['cust_code'])) { if (! empty($array_query['cust_code'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Address Client // Address Client
print '<tr><td>' . $langs->trans('Address'); print '<tr><td>' . $langs->trans('Address');
if (! empty($array_query['cust_adress'])) { if (! empty($array_query['cust_adress'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Zip Client // Zip Client
print '<tr><td>' . $langs->trans('Zip'); print '<tr><td>' . $langs->trans('Zip');
if (! empty($array_query['cust_zip'])) { if (! empty($array_query['cust_zip'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// City Client // City Client
print '<tr><td>' . $langs->trans('Town'); print '<tr><td>' . $langs->trans('Town');
if (! empty($array_query['cust_city'])) { if (! empty($array_query['cust_city'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Customer Country // Customer Country
print '<tr><td>' . $langs->trans("Country"); print '<tr><td>' . $langs->trans("Country");
if (count($array_query['cust_country']) > 0) { if (count($array_query['cust_country']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']); print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// State Customer // State Customer
print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty'); print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty');
if (count($array_query['cust_status']) > 0) { if (count($array_query['cust_status']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray( print $formadvtargetemaling->advMultiselectarray(
'cust_status', array ( 'cust_status', array (
'0' => $langs->trans('ActivityCeased'), '0' => $langs->trans('ActivityCeased'),
'1' => $langs->trans('InActivity') '1' => $langs->trans('InActivity')
), ),
$array_query['cust_status'] $array_query['cust_status']
); );
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Mother Company // Mother Company
print '<tr><td>' . $langs->trans("Maison mère"); print '<tr><td>' . $langs->trans("Maison mère");
if (! empty($array_query['cust_mothercompany'])) { if (! empty($array_query['cust_mothercompany'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>'; print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Prospect/Customer // Prospect/Customer
$selected = $array_query['cust_typecust']; $selected = $array_query['cust_typecust'];
print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty'); print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty');
if (count($array_query['cust_typecust']) > 0) { if (count($array_query['cust_typecust']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
$options_array = array ( $options_array = array (
2 => $langs->trans('Prospect'), 2 => $langs->trans('Prospect'),
3 => $langs->trans('ProspectCustomer'), 3 => $langs->trans('ProspectCustomer'),
1 => $langs->trans('Customer'), 1 => $langs->trans('Customer'),
0 => $langs->trans('NorProspectNorCustomer') 0 => $langs->trans('NorProspectNorCustomer')
); );
print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']); print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Prospection status // Prospection status
print '<tr><td>' . $langs->trans('ProspectLevel'); print '<tr><td>' . $langs->trans('ProspectLevel');
if (count($array_query['cust_prospect_status']) > 0) { if (count($array_query['cust_prospect_status']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1); print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Prospection comm status // Prospection comm status
print '<tr><td>' . $langs->trans('StatusProsp'); print '<tr><td>' . $langs->trans('StatusProsp');
if (count($array_query['cust_comm_status']) > 0) { if (count($array_query['cust_comm_status']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']); print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Customer Type // Customer Type
print '<tr><td>' . $langs->trans("ThirdPartyType"); print '<tr><td>' . $langs->trans("ThirdPartyType");
if (count($array_query['cust_typeent']) > 0) { if (count($array_query['cust_typeent']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']); print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Staff number // Staff number
print '<td>' . $langs->trans("Staff"); print '<td>' . $langs->trans("Staff");
if (count($array_query['cust_effectif_id']) > 0) { if (count($array_query['cust_effectif_id']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']); print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Sales manager // Sales manager
print '<tr><td>' . $langs->trans("SalesRepresentatives"); print '<tr><td>' . $langs->trans("SalesRepresentatives");
if (count($array_query['cust_saleman']) > 0) { if (count($array_query['cust_saleman']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user); print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Customer Default Langauge // Customer Default Langauge
if (! empty($conf->global->MAIN_MULTILANGS)) { if (! empty($conf->global->MAIN_MULTILANGS)) {
print '<tr><td>' . $langs->trans("DefaultLang"); print '<tr><td>' . $langs->trans("DefaultLang");
if (count($array_query['cust_language']) > 0) { if (count($array_query['cust_language']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
@ -244,9 +244,9 @@ print '<script type="text/javascript" language="javascript">
print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']); print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
// Customer Categories // Customer Categories
print '<tr><td>' . $langs->trans("CustomersCategoryShort"); print '<tr><td>' . $langs->trans("CustomersCategoryShort");
if (count($array_query['cust_categ']) > 0) { if (count($array_query['cust_categ']) > 0) {
@ -256,10 +256,10 @@ print '<script type="text/javascript" language="javascript">
print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']); print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
// Standard Extrafield feature // Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
$elementtype = Societe::$table_element; $elementtype = Societe::$table_element;
// fetch optionals attributes and labels // fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php'); dol_include_once('/core/class/extrafields.class.php');
@ -322,7 +322,7 @@ print '<script type="text/javascript" language="javascript">
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
} }
} else { } else {
$std_soc = new Societe($db); $std_soc = new Societe($db);
$action_search = 'query'; $action_search = 'query';
@ -338,68 +338,68 @@ print '<script type="text/javascript" language="javascript">
// Other attributes // Other attributes
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search);
print $hookmanager->resPrint; print $hookmanager->resPrint;
} }
// State Contact // State Contact
print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact'); print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact');
if (count($array_query['contact_status']) > 0) { if (count($array_query['contact_status']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->advMultiselectarray( print $formadvtargetemaling->advMultiselectarray(
'contact_status', 'contact_status',
array ( array (
'0' => $langs->trans('ActivityCeased'), '0' => $langs->trans('ActivityCeased'),
'1' => $langs->trans('InActivity') '1' => $langs->trans('InActivity')
), ),
$array_query['contact_status'] $array_query['contact_status']
); );
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Civility // Civility
print '<tr><td width="15%">' . $langs->trans("UserTitle"); print '<tr><td width="15%">' . $langs->trans("UserTitle");
if (count($array_query['contact_civility']) > 0) { if (count($array_query['contact_civility']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>'; print '</td><td>';
print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']); print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']);
print '</td></tr>'; print '</td></tr>';
// contact name // contact name
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname'); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname');
if (! empty($array_query['contact_lastname'])) { if (! empty($array_query['contact_lastname'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname'); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname');
if (! empty($array_query['contact_firstname'])) { if (! empty($array_query['contact_firstname'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n"; print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Contact Country // Contact Country
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country"); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country");
if (count($array_query['contact_country']) > 0) { if (count($array_query['contact_country']) > 0) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']); print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Never send mass mailing // Never send mass mailing
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email"); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email");
if (! empty($array_query['contact_no_email'])) { if (! empty($array_query['contact_no_email'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->selectarray( print $form->selectarray(
'contact_no_email', 'contact_no_email',
array ( array (
'' => '', '' => '',
@ -407,41 +407,41 @@ print '<script type="text/javascript" language="javascript">
'0' => $langs->trans('No') '0' => $langs->trans('No')
), ),
$array_query['contact_no_email'] $array_query['contact_no_email']
); );
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Contact Date Create // Contact Date Create
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation"); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation");
if (! empty($array_query['contact_create_st_dt'])) { if (! empty($array_query['contact_create_st_dt'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '<table class="nobordernopadding"><tr>'; print '<table class="nobordernopadding"><tr>';
print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1); print $form->selectDate($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1);
print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1); print $form->selectDate($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
// Contact update Create // Contact update Create
print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification"); print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification");
if (! empty($array_query['contact_update_st_dt'])) { if (! empty($array_query['contact_update_st_dt'])) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
} }
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '<table class="nobordernopadding"><tr>'; print '<table class="nobordernopadding"><tr>';
print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>'; print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1); print $form->selectDate($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1);
print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1); print $form->selectDate($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
// Customer Categories // Customer Categories
print '<tr><td>' . $langs->trans("ContactCategoriesShort"); print '<tr><td>' . $langs->trans("ContactCategoriesShort");
if (count($array_query['contact_categ']) > 0) { if (count($array_query['contact_categ']) > 0) {
@ -451,10 +451,10 @@ print '<script type="text/javascript" language="javascript">
print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']); print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']);
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
// Standard Extrafield feature // Standard Extrafield feature
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
$elementype=Contact::$table_element; $elementype=Contact::$table_element;
// fetch optionals attributes and labels // fetch optionals attributes and labels
dol_include_once('/core/class/extrafields.class.php'); dol_include_once('/core/class/extrafields.class.php');
@ -464,8 +464,7 @@ print '<script type="text/javascript" language="javascript">
if($value == 'radio')$value = 'select'; if($value == 'radio')$value = 'select';
} }
foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) foreach ($extrafields->attributes[$elementtype]['label'] as $key => $val) {
{
print '<tr><td>' . $extrafields->attributes[$elementtype]['label'][$key]; print '<tr><td>' . $extrafields->attributes[$elementtype]['label'][$key];
if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) { if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) {
print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing'); print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
@ -486,7 +485,6 @@ print '<script type="text/javascript" language="javascript">
print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>'; print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct'); print $form->selectDate('', 'options_' . $key . '_end_dt' . '_cnct');
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help'); print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
} elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) { } elseif (($extrafields->attributes[$elementtype]['type'][$key] == 'boolean')) {
@ -515,31 +513,26 @@ print '<script type="text/javascript" language="javascript">
print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct'); print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct');
} }
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td>' . "\n"; print '</td><td>' . "\n";
} }
print '</td></tr>' . "\n"; print '</td></tr>' . "\n";
} }
} }
print '<tr>' . "\n";
print '<tr>' . "\n"; print '<td colspan="3" class="right">' . "\n";
print '<td colspan="3" class="right">' . "\n"; print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n";
print '</td>' . "\n";
print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n"; print '</tr>' . "\n";
print '</table>' . "\n";
print '</td>' . "\n"; print '</form>' . "\n";
print '</tr>' . "\n"; print '</div>' . "\n";
print '</table>' . "\n"; print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">';
print '</form>' . "\n"; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '</div>' . "\n"; print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere"));
print '<table class="noborder" width="100%">';
print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">'; print '<tr class="liste_titre">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<td class="liste_titre right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>';
print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere")); print '</tr>';
print '<table class="noborder" width="100%">'; print '</table>';
print '<tr class="liste_titre">'; print '</form>';
print '<td class="liste_titre right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>'; print '<br>';
print '</tr>';
print '</table>';
print '</form>';
print '<br>';

View File

@ -67,7 +67,7 @@ $userstatic=new User($db);
<?php <?php
if ($permission) { if ($permission) {
?> ?>
<form class="tagtr liste_titre"> <form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div> <div class="tagtd liste_titre"><?php echo $langs->trans("NatureOfContact"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div> <div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
@ -141,7 +141,7 @@ if ($permission) {
</div> </div>
</form> </form>
<?php <?php
} }
} }
?> ?>
@ -155,11 +155,11 @@ if ($permission) {
<div class="tagtd liste_titre">&nbsp;</div> <div class="tagtd liste_titre">&nbsp;</div>
</form> </form>
<?php <?php
$var = false; $var = false;
$arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts $arrayofsource=array('internal','external'); // Show both link to user and thirdparties contacts
foreach($arrayofsource as $source) { foreach($arrayofsource as $source) {
$tmpobject=$object; $tmpobject=$object;
if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; if (($object->element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc;
@ -211,8 +211,7 @@ if ($permission) {
</div> </div>
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div> <div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div class="tagtd center"> <div class="tagtd center">
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?> <?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">';
<?php
if ($tab[$i]['source']=='internal') if ($tab[$i]['source']=='internal')
{ {
echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3); echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3);
@ -221,8 +220,7 @@ if ($permission) {
{ {
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3);
} }
?> //if ($object->statut >= 0) echo '</a>'; ?>
<?php //if ($object->statut >= 0) echo '</a>'; ?>
</div> </div>
<div class="tagtd nowrap right"> <div class="tagtd nowrap right">
<?php if ($permission) { ?> <?php if ($permission) { ?>
@ -231,21 +229,16 @@ if ($permission) {
</div> </div>
</form> </form>
<?php $i++; ?> <?php $i++;
<?php
} }
} }
?>
</div> print "</div>\n";
</div> print "</div>\n";
<!-- TEMPLATE CONTACTS HOOK BEGIN HERE --> print "<!-- TEMPLATE CONTACTS HOOK BEGIN HERE -->\n";
<?php if (is_object($hookmanager)) {
if (is_object($hookmanager))
{
$hookmanager->initHooks(array('contacttpl')); $hookmanager->initHooks(array('contacttpl'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('formContactTpl', $parameters, $object, $action); $reshook=$hookmanager->executeHooks('formContactTpl', $parameters, $object, $action);
} }
?> print "<!-- END PHP TEMPLATE CONTACTS -->\n";
<!-- END PHP TEMPLATE CONTACTS -->

View File

@ -63,19 +63,17 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_
$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1):(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); $colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1):(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' $colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
?> print "<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->\n";
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
<?php
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random' // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
?> ?>
<body class="body bodylogin" style="background-image: url('<?php echo dol_escape_htmltag($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND); ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;"> <body class="body bodylogin" style="background-image: url('<?php echo dol_escape_htmltag($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND); ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
<?php <?php
} else { } else {
?> ?>
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php <?php
} }
?> ?>
@ -179,7 +177,7 @@ if ($captcha) {
if (preg_match('/\?/', $php_self)) $php_self.='&time='.dol_print_date(dol_now(), 'dayhourlog'); if (preg_match('/\?/', $php_self)) $php_self.='&time='.dol_print_date(dol_now(), 'dayhourlog');
else $php_self.='?time='.dol_print_date(dol_now(), 'dayhourlog'); else $php_self.='?time='.dol_print_date(dol_now(), 'dayhourlog');
// TODO: provide accessible captcha variants // TODO: provide accessible captcha variants
?> ?>
<!-- Captcha --> <!-- Captcha -->
<div class="trinputlogin"> <div class="trinputlogin">
<div class="tagtd nowraponall none center valignmiddle tdinputlogin"> <div class="tagtd nowraponall none center valignmiddle tdinputlogin">
@ -279,11 +277,11 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil
// Show error message if defined // Show error message if defined
if (! empty($_SESSION['dol_loginmesg'])) if (! empty($_SESSION['dol_loginmesg']))
{ {
?> ?>
<div class="center login_main_message"><div class="error"> <div class="center login_main_message"><div class="error">
<?php echo $_SESSION['dol_loginmesg']; ?> <?php echo $_SESSION['dol_loginmesg']; ?>
</div></div> </div></div>
<?php <?php
} }
// Add commit strip // Add commit strip
@ -306,11 +304,11 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
<?php if ($main_home) <?php if ($main_home)
{ {
?> ?>
<div class="center login_main_home paddingtopbottom <?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' backgroundsemitransparent'; ?>" style="max-width: 70%"> <div class="center login_main_home paddingtopbottom <?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' backgroundsemitransparent'; ?>" style="max-width: 70%">
<?php echo $main_home; ?> <?php echo $main_home; ?>
</div><br> </div><br>
<?php <?php
} }
?> ?>
@ -362,7 +360,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLI
{ {
if (empty($conf->dol_use_jmobile)) if (empty($conf->dol_use_jmobile))
{ {
?> ?>
<div class="center"><br> <div class="center"><br>
<script type="text/javascript"><!-- <script type="text/javascript"><!--
google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>"; google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
@ -375,14 +373,14 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLI
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </script>
</div> </div>
<?php <?php
} }
} }
?> ?>
</div> </div>
</div> <!-- end of center --> </div><!-- end of center -->
</body> </body>

View File

@ -90,13 +90,11 @@ if (!empty($extrafields))
} }
} }
?>
<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_create.tpl.php -->\n";
<?php
$nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines); $nolinesbefore=(count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) { if ($nolinesbefore) {
?> ?>
<tr class="liste_titre<?php echo (($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add_') ?> nodrag nodrop"> <tr class="liste_titre<?php echo (($nolinesbefore || $object->element=='contrat')?'':' liste_titre_add_') ?> nodrag nodrop">
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"></td> <td class="linecolnum center"></td>
@ -156,28 +154,28 @@ if ($nolinesbefore) {
?> ?>
<td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td> <td class="linecoledit" colspan="<?php echo $colspan; ?>">&nbsp;</td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>"> <tr class="pair nodrag nodrop nohoverpair<?php echo ($nolinesbefore || $object->element=='contrat')?'':' liste_titre_create'; ?>">
<?php <?php
$coldisplay=0; $coldisplay=0;
// Adds a line numbering column // Adds a line numbering column
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
$coldisplay++; $coldisplay++;
echo '<td class="nobottom linecolnum center"></td>'; echo '<td class="nobottom linecolnum center"></td>';
} }
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecoldescription minwidth500imp"> <td class="nobottom linecoldescription minwidth500imp">
<?php <?php
$freelines = false; $freelines = false;
if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) if (empty($conf->global->MAIN_DISABLE_FREE_LINES))
{ {
$freelines = true; $freelines = true;
$forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service)
if ($object->element == 'contrat') if ($object->element == 'contrat')
@ -216,11 +214,11 @@ if ($nolinesbefore) {
echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type", 'alpha', 2):-1, 'type', 1, 1, $forceall); echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type", 'alpha', 2):-1, 'type', 1, 1, $forceall);
echo '</span>'; echo '</span>';
} }
// Predefined product/service // Predefined product/service
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{ {
if ($forceall >= 0 && $freelines) echo '<br>'; if ($forceall >= 0 && $freelines) echo '<br>';
echo '<span class="prod_entry_mode_predef">'; echo '<span class="prod_entry_mode_predef">';
echo '<label for="prod_entry_mode_predef">'; echo '<label for="prod_entry_mode_predef">';
@ -317,47 +315,47 @@ if ($nolinesbefore) {
} }
echo '<input type="hidden" name="pbq" id="pbq" value="">'; echo '<input type="hidden" name="pbq" id="pbq" value="">';
echo '</span>'; echo '</span>';
} }
if (is_object($hookmanager) && empty($senderissupplier)) if (is_object($hookmanager) && empty($senderissupplier))
{ {
$parameters=array('fk_parent_line'=>GETPOST('fk_parent_line', 'int')); $parameters=array('fk_parent_line'=>GETPOST('fk_parent_line', 'int'));
$reshook=$hookmanager->executeHooks('formCreateProductOptions', $parameters, $object, $action); $reshook=$hookmanager->executeHooks('formCreateProductOptions', $parameters, $object, $action);
if (!empty($hookmanager->resPrint)) { if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint; print $hookmanager->resPrint;
} }
} }
if (is_object($hookmanager) && ! empty($senderissupplier)) if (is_object($hookmanager) && ! empty($senderissupplier))
{ {
$parameters=array('htmlname'=>'addproduct'); $parameters=array('htmlname'=>'addproduct');
$reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action); $reshook=$hookmanager->executeHooks('formCreateProductSupplierOptions', $parameters, $object, $action);
if (!empty($hookmanager->resPrint)) { if (!empty($hookmanager->resPrint)) {
print $hookmanager->resPrint; print $hookmanager->resPrint;
} }
} }
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) {
if (!empty($conf->variants->enabled)) { if (!empty($conf->variants->enabled)) {
echo '<div id="attributes_box"></div>'; echo '<div id="attributes_box"></div>';
} }
echo '<br>'; echo '<br>';
} }
// Editor wysiwyg // Editor wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$nbrows=ROWS_2; $nbrows=ROWS_2;
$enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); $enabled=(! empty($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0);
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$toolbarname='dolibarr_details'; $toolbarname='dolibarr_details';
if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes'; if (! empty($conf->global->FCKEDITOR_ENABLE_DETAILS_FULL)) $toolbarname='dolibarr_notes';
$doleditor=new DolEditor('dp_desc', GETPOST('dp_desc', 'none'), '', (empty($conf->global->MAIN_DOLEDITOR_HEIGHT)?100:$conf->global->MAIN_DOLEDITOR_HEIGHT), $toolbarname, '', false, true, $enabled, $nbrows, '98%'); $doleditor=new DolEditor('dp_desc', GETPOST('dp_desc', 'none'), '', (empty($conf->global->MAIN_DOLEDITOR_HEIGHT)?100:$conf->global->MAIN_DOLEDITOR_HEIGHT), $toolbarname, '', false, true, $enabled, $nbrows, '98%');
$doleditor->Create(); $doleditor->Create();
// Show autofill date for recurring invoices // Show autofill date for recurring invoices
if (! empty($conf->service->enabled) && $object->element == 'facturerec') if (! empty($conf->service->enabled) && $object->element == 'facturerec')
{ {
echo '<div class="divlinefordates"><br>'; echo '<div class="divlinefordates"><br>';
echo $langs->trans('AutoFillDateFrom').' '; echo $langs->trans('AutoFillDateFrom').' ';
echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1); echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1);
@ -365,75 +363,75 @@ if ($nolinesbefore) {
echo $langs->trans('AutoFillDateTo').' '; echo $langs->trans('AutoFillDateTo').' ';
echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1); echo $form->selectyesno('date_end_fill', $line->date_end_fill, 1);
echo '</div>'; echo '</div>';
} }
echo '</td>'; echo '</td>';
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{ {
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref", 'alpha', 2):''); ?>"></td> <td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (isset($_POST["fourn_ref"])?GETPOST("fourn_ref", 'alpha', 2):''); ?>"></td>
<?php } ?> <?php }
<td class="nobottom linecolvat right"><?php print '<td class="nobottom linecolvat right">';
$coldisplay++; $coldisplay++;
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true); if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx", 'alpha', 2):-1), $seller, $buyer, 0, 0, '', false, 1); else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?GETPOST("tva_tx", 'alpha', 2):-1), $seller, $buyer, 0, 0, '', false, 1);
?> ?>
</td> </td>
<td class="nobottom linecoluht right"><?php $coldisplay++; ?> <td class="nobottom linecoluht right"><?php $coldisplay++; ?>
<input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht", 'alpha', 2):''); ?>"> <input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht", 'alpha', 2):''); ?>">
</td> </td>
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecoluht_currency right"> <td class="nobottom linecoluht_currency right">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht", 'alpha', 2):''); ?>"> <input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht", 'alpha', 2):''); ?>">
</td> </td>
<?php } ?> <?php }
<?php if (! empty($inputalsopricewithtax)) { if (! empty($inputalsopricewithtax)) {
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecoluttc right"> <td class="nobottom linecoluttc right">
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc", 'alpha', 2):''); ?>"> <input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"])?GETPOST("price_ttc", 'alpha', 2):''); ?>">
</td> </td>
<?php } <?php }
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1); ?>"> <td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"])?GETPOST("qty", 'alpha', 2):1); ?>">
</td> </td>
<?php <?php
if($conf->global->PRODUCT_USE_UNITS) if($conf->global->PRODUCT_USE_UNITS)
{ {
$coldisplay++; $coldisplay++;
print '<td class="nobottom linecoluseunit left">'; print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units"); print $form->selectUnits($line->fk_unit, "units");
print '</td>'; print '</td>';
} }
$remise_percent = $buyer->remise_percent; $remise_percent = $buyer->remise_percent;
if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') if($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier')
{ {
$remise_percent = $seller->remise_supplier_percent; $remise_percent = $seller->remise_supplier_percent;
} }
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom nowrap linecoldiscount right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"])?GETPOST("remise_percent", 'alpha', 2):$remise_percent); ?>"><span class="hideonsmartphone">%</span></td> <td class="nobottom nowrap linecoldiscount right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"])?GETPOST("remise_percent", 'alpha', 2):$remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<?php <?php
if ($this->situation_cycle_ref) { if ($this->situation_cycle_ref) {
$coldisplay++; $coldisplay++;
print '<td class="nobottom nowrap right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>'; print '<td class="nobottom nowrap right"><input class="falt right" type="text" size="1" value="0" name="progress">%</td>';
$coldisplay++; $coldisplay++;
print '<td></td>'; print '<td></td>';
} }
if (! empty($usemargins)) if (! empty($usemargins))
{ {
if (!empty($user->rights->margins->creer)) { if (!empty($user->rights->margins->creer)) {
$coldisplay++; $coldisplay++;
?> ?>
@ -457,10 +455,10 @@ if ($nolinesbefore) {
$coldisplay++; $coldisplay++;
} }
} }
} }
$coldisplay+=$colspan; $coldisplay+=$colspan;
?> ?>
<td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>"> <td class="nobottom linecoledit center valignmiddle" colspan="<?php echo $colspan; ?>">
<input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline"> <input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline" id="addline">
</td> </td>
@ -512,20 +510,16 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");'; print 'jQuery("#date_endmin").val("'.$conf->global->MAIN_DEFAULT_DATE_END_MIN.'");';
} }
} }
print '</script>' print '</script>';
?> print '</td>';
</td> print "</tr>\n";
</tr>
<?php
} }
?>
<script> print "<script>\n";
<?php
if (! empty($usemargins) && $user->rights->margins->creer) if (! empty($usemargins) && $user->rights->margins->creer)
{ {
?> ?>
/* Some js test when we click on button "Add" */ /* Some js test when we click on button "Add" */
jQuery(document).ready(function() { jQuery(document).ready(function() {
@ -590,7 +584,7 @@ if (! empty($usemargins) && $user->rights->margins->creer)
return true; return true;
} }
<?php <?php
} }
?> ?>

View File

@ -54,20 +54,18 @@ $colspan = 3; // Col total ht + col edit + col delete
if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc
if (in_array($object->element, array('propal','supplier_proposal','facture','facturerec','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button if (in_array($object->element, array('propal','supplier_proposal','facture','facturerec','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2;
?>
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
<?php
$coldisplay=0; $coldisplay=0;
?> ?>
<tr class="oddeven tredited"> <tr class="oddeven tredited">
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> <td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php } <?php }
$coldisplay++; $coldisplay++;
?> ?>
<td> <td>
<div id="line_<?php echo $line->id; ?>"></div> <div id="line_<?php echo $line->id; ?>"></div>
@ -168,8 +166,9 @@ $coldisplay=0;
print '></td>'; print '></td>';
} }
?> ?>
<td class="right"><?php $coldisplay++; ?> <td class="right">
<?php if (($line->info_bits & 2) != 2) { <?php $coldisplay++;
if (($line->info_bits & 2) != 2) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
@ -192,8 +191,9 @@ $coldisplay=0;
} }
?> ?>
<td class="nowrap right"><?php $coldisplay++; ?> <td class="nowrap right">
<?php if (($line->info_bits & 2) != 2) { <?php $coldisplay++;
if (($line->info_bits & 2) != 2) {
print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"'; print '<input size="1" type="text" class="flat right" name="remise_percent" id="remise_percent" value="' . $line->remise_percent . '"';
if ($line->fk_prev_id != null ) print ' readonly'; if ($line->fk_prev_id != null ) print ' readonly';
print '>%'; print '>%';
@ -201,7 +201,7 @@ $coldisplay=0;
&nbsp; &nbsp;
<?php } ?> <?php } ?>
</td> </td>
<?php <?php
if ($this->situation_cycle_ref) { if ($this->situation_cycle_ref) {
$coldisplay++; $coldisplay++;
print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>'; print '<td class="nowrap right linecolcycleref"><input class="right" type="text" size="1" value="' . $line->situation_percent . '" name="progress">%</td>';
@ -247,7 +247,7 @@ $coldisplay=0;
} }
} }
} }
?> ?>
<!-- colspan for this td because it replace total_ht+3 td for buttons+... --> <!-- colspan for this td because it replace total_ht+3 td for buttons+... -->
<td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=$colspan; ?> <td class="center valignmiddle" colspan="<?php echo $colspan; ?>"><?php $coldisplay+=$colspan; ?>

View File

@ -39,9 +39,9 @@ if (empty($object) || ! is_object($object))
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php --> print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n";
<?php
// Title line // Title line
print "<thead>\n"; print "<thead>\n";
@ -90,16 +90,19 @@ if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{ {
if (!empty($user->rights->margins->creer)) if (!empty($user->rights->margins->creer))
{ {
if ($conf->global->MARGIN_TYPE == "1") if ($conf->global->MARGIN_TYPE == "1") {
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</td>'; print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</td>';
else } else {
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</td>'; print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</td>';
} }
}
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</td>'; print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</td>';
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) }
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</td>'; print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</td>';
}
} }
// Total HT // Total HT
@ -126,6 +129,5 @@ if($action == 'selectlines')
print "</tr>\n"; print "</tr>\n";
print "</thead>\n"; print "</thead>\n";
?>
<!-- END PHP TEMPLATE objectline_title.tpl.php --> print "<!-- END PHP TEMPLATE objectline_title.tpl.php -->\n";

View File

@ -64,19 +64,16 @@ $domData .= ' data-qty="'.$line->qty.'"';
$domData .= ' data-product_type="'.$line->product_type.'"'; $domData .= ' data-product_type="'.$line->product_type.'"';
?> $coldisplay=0; ?>
<?php $coldisplay=0; ?>
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php --> <!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> > <tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> >
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> <?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td> <td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php } ?> <?php } ?>
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div> <td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
<?php <?php
if (($line->info_bits & 2) == 2) { if (($line->info_bits & 2) == 2) {
?> print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
<?php
$txt=''; $txt='';
print img_object($langs->trans("ShowReduc"), 'reduc').' '; print img_object($langs->trans("ShowReduc"), 'reduc').' ';
if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
@ -84,9 +81,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); elseif ($line->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid");
//else $txt=$langs->trans("Discount"); //else $txt=$langs->trans("Discount");
print $txt; print $txt;
?> print '</a>';
</a>
<?php
if ($line->description) if ($line->description)
{ {
if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0) if ($line->description == '(CREDIT_NOTE)' && $line->fk_remise_except > 0)
@ -121,9 +116,9 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); echo ($txt?' - ':'').dol_htmlentitiesbr($line->description);
} }
} }
} }
else else
{ {
$format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day';
if ($line->fk_product > 0) if ($line->fk_product > 0)
@ -162,10 +157,10 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
{ {
print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):''; print (! empty($line->description) && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
} }
} }
if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productfourn = new ProductFournisseur($this->db); $productfourn = new ProductFournisseur($this->db);
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice); $productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
@ -179,87 +174,80 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
{ {
echo $productfourn->ref_supplier; echo $productfourn->ref_supplier;
} }
} }
if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) if (! empty($conf->accounting->enabled) && $line->fk_accounting_account > 0)
{ {
$accountingaccount=new AccountingAccount($this->db); $accountingaccount=new AccountingAccount($this->db);
$accountingaccount->fetch($line->fk_accounting_account); $accountingaccount->fetch($line->fk_accounting_account);
echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0, 1, 1); echo '<div class="clearboth"></div><br><span class="opacitymedium">' . $langs->trans('AccountingAffectation') . ' : </span>' . $accountingaccount->getNomUrl(0, 1, 1);
} }
?> print '</td>';
</td> if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
<?php {
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines print '<td class="linecolrefsupplier">';
{
?>
<td class="linecolrefsupplier"><?php
echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier); echo ($line->ref_fourn?$line->ref_fourn:$line->ref_supplier);
?></td> print '</td>';
<?php }
} // VAT Rate
// VAT Rate print '<td class="linecolvat nowrap right">';
?> $coldisplay++;
<td class="linecolvat nowrap right"><?php $coldisplay++; ?><?php $positiverates='';
$positiverates=''; if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); if (empty($positiverates)) $positiverates='0';
if (empty($positiverates)) $positiverates='0'; echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits);
echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
//echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?></td>
?></td>
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td> <td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> <?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td> <td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td>
<?php } ?> <?php }
<?php if ($inputalsopricewithtax) { ?> if ($inputalsopricewithtax) { ?>
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td> <td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?></td>
<?php } ?> <?php } ?>
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> <td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php <?php
if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
} else echo '&nbsp;'; } else echo '&nbsp;';
?> print '</td>';
</td>
<?php if ($conf->global->PRODUCT_USE_UNITS)
if($conf->global->PRODUCT_USE_UNITS) {
{
print '<td class="linecoluseunit nowrap left">'; print '<td class="linecoluseunit nowrap left">';
$label = $line->getLabelOfUnit('short'); $label = $line->getLabelOfUnit('short');
if ($label !== '') { if ($label !== '') {
print $langs->trans($label); print $langs->trans($label);
} }
print '</td>'; print '</td>';
} }
?> if (!empty($line->remise_percent) && $line->special_code != 3) {
print '<td class="linecoldiscount right">';
<?php if (!empty($line->remise_percent) && $line->special_code != 3) { ?>
<td class="linecoldiscount right"><?php
$coldisplay++; $coldisplay++;
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
echo dol_print_reduction($line->remise_percent, $langs); echo dol_print_reduction($line->remise_percent, $langs);
?></td> print '</td>';
<?php } else { ?> } else {
<td class="linecoldiscount"><?php $coldisplay++; ?>&nbsp;</td> print '<td class="linecoldiscount">&nbsp;</td>';
<?php } $coldisplay++;
}
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
// Fields for situation invoices // Fields for situation invoices
if ($this->situation_cycle_ref) if ($this->situation_cycle_ref)
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
$coldisplay++; $coldisplay++;
print '<td class="linecolcycleref nowrap right">' . $line->situation_percent . '%</td>'; print '<td class="linecolcycleref nowrap right">' . $line->situation_percent . '%</td>';
@ -267,26 +255,24 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
$locataxes_array = getLocalTaxesFromRate($line->tva.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), 0, ($senderissupplier?$mysoc:$object->thirdparty), ($senderissupplier?$object->thirdparty:$mysoc)); $locataxes_array = getLocalTaxesFromRate($line->tva.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), 0, ($senderissupplier?$mysoc:$object->thirdparty), ($senderissupplier?$object->thirdparty:$mysoc));
$tmp = calcul_price_total($line->qty, $line->pu, $line->remise_percent, $line->txtva, -1, -1, 0, 'HT', $line->info_bits, $line->type, ($senderissupplier?$object->thirdparty:$mysoc), $locataxes_array, 100, $object->multicurrency_tx, $line->multicurrency_subprice); $tmp = calcul_price_total($line->qty, $line->pu, $line->remise_percent, $line->txtva, -1, -1, 0, 'HT', $line->info_bits, $line->type, ($senderissupplier?$object->thirdparty:$mysoc), $locataxes_array, 100, $object->multicurrency_tx, $line->multicurrency_subprice);
print '<td align="right" class="linecolcycleref2 nowrap">' . price($tmp[0]) . '</td>'; print '<td align="right" class="linecolcycleref2 nowrap">' . price($tmp[0]) . '</td>';
} }
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id)) if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
{ {
if (!empty($user->rights->margins->creer)) { ?> if (!empty($user->rights->margins->creer)) { ?>
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td> <td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
<?php } ?> <?php }
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td> <td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
<?php } <?php }
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td> <td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->marque_tx, null, null, null, null, $rounding).'%'; ?></td>
<?php } <?php }
} }
?> if ($line->special_code == 3) { ?>
<?php if ($line->special_code == 3) { ?>
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td> <td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<?php } else { ?> <?php } else {
<td class="linecolht nowrap right"><?php print '<td class="linecolht nowrap right">';
$coldisplay++; $coldisplay++;
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
@ -303,74 +289,69 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
{ {
print '</span>'; print '</span>';
} }
?> print '</td>';
</td> if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> print '<td class="linecolutotalht_currency nowrap right">'.price($line->multicurrency_total_ht).'</td>';
<td class="linecolutotalht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td> $coldisplay++;
<?php } ?> }
<?php } ?> }
<?php if ($outputalsopricetotalwithtax) { ?> if ($outputalsopricetotalwithtax) {
<td class="linecolht nowrap right"><?php $coldisplay++; ?><?php echo price($line->total_ttc); ?></td> print '<td class="linecolht nowrap right">'.price($line->total_ttc).'</td>';
<?php } ?> $coldisplay++;
}
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) {
<?php print '<td class="linecoledit center">';
if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines' ) { ?> $coldisplay++;
<td class="linecoledit center"><?php $coldisplay++; ?> if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
<?php if (($line->info_bits & 2) == 2 || ! empty($disableedit)) { ?> } else { ?>
<?php } else { ?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>"> <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
<?php echo img_edit(); ?> <?php echo img_edit().'</a>';
</a> }
<?php } ?> print '</td>';
</td>
<td class="linecoldelete center"><?php $coldisplay++; ?> print '<td class="linecoldelete center">';
<?php $coldisplay++;
if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=ask_deleteline&amp;lineid=' . $line->id . '">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $this->id . '&amp;action=ask_deleteline&amp;lineid=' . $line->id . '">';
print img_delete(); print img_delete();
print '</a>'; print '</a>';
} }
?> print '</td>';
</td>
<?php if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) {
if ($num > 1 && $conf->browser->layout != 'phone' && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?> print '<td class="linecolmove tdlineupdown center">';
<td class="linecolmove tdlineupdown center"><?php $coldisplay++; ?> $coldisplay++;
<?php if ($i > 0) { ?> if ($i > 0) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>"> <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
<?php echo img_up('default', 0, 'imgupforline'); ?> <?php echo img_up('default', 0, 'imgupforline'); ?>
</a> </a>
<?php } ?> <?php }
<?php if ($i < $num-1) { ?> if ($i < $num-1) { ?>
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>"> <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
<?php echo img_down('default', 0, 'imgdownforline'); ?> <?php echo img_down('default', 0, 'imgdownforline'); ?>
</a> </a>
<?php } ?> <?php }
</td> print '</td>';
<?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?>
<?php
} else { } else {
?> print '<td '.(($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"').'></td>';
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> $coldisplay++;
<?php
} }
} else {
print '<td colspan="3"></td>';
$coldisplay = $coldisplay+3;
}
if ($action == 'selectlines') { ?> if ($action == 'selectlines') { ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?> <?php }
</tr> print "</tr>\n";
<?php
//Line extrafield //Line extrafield
if (!empty($extrafields)) if (!empty($extrafields))
{ {
print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); print $line->showOptionals($extrafields, 'view', array('style'=>'class="drag drop oddeven"','colspan'=>$coldisplay), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1);
} }
?>
<!-- END PHP TEMPLATE objectline_view.tpl.php --> print "<!-- END PHP TEMPLATE objectline_view.tpl.php -->\n";

View File

@ -24,7 +24,7 @@
// define CDAV_CONTACT_TAG if not // define CDAV_CONTACT_TAG if not
if(!defined('CDAV_CONTACT_TAG')) if(!defined('CDAV_CONTACT_TAG'))
{ {
if(isset($conf->global->CDAV_CONTACT_TAG)) if (isset($conf->global->CDAV_CONTACT_TAG))
define('CDAV_CONTACT_TAG', $conf->global->CDAV_CONTACT_TAG); define('CDAV_CONTACT_TAG', $conf->global->CDAV_CONTACT_TAG);
else else
define('CDAV_CONTACT_TAG', ''); define('CDAV_CONTACT_TAG', '');
@ -33,7 +33,7 @@ if(!defined('CDAV_CONTACT_TAG'))
// define CDAV_URI_KEY if not // define CDAV_URI_KEY if not
if(!defined('CDAV_URI_KEY')) if(!defined('CDAV_URI_KEY'))
{ {
if(isset($conf->global->CDAV_URI_KEY)) if (isset($conf->global->CDAV_URI_KEY))
define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY); define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY);
else else
define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8)); define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8));

View File

@ -411,34 +411,34 @@ if (preg_match('/fr/i', $conf->global->MAIN_INFO_SOCIETE_COUNTRY))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="80%">' . $langs->trans("DONATION_ART200") . '</td>'; print '<td width="80%">' . $langs->trans("DONATION_ART200") . '</td>';
print '<td class="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('DONATION_ART200'); print ajax_constantonoff('DONATION_ART200');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("DONATION_ART200", $arrval, $conf->global->DONATION_ART200); print $form->selectarray("DONATION_ART200", $arrval, $conf->global->DONATION_ART200);
} }
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="80%">' . $langs->trans("DONATION_ART238") . '</td>'; print '<td width="80%">' . $langs->trans("DONATION_ART238") . '</td>';
print '<td class="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('DONATION_ART238'); print ajax_constantonoff('DONATION_ART238');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("DONATION_ART238", $arrval, $conf->global->DONATION_ART238); print $form->selectarray("DONATION_ART238", $arrval, $conf->global->DONATION_ART238);
} }
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="80%">' . $langs->trans("DONATION_ART885") . '</td>'; print '<td width="80%">' . $langs->trans("DONATION_ART885") . '</td>';
print '<td class="center">'; print '<td class="center">';
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
print ajax_constantonoff('DONATION_ART885'); print ajax_constantonoff('DONATION_ART885');
} else { } else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("DONATION_ART885", $arrval, $conf->global->DONATION_ART885); print $form->selectarray("DONATION_ART885", $arrval, $conf->global->DONATION_ART885);
} }
print '</td></tr>'; print '</td></tr>';
print "</table>\n"; print "</table>\n";
} }

View File

@ -532,12 +532,12 @@ if (! empty($id) && $action == 'edit')
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) { if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global->DONATION_USE_THIRDPARTIES) ) {
$company=new Societe($db); $company=new Societe($db);
$result=$company->fetch($object->socid); $result=$company->fetch($object->socid);
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
} else { } else {
$langs->load("companies"); $langs->load("companies");
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>'; print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="maxwidth200" value="'.dol_escape_htmltag($object->lastname).'"></td></tr>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="maxwidth200" value="'.dol_escape_htmltag($object->lastname).'"></td></tr>';
@ -555,11 +555,13 @@ if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global
// Country // Country
print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>'; print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code), 'country_id'); print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code), 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
print '</td></tr>'; print '</td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>'; print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
} }
// Payment mode // Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n"; print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
if ($object->modepaymentid) $selected = $object->modepaymentid; if ($object->modepaymentid) $selected = $object->modepaymentid;
@ -642,8 +644,9 @@ if (! empty($id) && $action != 'edit')
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->don->creer) if ($user->rights->don->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
@ -692,16 +695,16 @@ if (! empty($id) && $action != 'edit')
print yn($object->public); print yn($object->public);
print '</td></tr>'; print '</td></tr>';
if ($object->socid) { if ($object->socid) {
$company=new Societe($db); $company=new Societe($db);
$result=$company->fetch($object->socid); $result=$company->fetch($object->socid);
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2">'.$company->getNomUrl(1).'</td></tr>';
} else { } else {
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>'; print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>';
} }
// Payment mode // Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";

View File

@ -124,8 +124,9 @@ if ($object->id)
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->don->creer) if ($user->rights->don->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
// $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; // $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -79,8 +79,9 @@ if (! empty($conf->projet->enabled))
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->don->creer) if ($user->rights->don->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
// $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; // $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -95,8 +95,9 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->don->creer) if ($user->rights->don->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
// $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; // $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -18,11 +18,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
*/ */
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -32,26 +29,25 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("donations"); $langs->load("donations");
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) { foreach($linkedObjectBlock as $key => $objectlink) {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> print '<tr class="'.$trclass.'">';
<tr class="<?php echo $trclass; ?>"> print '<td>'.$langs->trans("Donation").'</td>';
<td><?php echo $langs->trans("Donation"); ?></td> print '<td>'.$objectlink->getNomUrl(1).'</td>';
<td><?php echo $objectlink->getNomUrl(1); ?></td> print '<td class="center">'.$objectlink->ref_client.'</td>';
<td class="center"><?php echo $objectlink->ref_client; ?></td> print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> print '<td class="right">';
<td class="right"><?php
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?> }
</td> print '</td>';
<td class="right"><?php echo $objectlink->getLibStatut(3); ?></td> print '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
</tr> print '</tr>';
<?php
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
@ -67,6 +63,5 @@ if (count($linkedObjectBlock) > 1)
</tr> </tr>
<?php <?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -277,14 +277,14 @@ if (empty($action) || $action == 'delete_section')
print load_fiche_titre($langs->trans("ECMSectionOfDocuments")); print load_fiche_titre($langs->trans("ECMSectionOfDocuments"));
print '<br>'; print '<br>';
/* /*
$ecmdir->ref=$ecmdir->label; $ecmdir->ref=$ecmdir->label;
print $langs->trans("ECMSection").': '; print $langs->trans("ECMSection").': ';
print img_picto('','object_dir').' '; print img_picto('','object_dir').' ';
print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php">'.$langs->trans("ECMRoot").'</a>'; print '<a href="'.DOL_URL_ROOT.'/ecm/dir_add_card.php">'.$langs->trans("ECMRoot").'</a>';
//print ' -> <b>'.$ecmdir->getNomUrl(1).'</b><br>'; //print ' -> <b>'.$ecmdir->getNomUrl(1).'</b><br>';
print "<br><br>"; print "<br><br>";
*/ */
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($action == 'delete_section') if ($action == 'delete_section')

View File

@ -401,7 +401,7 @@ if ($action != 'edit')
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.urlencode($section).'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Edit').'</a>';
} }
/* /*
if ($user->rights->ecm->setup) if ($user->rights->ecm->setup)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=delete_file&section='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Delete').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=delete_file&section='.$section.'&urlfile='.urlencode($urlfile).'">'.$langs->trans('Delete').'</a>';
@ -410,7 +410,7 @@ if ($action != 'edit')
{ {
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('Delete').'</a>';
} }
*/ */
print '</div>'; print '</div>';
} }

View File

@ -1886,11 +1886,12 @@ class EmailCollector extends CommonObject
// BODY // BODY
$s = imap_fetchstructure($mbox, $mid); $s = imap_fetchstructure($mbox, $mid);
if (!$s->parts) // simple if (!$s->parts) {
// simple
$this->getpart($mbox, $mid, $s, 0); // pass 0 as part-number $this->getpart($mbox, $mid, $s, 0); // pass 0 as part-number
else { // multipart: cycle through each part } else {
foreach ($s->parts as $partno0=>$p) // multipart: cycle through each part
{ foreach ($s->parts as $partno0 => $p) {
$this->getpart($mbox, $mid, $p, $partno0+1); $this->getpart($mbox, $mid, $p, $partno0+1);
} }
} }

View File

@ -1090,13 +1090,10 @@ if ($action == 'create')
}); });
</script>'; </script>';
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// Load shipments already done for same order // Load shipments already done for same order
$object->loadExpeditions(); $object->loadExpeditions();

Some files were not shown because too many files have changed in this diff Show More