Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
6232e59fd2
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -19,8 +19,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/bookkeeping/list.php
|
* \file htdocs/accountancy/bookkeeping/list.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief List operation of book keeping
|
* \brief List operation of book keeping
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -21,7 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/class/accountancyexport.class.php
|
* \file htdocs/accountancy/class/accountancyexport.class.php
|
||||||
|
* \ingroup Advanced accountancy
|
||||||
|
* \brief Class accountancy export
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -157,7 +160,7 @@ class AccountancyExport
|
|||||||
*/
|
*/
|
||||||
public function exportNormal($objectLines) {
|
public function exportNormal($objectLines) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
// Std export
|
// Std export
|
||||||
$date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
$date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||||
@ -182,15 +185,16 @@ class AccountancyExport
|
|||||||
public function exportCegid($objectLines) {
|
public function exportCegid($objectLines) {
|
||||||
foreach ( $objectLines as $line ) {
|
foreach ( $objectLines as $line ) {
|
||||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
|
$separator = ";";
|
||||||
|
|
||||||
print $date . $this->separator;
|
print $date . $separator;
|
||||||
print $line->code_journal . $this->separator;
|
print $line->code_journal . $separator;
|
||||||
print length_accountg($line->numero_compte) . $this->separator;
|
print length_accountg($line->numero_compte) . $separator;
|
||||||
print ' ' . $this->separator;
|
print length_accounta($line->code_tiers) . $separator;
|
||||||
print $line->sens . $this->separator;
|
print $line->sens . $separator;
|
||||||
print price($line->montant) . $this->separator;
|
print price($line->montant) . $separator;
|
||||||
print dol_trunc($line->label_compte, 32) . $this->separator;
|
print $line->label_compte . $separator;
|
||||||
print $line->doc_ref . $this->separator;
|
print $line->doc_ref;
|
||||||
print $this->end_line;
|
print $this->end_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2014-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@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
|
||||||
* 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
|
||||||
@ -103,13 +103,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
|
|
||||||
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
|
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
|
||||||
$sql1 .= " SET l.fk_code_ventilation=" . $account_parent;
|
$sql1 .= " SET l.fk_code_ventilation=" . $account_parent;
|
||||||
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
|
||||||
|
|
||||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
|
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
|
||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
@ -223,7 +223,7 @@ $result = $db->query($sql);
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$num_lines = $db->num_rows($result);
|
$num_lines = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = "";
|
$param = "";
|
||||||
if ($search_invoice)
|
if ($search_invoice)
|
||||||
$param .= "&search_invoice=" . $search_invoice;
|
$param .= "&search_invoice=" . $search_invoice;
|
||||||
@ -242,17 +242,17 @@ if ($result) {
|
|||||||
if ($search_tvaintra)
|
if ($search_tvaintra)
|
||||||
$param .= "&search_tvaintra=" . $search_tvaintra;
|
$param .= "&search_tvaintra=" . $search_tvaintra;
|
||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords);
|
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords);
|
||||||
print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>';
|
print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>';
|
||||||
|
|
||||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||||
print $formventilation->select_account($account_parent, 'account_parent', 1);
|
print $formventilation->select_account($account_parent, 'account_parent', 1);
|
||||||
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>';
|
print '<input type="submit" class="butAction" value="' . $langs->trans("Validate") . '"/></div>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
@ -265,7 +265,7 @@ if ($result) {
|
|||||||
print_liste_field_titre($langs->trans("IntracommunityVATNumber"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans("IntracommunityVATNumber"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
|
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_invoice" size="10" value="' . $search_invoice . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_invoice" size="10" value="' . $search_invoice . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
|
||||||
@ -279,22 +279,22 @@ if ($result) {
|
|||||||
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
print '<td class="liste_titre" align="center"><input type="image" class="liste_titre" name="button_search" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
$facture_static = new Facture($db);
|
$facture_static = new Facture($db);
|
||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
$var = True;
|
$var = True;
|
||||||
while ( $objp = $db->fetch_object($result) ) {
|
while ( $objp = $db->fetch_object($result) ) {
|
||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
||||||
|
|
||||||
print '<tr'. $bc[$var].'>';
|
print '<tr'. $bc[$var].'>';
|
||||||
|
|
||||||
// Ref Invoice
|
// Ref Invoice
|
||||||
$facture_static->ref = $objp->facnumber;
|
$facture_static->ref = $objp->facnumber;
|
||||||
$facture_static->id = $objp->facid;
|
$facture_static->id = $objp->rowid;
|
||||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||||
|
|
||||||
// Ref Product
|
// Ref Product
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
@ -305,7 +305,7 @@ if ($result) {
|
|||||||
else
|
else
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
||||||
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
|
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
|
||||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||||
@ -316,7 +316,7 @@ if ($result) {
|
|||||||
print '<td align="right">' . $objp->country .'</td>';
|
print '<td align="right">' . $objp->country .'</td>';
|
||||||
print '<td align="center">' . $objp->tva_intra . '</td>';
|
print '<td align="center">' . $objp->tva_intra . '</td>';
|
||||||
print '<td align="center"><input type="checkbox" name="changeaccount[]" value="' . $objp->fdid . '"/></td>';
|
print '<td align="center"><input type="checkbox" name="changeaccount[]" value="' . $objp->fdid . '"/></td>';
|
||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -424,7 +424,7 @@ if ($action == 'export_csv') {
|
|||||||
}
|
}
|
||||||
if ($reflabel == '(CustomerInvoicePayment)') {
|
if ($reflabel == '(CustomerInvoicePayment)') {
|
||||||
$reflabel = $langs->trans('Customer');
|
$reflabel = $langs->trans('Customer');
|
||||||
}
|
}
|
||||||
if ($reflabel == '(SocialContributionPayment)') {
|
if ($reflabel == '(SocialContributionPayment)') {
|
||||||
$reflabel = $langs->trans('SocialContribution');
|
$reflabel = $langs->trans('SocialContribution');
|
||||||
}
|
}
|
||||||
@ -577,9 +577,13 @@ else {
|
|||||||
'action' => ''
|
'action' => ''
|
||||||
), '', $varlink);
|
), '', $varlink);
|
||||||
|
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||||
|
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans('Export') . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||||
|
} else {
|
||||||
|
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
|
}
|
||||||
|
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@ -426,12 +426,12 @@ if ($action == 'export_csv') {
|
|||||||
));
|
));
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2014 Rapha<EFBFBD>l Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.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
|
||||||
@ -24,9 +24,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/journal/sellsjournal.php
|
* \file htdocs/accountancy/journal/sellsjournal.php
|
||||||
* \ingroup Advanced accountancy
|
* \ingroup Advanced accountancy
|
||||||
* \brief Page with sells journal
|
* \brief Page with sells journal
|
||||||
*/
|
*/
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
@ -444,12 +444,12 @@ if ($action == 'export_csv') {
|
|||||||
));
|
));
|
||||||
|
|
||||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabeld="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||||
|
|
||||||
print '
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@ -83,147 +83,17 @@ if ($action == 'update' && empty($_POST["cancel"]))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Actions to send emails
|
||||||
* Add file in email form
|
$id=0;
|
||||||
*/
|
$actiontypecode='';
|
||||||
if (GETPOST('addfile') || GETPOST('addfilehtml'))
|
$trigger_name='';
|
||||||
{
|
$paramname='id';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
$mode='emailfortest';
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|
||||||
// Set tmp user directory
|
if ($action == 'presend' && GETPOST('trackid') == 'test') $action='test';
|
||||||
$vardir=$conf->user->dir_output."/".$user->id;
|
if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtml';
|
||||||
$upload_dir = $vardir.'/temp';
|
|
||||||
dol_add_file_process($upload_dir,0,0);
|
|
||||||
|
|
||||||
if ($_POST['addfile']) $action='test';
|
|
||||||
if ($_POST['addfilehtml']) $action='testhtml';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Remove file in email form
|
|
||||||
*/
|
|
||||||
if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
|
|
||||||
{
|
|
||||||
// Set tmp user directory
|
|
||||||
$vardir=$conf->user->dir_output."/".$user->id;
|
|
||||||
$upload_dir = $vardir.'/temp';
|
|
||||||
|
|
||||||
$keytodelete=isset($_POST['removedfile'])?$_POST['removedfile']:$_POST['removedfilehtml'];
|
|
||||||
$keytodelete--;
|
|
||||||
|
|
||||||
$listofpaths=array();
|
|
||||||
$listofnames=array();
|
|
||||||
$listofmimes=array();
|
|
||||||
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
|
|
||||||
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
|
|
||||||
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
|
|
||||||
|
|
||||||
if ($keytodelete >= 0)
|
|
||||||
{
|
|
||||||
$pathtodelete=$listofpaths[$keytodelete];
|
|
||||||
$filetodelete=$listofnames[$keytodelete];
|
|
||||||
$result = dol_delete_file($pathtodelete,1);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
setEventMessages(array($langs->trans("FileWasRemoved"), $filetodelete), null, 'mesgs');
|
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
$formmail = new FormMail($db);
|
|
||||||
$formmail->remove_attached_files($keytodelete);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($_POST['removedfile'] || $action='send') $action='test';
|
|
||||||
if ($_POST['removedfilehtml'] || $action='sendhtml') $action='testhtml';
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Send mail
|
|
||||||
*/
|
|
||||||
if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GETPOST('addfilehtml') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
|
|
||||||
{
|
|
||||||
$error=0;
|
|
||||||
|
|
||||||
$email_from='';
|
|
||||||
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
|
|
||||||
if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>';
|
|
||||||
|
|
||||||
$errors_to = $_POST["errorstomail"];
|
|
||||||
$sendto = $_POST["sendto"];
|
|
||||||
$sendtocc = $_POST["sendtocc"];
|
|
||||||
$sendtoccc = $_POST["sendtoccc"];
|
|
||||||
$subject = $_POST['subject'];
|
|
||||||
$body = $_POST['message'];
|
|
||||||
$deliveryreceipt= $_POST["deliveryreceipt"];
|
|
||||||
$trackid = GETPOST('trackid');
|
|
||||||
|
|
||||||
//Check if we have to decode HTML
|
|
||||||
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
|
|
||||||
$body=dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create form object
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
$formmail = new FormMail($db);
|
|
||||||
|
|
||||||
$attachedfiles=$formmail->get_attached_files();
|
|
||||||
$filepath = $attachedfiles['paths'];
|
|
||||||
$filename = $attachedfiles['names'];
|
|
||||||
$mimetype = $attachedfiles['mimes'];
|
|
||||||
|
|
||||||
if (empty($_POST["frommail"]))
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")), null, 'errors');
|
|
||||||
$action='test';
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
if (empty($sendto))
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTo")), null, 'errors');
|
|
||||||
$action='test';
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
// Is the message in HTML?
|
|
||||||
$msgishtml=0; // Message is not HTML
|
|
||||||
if ($action == 'sendhtml') $msgishtml=1; // Force message to HTML
|
|
||||||
|
|
||||||
// Pratique les substitutions sur le sujet et message
|
|
||||||
$subject=make_substitutions($subject,$substitutionarrayfortest);
|
|
||||||
$body=make_substitutions($body,$substitutionarrayfortest);
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
|
||||||
$mailfile = new CMailFile(
|
|
||||||
$subject,
|
|
||||||
$sendto,
|
|
||||||
$email_from,
|
|
||||||
$body,
|
|
||||||
$filepath,
|
|
||||||
$mimetype,
|
|
||||||
$filename,
|
|
||||||
$sendtocc,
|
|
||||||
$sendtoccc,
|
|
||||||
$deliveryreceipt,
|
|
||||||
$msgishtml,
|
|
||||||
$errors_to,
|
|
||||||
'',
|
|
||||||
$trackid
|
|
||||||
);
|
|
||||||
|
|
||||||
$result=$mailfile->sendfile();
|
|
||||||
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)), null, 'mesgs');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -747,7 +617,7 @@ else
|
|||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->trackid='test';
|
$formmail->trackid=(($action == 'testhtml')?"testhtml":"test");
|
||||||
$formmail->withfromreadonly=0;
|
$formmail->withfromreadonly=0;
|
||||||
$formmail->withsubstit=0;
|
$formmail->withsubstit=0;
|
||||||
$formmail->withfrom=1;
|
$formmail->withfrom=1;
|
||||||
@ -767,7 +637,7 @@ else
|
|||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit=$substitutionarrayfortest;
|
$formmail->substit=$substitutionarrayfortest;
|
||||||
// Tableau des parametres complementaires du post
|
// Tableau des parametres complementaires du post
|
||||||
$formmail->param["action"]=($action == 'testhtml'?"sendhtml":"send");
|
$formmail->param["action"]="send";
|
||||||
$formmail->param["models"]="body";
|
$formmail->param["models"]="body";
|
||||||
$formmail->param["mailid"]=0;
|
$formmail->param["mailid"]=0;
|
||||||
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
||||||
@ -778,7 +648,7 @@ else
|
|||||||
$formmail->clear_attached_files();
|
$formmail->clear_attached_files();
|
||||||
}
|
}
|
||||||
|
|
||||||
print $formmail->get_form(($action == 'testhtml'?'addfilehtml':'addfile'),($action == 'testhtml'?'removefilehtml':'removefile'));
|
print $formmail->get_form('addfile','removefile');
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -277,7 +277,8 @@ $sql.= " WHERE f.entity = ".$conf->entity;
|
|||||||
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
||||||
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
||||||
$sql.= " AND localtaxtype=".$localTaxType;
|
$sql.= " AND localtaxtype=".$localTaxType;
|
||||||
$sql.= " GROUP BY dm ASC ORDER BY dm ASC";
|
$sql.= " GROUP BY dm";
|
||||||
|
$sql.= " ORDER BY dm ASC";
|
||||||
|
|
||||||
pt($db, $sql,$langs->trans("Year")." $y");
|
pt($db, $sql,$langs->trans("Year")." $y");
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,13 @@
|
|||||||
* \brief Code for actions on sending mails from object page
|
* \brief Code for actions on sending mails from object page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// $mysoc must be defined
|
||||||
// $id must be defined
|
// $id must be defined
|
||||||
// $actiontypecode must be defined
|
// $actiontypecode must be defined
|
||||||
// $paramname must be defined
|
// $paramname must be defined
|
||||||
// $mode must be defined
|
// $mode must be defined
|
||||||
|
// $object and $uobject may be defined.
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add file in email form
|
* Add file in email form
|
||||||
@ -86,11 +88,11 @@ if (GETPOST('removAll'))
|
|||||||
{
|
{
|
||||||
$pathtodelete = $value;
|
$pathtodelete = $value;
|
||||||
$filetodelete = $listofnames[$key];
|
$filetodelete = $listofnames[$key];
|
||||||
$result = dol_delete_file($pathtodelete,1); // Delete uploded Files
|
$result = dol_delete_file($pathtodelete,1); // Delete uploded Files
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
setEventMessages($langs->trans("FileWasRemoved",$filetodelete), null, 'mesgs');
|
setEventMessages($langs->trans("FileWasRemoved",$filetodelete), null, 'mesgs');
|
||||||
|
|
||||||
$formmail->remove_attached_files($key); // Update Session
|
$formmail->remove_attached_files($key); // Update Session
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,51 +109,55 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
|
|
||||||
$subject='';$actionmsg='';$actionmsg2='';
|
$subject='';$actionmsg='';$actionmsg2='';
|
||||||
|
|
||||||
$result=$object->fetch($id);
|
if (is_object($object))
|
||||||
|
|
||||||
$sendtosocid=0;
|
|
||||||
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
|
|
||||||
{
|
{
|
||||||
$result=$object->fetch_thirdparty();
|
$result=$object->fetch($id);
|
||||||
$thirdparty=$object->thirdparty;
|
|
||||||
$sendtosocid=$thirdparty->id;
|
$sendtosocid=0;
|
||||||
|
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
|
||||||
|
{
|
||||||
|
$result=$object->fetch_thirdparty();
|
||||||
|
$thirdparty=$object->thirdparty;
|
||||||
|
$sendtosocid=$thirdparty->id;
|
||||||
|
}
|
||||||
|
else if ($object->element == 'societe')
|
||||||
|
{
|
||||||
|
$thirdparty=$object;
|
||||||
|
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
|
||||||
|
elseif($conf->dolimail->enabled)
|
||||||
|
{
|
||||||
|
$dolimail = new Dolimail($db);
|
||||||
|
$possibleaccounts=$dolimail->get_societe_by_email($_POST['sendto'],"1");
|
||||||
|
$possibleuser=$dolimail->get_from_user_by_mail($_POST['sendto'],"1"); // suche in llx_societe and socpeople
|
||||||
|
if (!$possibleaccounts && !$possibleuser)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']), null, 'errors');
|
||||||
|
}
|
||||||
|
elseif (count($possibleaccounts)>1)
|
||||||
|
{
|
||||||
|
$sendtosocid=$possibleaccounts[1]['id'];
|
||||||
|
$result=$object->fetch($sendtosocid);
|
||||||
|
|
||||||
|
setEventMessages($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if($possibleaccounts){
|
||||||
|
$sendtosocid=$possibleaccounts[1]['id'];
|
||||||
|
$result=$object->fetch($sendtosocid);
|
||||||
|
}elseif($possibleuser){
|
||||||
|
$sendtosocid=$possibleuser[0]['id'];
|
||||||
|
|
||||||
|
$result=$uobject->fetch($sendtosocid);
|
||||||
|
$object=$uobject;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported');
|
||||||
}
|
}
|
||||||
else if ($object->element == 'societe')
|
else $thirdparty = $mysoc;
|
||||||
{
|
|
||||||
$thirdparty=$object;
|
|
||||||
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
|
|
||||||
elseif($conf->dolimail->enabled)
|
|
||||||
{
|
|
||||||
$dolimail = new Dolimail($db);
|
|
||||||
$possibleaccounts=$dolimail->get_societe_by_email($_POST['sendto'],"1");
|
|
||||||
$possibleuser=$dolimail->get_from_user_by_mail($_POST['sendto'],"1"); // suche in llx_societe and socpeople
|
|
||||||
if (!$possibleaccounts && !$possibleuser)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('ErrorFailedToFindSocieteRecord',$_POST['sendto']), null, 'errors');
|
|
||||||
}
|
|
||||||
elseif (count($possibleaccounts)>1)
|
|
||||||
{
|
|
||||||
$sendtosocid=$possibleaccounts[1]['id'];
|
|
||||||
$result=$object->fetch($sendtosocid);
|
|
||||||
|
|
||||||
setEventMessages($langs->trans('ErrorFoundMoreThanOneRecordWithEmail',$_POST['sendto'],$object->name), null, 'mesgs');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if($possibleaccounts){
|
|
||||||
$sendtosocid=$possibleaccounts[1]['id'];
|
|
||||||
$result=$object->fetch($sendtosocid);
|
|
||||||
}elseif($possibleuser){
|
|
||||||
$sendtosocid=$possibleuser[0]['id'];
|
|
||||||
|
|
||||||
$result=$uobject->fetch($sendtosocid);
|
|
||||||
$object=$uobject;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported');
|
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -247,35 +253,35 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$mailboxconfig = new IMAP($db);
|
$mailboxconfig = new IMAP($db);
|
||||||
$mailboxconfig->fetch($mbid);
|
$mailboxconfig->fetch($mbid);
|
||||||
if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref();
|
if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref();
|
||||||
|
|
||||||
$mailboxconfig->folder_id=$mailboxconfig->mailbox_imap_outbox;
|
$mailboxconfig->folder_id=$mailboxconfig->mailbox_imap_outbox;
|
||||||
$mailboxconfig->userfolder_fetch();
|
$mailboxconfig->userfolder_fetch();
|
||||||
|
|
||||||
if ($mailboxconfig->mailbox_save_sent_mails == 1)
|
if ($mailboxconfig->mailbox_save_sent_mails == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
$folder=str_replace($ref, '', $mailboxconfig->folder_cache_key);
|
$folder=str_replace($ref, '', $mailboxconfig->folder_cache_key);
|
||||||
if (!$folder) $folder = "Sent"; // Default Sent folder
|
if (!$folder) $folder = "Sent"; // Default Sent folder
|
||||||
|
|
||||||
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
|
$mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password);
|
||||||
if (FALSE === $mailboxconfig->mbox)
|
if (FALSE === $mailboxconfig->mbox)
|
||||||
{
|
{
|
||||||
$info = FALSE;
|
$info = FALSE;
|
||||||
$err = $langs->trans('Error3_Imap_Connection_Error');
|
$err = $langs->trans('Error3_Imap_Connection_Error');
|
||||||
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
setEventMessages($err,$mailboxconfig->element, null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mailboxconfig->mailboxid=$_POST['frommail'];
|
$mailboxconfig->mailboxid=$_POST['frommail'];
|
||||||
$mailboxconfig->foldername=$folder;
|
$mailboxconfig->foldername=$folder;
|
||||||
$from = $mailfromid[0] . $mailfromid[2];
|
$from = $mailfromid[0] . $mailfromid[2];
|
||||||
$imap=1;
|
$imap=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send mail
|
// Send mail
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid);
|
||||||
@ -290,7 +296,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// FIXME This must be moved into a trigger for action $trigger_name
|
// FIXME This must be moved into a trigger for action $trigger_name
|
||||||
if (! empty($conf->dolimail->enabled))
|
if (! empty($conf->dolimail->enabled))
|
||||||
{
|
{
|
||||||
@ -301,13 +307,13 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$dolimail=new DoliMail($db);
|
$dolimail=new DoliMail($db);
|
||||||
$dolimail->id = $mid;
|
$dolimail->id = $mid;
|
||||||
$res=$dolimail->set_prop($user, 'answered',1);
|
$res=$dolimail->set_prop($user, 'answered',1);
|
||||||
}
|
}
|
||||||
if ($imap==1)
|
if ($imap==1)
|
||||||
{
|
{
|
||||||
// write mail to IMAP Server
|
// write mail to IMAP Server
|
||||||
$movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile);
|
$movemail = $mailboxconfig->putMail($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$folder,$deliveryreceipt,$mailfile);
|
||||||
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
||||||
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +331,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$interface=new Interfaces($db);
|
$interface=new Interfaces($db);
|
||||||
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++; $this->errors=$interface->errors;
|
$error++; $errors=$interface->errors;
|
||||||
}
|
}
|
||||||
// End call of triggers
|
// End call of triggers
|
||||||
|
|
||||||
@ -339,8 +345,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
// This avoid sending mail twice if going out and then back to page
|
// This avoid sending mail twice if going out and then back to page
|
||||||
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
||||||
setEventMessages($mesg, null, 'mesgs');
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
if($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
if ($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
||||||
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
|
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,8 +35,8 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
var $error='';
|
var $error='';
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -209,7 +209,7 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
|
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
|
||||||
}
|
}
|
||||||
else if($extrafields->attribute_type[$key] == 'select')
|
else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
|
||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
|
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
$object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
|
$object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
|
||||||
}
|
}
|
||||||
elseif($extrafields->attribute_type[$key] == 'select')
|
elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
|
||||||
{
|
{
|
||||||
$object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
|
$object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
|
||||||
}
|
}
|
||||||
@ -389,7 +389,7 @@ abstract class CommonDocGenerator
|
|||||||
// Add vat by rates
|
// Add vat by rates
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
|
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
|
||||||
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
|
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
|
||||||
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
|
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
|
||||||
@ -576,12 +576,12 @@ abstract class CommonDocGenerator
|
|||||||
//Add value to store price with currency
|
//Add value to store price with currency
|
||||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
||||||
}
|
}
|
||||||
else if($extrafields->attribute_type[$key] == 'select')
|
else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
|
||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
|
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
|
||||||
}
|
}
|
||||||
else if($extrafields->attribute_type[$key] == 'date')
|
else if($extrafields->attribute_type[$key] == 'date')
|
||||||
{
|
{
|
||||||
if (strlen($object->array_options['options_'.$key])>0)
|
if (strlen($object->array_options['options_'.$key])>0)
|
||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = dol_print_date($object->array_options['options_'.$key],'day'); // using company output language
|
$object->array_options['options_'.$key] = dol_print_date($object->array_options['options_'.$key],'day'); // using company output language
|
||||||
|
|||||||
@ -269,6 +269,7 @@ class FormMail extends Form
|
|||||||
$listofnames=array();
|
$listofnames=array();
|
||||||
$listofmimes=array();
|
$listofmimes=array();
|
||||||
$keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined
|
$keytoavoidconflict = empty($this->trackid)?'':'-'.$this->trackid; // this->trackid must be defined
|
||||||
|
|
||||||
if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]);
|
if (! empty($_SESSION["listofpaths".$keytoavoidconflict])) $listofpaths=explode(';',$_SESSION["listofpaths".$keytoavoidconflict]);
|
||||||
if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]);
|
if (! empty($_SESSION["listofnames".$keytoavoidconflict])) $listofnames=explode(';',$_SESSION["listofnames".$keytoavoidconflict]);
|
||||||
if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]);
|
if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';',$_SESSION["listofmimes".$keytoavoidconflict]);
|
||||||
|
|||||||
@ -1140,7 +1140,7 @@ function dol_strftime($fmt, $ts=false, $is_gmt=false)
|
|||||||
* "%d %b %Y",
|
* "%d %b %Y",
|
||||||
* "%d/%m/%Y %H:%M",
|
* "%d/%m/%Y %H:%M",
|
||||||
* "%d/%m/%Y %H:%M:%S",
|
* "%d/%m/%Y %H:%M:%S",
|
||||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc"
|
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...reduceformat"
|
||||||
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
|
||||||
* false or 'tzserver' => output string is for local PHP server TZ usage
|
* false or 'tzserver' => output string is for local PHP server TZ usage
|
||||||
* 'tzuser' => output string is for user TZ (current browser TZ with current dst)
|
* 'tzuser' => output string is for user TZ (current browser TZ with current dst)
|
||||||
@ -5450,7 +5450,7 @@ function printCommonFooter($zone='private')
|
|||||||
print 'window.console && console.log("';
|
print 'window.console && console.log("';
|
||||||
if (! empty($conf->global->MEMCACHED_SERVER)) print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
|
if (! empty($conf->global->MEMCACHED_SERVER)) print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
|
||||||
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
|
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
|
||||||
if ($micro_start_time)
|
if (! empty($micro_start_time)) // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
|
||||||
{
|
{
|
||||||
$micro_end_time = microtime(true);
|
$micro_end_time = microtime(true);
|
||||||
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
||||||
|
|||||||
@ -49,7 +49,8 @@ $action=GETPOST('action','alpha');
|
|||||||
$cancel=GETPOST('cancel');
|
$cancel=GETPOST('cancel');
|
||||||
$amount=GETPOST('amount');
|
$amount=GETPOST('amount');
|
||||||
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||||
|
$projectid=GETPOST('projectid')?GETPOST('projectid','int'):GETPOST("fk_projet",'int');
|
||||||
|
|
||||||
$object = new Don($db);
|
$object = new Don($db);
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
@ -169,9 +170,10 @@ if ($action == 'add')
|
|||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if ($object->create($user) > 0)
|
$res = $object->create($user);
|
||||||
|
if ($res > 0)
|
||||||
{
|
{
|
||||||
header("Location: index.php");
|
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -365,7 +367,7 @@ if ($action == 'create')
|
|||||||
$formproject=new FormProjets($db);
|
$formproject=new FormProjets($db);
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
||||||
$formproject->select_projects(-1, GETPOST("fk_projet"),'fk_projet', 0, 0, 1, 1);
|
$formproject->select_projects(-1, $projectid,'fk_projet', 0, 0, 1, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -70,11 +70,11 @@ ListOfTasks=List of tasks
|
|||||||
GoToListOfTimeConsumed=Go to list of time consumed
|
GoToListOfTimeConsumed=Go to list of time consumed
|
||||||
GoToListOfTasks=Go to list of tasks
|
GoToListOfTasks=Go to list of tasks
|
||||||
ListProposalsAssociatedProject=List of the commercial proposals associated with the project
|
ListProposalsAssociatedProject=List of the commercial proposals associated with the project
|
||||||
ListOrdersAssociatedProject=List of customer's orders associated with the project
|
ListOrdersAssociatedProject=List of customer orders associated with the project
|
||||||
ListInvoicesAssociatedProject=List of customer's invoices associated with the project
|
ListInvoicesAssociatedProject=List of customer invoices associated with the project
|
||||||
ListPredefinedInvoicesAssociatedProject=List of customer's template invoices associated with project
|
ListPredefinedInvoicesAssociatedProject=List of customer template invoices associated with project
|
||||||
ListSupplierOrdersAssociatedProject=List of supplier's orders associated with the project
|
ListSupplierOrdersAssociatedProject=List of supplier orders associated with the project
|
||||||
ListSupplierInvoicesAssociatedProject=List of supplier's invoices associated with the project
|
ListSupplierInvoicesAssociatedProject=List of supplier invoices associated with the project
|
||||||
ListContractAssociatedProject=List of contracts associated with the project
|
ListContractAssociatedProject=List of contracts associated with the project
|
||||||
ListFichinterAssociatedProject=List of interventions associated with the project
|
ListFichinterAssociatedProject=List of interventions associated with the project
|
||||||
ListExpenseReportsAssociatedProject=List of expense reports associated with the project
|
ListExpenseReportsAssociatedProject=List of expense reports associated with the project
|
||||||
|
|||||||
@ -630,15 +630,16 @@ foreach ($listofreferent as $key => $value)
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans($title), $addform, '');
|
print load_fiche_titre($langs->trans($title), $addform, '');
|
||||||
|
|
||||||
|
print "\n".'<!-- Table for tablename = '.$tablename.' -->'."\n";
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Remove link
|
// Remove link
|
||||||
print '<td style="width: 24px"></td>';
|
print '<td style="width: 24px"></td>';
|
||||||
// Ref
|
// Ref
|
||||||
print '<td style="width: 200px">'.$langs->trans("Ref").'</td>';
|
print '<td'.(($tablename != 'actioncomm' && $tablename != 'projet_task') ? ' style="width: 200px"':'').'>'.$langs->trans("Ref").'</td>';
|
||||||
// Date
|
// Date
|
||||||
print '<td width="100" align="center">';
|
print '<td'.(($tablename != 'actioncomm' && $tablename != 'projet_task') ? ' style="width: 200px"':'').' align="center">';
|
||||||
if (! in_array($tablename, array('projet_task'))) print $langs->trans("Date");
|
if (! in_array($tablename, array('projet_task'))) print $langs->trans("Date");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Thirdparty or user
|
// Thirdparty or user
|
||||||
@ -767,16 +768,33 @@ foreach ($listofreferent as $key => $value)
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') $date=$element->date_commande;
|
$date='';
|
||||||
elseif ($tablename == 'projet_task') $date=''; // We show no date. Showing date of beginning of task make user think it is date of time consumed
|
if ($tablename == 'expensereport_det') $date = $element->date; // No draft status on lines
|
||||||
else
|
elseif (! empty($element->status) || ! empty($element->statut) || ! empty($element->fk_status))
|
||||||
{
|
{
|
||||||
$date=$element->date;
|
if ($tablename=='don') $date = $element->datedon;
|
||||||
if (empty($date)) $date=$element->datep;
|
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
||||||
if (empty($date)) $date=$element->date_contrat;
|
{
|
||||||
if (empty($date)) $date=$element->datev; //Fiche inter
|
$date=($element->date_commande?$element->date_commande:$element->date_valid);
|
||||||
|
}
|
||||||
|
elseif ($tablename == 'supplier_proposal') $date=$element->date_validation; // There is no other date for this
|
||||||
|
elseif ($tablename == 'fichinter') $date=$element->datev; // There is no other date for this
|
||||||
|
elseif ($tablename == 'projet_task') $date=''; // We show no date. Showing date of beginning of task make user think it is date of time consumed
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$date=$element->date; // invoice, ...
|
||||||
|
if (empty($date)) $date=$element->date_contrat;
|
||||||
|
if (empty($date)) $date=$element->datev;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '<td align="center">'.dol_print_date($date,'day').'</td>';
|
print '<td align="center">';
|
||||||
|
if ($tablename == 'actioncomm')
|
||||||
|
{
|
||||||
|
print dol_print_date($element->datep,'dayhour');
|
||||||
|
if ($element->datef && $element->datef > $element->datep) print " - ".dol_print_date($element->datef,'dayhour');
|
||||||
|
}
|
||||||
|
else print dol_print_date($date,'day');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Third party or user
|
// Third party or user
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user