mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 12:01:23 +01:00
Synchro
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require("../contact.class.php");
|
||||
require_once("../contact.class.php");
|
||||
require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
||||
|
||||
$langs->load("company");
|
||||
@@ -223,6 +223,9 @@ if ($_GET["action"] == 'create')
|
||||
// print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Note").'</td><td colspan="5"><textarea name="note" cols="60" rows="3"></textarea></td></tr>';
|
||||
|
||||
print '<tr><td>Contact facturation</td><td colspan="5"><select name="facturation"><option value="0">Non<option value="1">Oui</select></td></tr>';
|
||||
|
||||
print '<tr><td align="center" colspan="6"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
|
||||
print "</table>";
|
||||
print "</form>";
|
||||
@@ -276,6 +279,9 @@ elseif ($_GET["action"] == 'edit')
|
||||
print '<textarea name="note" cols="60" rows="3">';
|
||||
print nl2br($contact->note);
|
||||
print '</textarea></td></tr>';
|
||||
|
||||
print '<tr><td>Contact facturation</td><td colspan="5"><select name="facturation"><option value="0">Non<option value="1">Oui</select></td></tr>';
|
||||
|
||||
print '<tr><td colspan="6" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ class CMailFile
|
||||
$out = $out . "Reply-To: $addr_from\n";
|
||||
$out = $out . "X-Mailer: Dolibarr version " . DOL_VERSION ."\n";
|
||||
$out = $out . "X-Sender: $addr_from\n";
|
||||
$out = $out . "Return-path: $addr_from\n";
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,11 @@ class DolibarrMail
|
||||
function PrepareFile($filename_list,$mimetype_list,$mimefilename_list)
|
||||
{
|
||||
|
||||
$this->mime_headers="";
|
||||
|
||||
|
||||
$this->smtp_headers = $this->write_smtpheaders();
|
||||
$this->text_body = $this->write_body($this->message, $filename_list);
|
||||
|
||||
if (count($filename_list))
|
||||
{
|
||||
$this->mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
||||
@@ -91,6 +94,8 @@ class DolibarrMail
|
||||
$mimetype_list,
|
||||
$mimefilename_list);
|
||||
}
|
||||
$this->text_body = $this->write_body($this->message, $filename_list);
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -102,17 +107,29 @@ class DolibarrMail
|
||||
|
||||
function attach_file($filename_list,$mimetype_list,$mimefilename_list)
|
||||
{
|
||||
for ($i = 0; $i < count($filename_list); $i++) {
|
||||
for ($i = 0; $i < count($filename_list); $i++)
|
||||
{
|
||||
$encoded = $this->encode_file($filename_list[$i]);
|
||||
if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i];
|
||||
|
||||
if ($mimefilename_list[$i])
|
||||
{
|
||||
$filename_list[$i] = $mimefilename_list[$i];
|
||||
}
|
||||
|
||||
$out = $out . "--" . $this->mime_boundary . "\n";
|
||||
if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; }
|
||||
$out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"$filename_list[$i]\";\n";
|
||||
|
||||
if (! $mimetype_list[$i])
|
||||
{
|
||||
$mimetype_list[$i] = "application/octet-stream";
|
||||
}
|
||||
|
||||
$out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\";\n";
|
||||
$out = $out . "Content-Transfer-Encoding: base64\n";
|
||||
$out = $out . "Content-disposition: attachment; filename=\"$filename_list[$i]\"\n\n";
|
||||
$out = $out . "Content-disposition: attachment; filename=\"".$filename_list[$i]."\"\n\n";
|
||||
$out = $out . $encoded . "\n";
|
||||
}
|
||||
$out = $out . "--" . $this->mime_boundary . "--" . "\n";
|
||||
|
||||
return $out;
|
||||
// added -- to notify email client attachment is done
|
||||
}
|
||||
@@ -143,6 +160,7 @@ class DolibarrMail
|
||||
{
|
||||
$headers .= $this->smtp_headers . $this->mime_headers;
|
||||
$message = $this->text_body . $this->text_encoded;
|
||||
|
||||
return mail($this->addr_to,$this->subject,stripslashes($message),$headers);
|
||||
}
|
||||
|
||||
@@ -176,10 +194,17 @@ class DolibarrMail
|
||||
$out = $out . "Content-type: multipart/mixed; ";
|
||||
$out = $out . "boundary=\"$this->mime_boundary\"\n";
|
||||
$out = $out . "Content-transfer-encoding: 7BIT\n";
|
||||
for($i = 0; $i < count($filename_list); $i++) {
|
||||
if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i];
|
||||
|
||||
for($i = 0; $i < count($filename_list); $i++)
|
||||
{
|
||||
if ($mimefilename_list[$i])
|
||||
{
|
||||
$filename_list[$i] = $mimefilename_list[$i];
|
||||
}
|
||||
|
||||
$out = $out . "X-attachments: $filename_list[$i];\n\n";
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ class Paiement
|
||||
var $datepaye;
|
||||
var $amount;
|
||||
var $author;
|
||||
var $paiementid; // Type de paiement. Stock<63> dans fk_paiement de llx_paiement qui est li<6C> aux types de paiement de llx_c_paiement
|
||||
var $paiementid; // Type de paiement. Stock<63> dans fk_paiement
|
||||
// de llx_paiement qui est li<6C> aux types de
|
||||
//paiement de llx_c_paiement
|
||||
var $num_paiement; // Num<75>ro du CHQ, VIR, etc...
|
||||
var $note;
|
||||
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
||||
@@ -113,6 +115,7 @@ class Paiement
|
||||
if ($this->db->begin())
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
foreach ($this->amounts as $key => $value)
|
||||
{
|
||||
$facid = $key;
|
||||
@@ -124,6 +127,7 @@ class Paiement
|
||||
$total += $amount;
|
||||
}
|
||||
}
|
||||
|
||||
$total = ereg_replace(",",".",$total);
|
||||
|
||||
if ($total > 0)
|
||||
@@ -146,9 +150,11 @@ class Paiement
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
|
||||
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
||||
|
||||
if (! $this->db->query($sql) )
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
|
||||
$sql_err++;
|
||||
}
|
||||
}
|
||||
@@ -238,7 +244,8 @@ class Paiement
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user