|
@@ -24,25 +24,25 @@ discard block |
|
|
block discarded – undo |
24
|
24
|
*/ |
25
|
25
|
|
26
|
26
|
// Put here all includes required by your class file |
27
|
|
-include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php'; |
28
|
|
- |
29
|
|
-require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; |
30
|
|
-require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; |
31
|
|
-require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; |
32
|
|
- |
33
|
|
-require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal |
34
|
|
-require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Sale Order |
35
|
|
-require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice |
36
|
|
-require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address |
37
|
|
-require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery |
38
|
|
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
39
|
|
-require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
40
|
|
-require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project |
41
|
|
-require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception |
42
|
|
-require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
43
|
|
-require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party |
44
|
|
-require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
45
|
|
-require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket |
|
27
|
+include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; |
|
28
|
+ |
|
29
|
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
30
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
31
|
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
32
|
+ |
|
33
|
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Customer Proposal |
|
34
|
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Sale Order |
|
35
|
+require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Customer Invoice |
|
36
|
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Contact / Address |
|
37
|
+require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipping / Delivery |
|
38
|
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
|
39
|
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
|
40
|
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Project |
|
41
|
+require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // Reception |
|
42
|
+require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
|
43
|
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Third-Party |
|
44
|
+require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
|
45
|
+require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; // Ticket |
46
|
46
|
//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report |
47
|
47
|
//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request) |
48
|
48
|
|
|
@@ -789,7 +789,7 @@ discard block |
|
|
block discarded – undo |
789
|
789
|
} elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && getDolGlobalString('IMAP_FORCE_NOSSL'))) { |
790
|
790
|
$flags .= ''; |
791
|
791
|
} else { |
792
|
|
- $flags .= '/' . $this->imap_encryption; |
|
792
|
+ $flags .= '/'.$this->imap_encryption; |
793
|
793
|
} |
794
|
794
|
|
795
|
795
|
$flags .= '/novalidate-cert'; |
|
@@ -819,8 +819,8 @@ discard block |
|
|
block discarded – undo |
819
|
819
|
{ |
820
|
820
|
if (function_exists('mb_convert_encoding')) { |
821
|
821
|
// change spaces by entropy because mb_convert fail with spaces |
822
|
|
- $str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
823
|
|
- $str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
822
|
+ $str = preg_replace("/ /", "xxxSPACExxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
|
823
|
+ $str = preg_replace("/\[Gmail\]/", "xxxGMAILxxx", $str); // the replacement string must be valid in utf7 so _ can't be used |
824
|
824
|
// if mb_convert work |
825
|
825
|
if ($str = mb_convert_encoding($str, "UTF-7")) { |
826
|
826
|
// change characters |
|
@@ -1434,7 +1434,7 @@ discard block |
|
|
block discarded – undo |
1434
|
1434
|
} |
1435
|
1435
|
|
1436
|
1436
|
if ($rule['type'] == 'from') { |
1437
|
|
- $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1437
|
+ $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
1438
|
1438
|
if (count($tmprulevaluearray) >= 2) { |
1439
|
1439
|
foreach ($tmprulevaluearray as $tmprulevalue) { |
1440
|
1440
|
$search .= ($search ? ' ' : '').$not.'FROM "'.str_replace('"', '', $tmprulevalue).'"'; |
|
@@ -1444,7 +1444,7 @@ discard block |
|
|
block discarded – undo |
1444
|
1444
|
} |
1445
|
1445
|
} |
1446
|
1446
|
if ($rule['type'] == 'to') { |
1447
|
|
- $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1447
|
+ $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
1448
|
1448
|
if (count($tmprulevaluearray) >= 2) { |
1449
|
1449
|
foreach ($tmprulevaluearray as $tmprulevalue) { |
1450
|
1450
|
$search .= ($search ? ' ' : '').$not.'TO "'.str_replace('"', '', $tmprulevalue).'"'; |
|
@@ -1621,7 +1621,7 @@ discard block |
|
|
block discarded – undo |
1621
|
1621
|
} |
1622
|
1622
|
} |
1623
|
1623
|
|
1624
|
|
- $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
|
1624
|
+ $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
1625
|
1625
|
|
1626
|
1626
|
// Loop on each email found |
1627
|
1627
|
if (!$error && !empty($arrayofemail) && count($arrayofemail) > 0) { |
|
@@ -1775,7 +1775,7 @@ discard block |
|
|
block discarded – undo |
1775
|
1775
|
$isreplytook = 0; |
1776
|
1776
|
foreach ($rulesreplyto as $key => $rulereplyto) { |
1777
|
1777
|
if (preg_match('/'.preg_quote($rulereplyto, '/').'/', $headers['Reply-To'])) { |
1778
|
|
- $isreplytook ++; |
|
1778
|
+ $isreplytook++; |
1779
|
1779
|
} |
1780
|
1780
|
} |
1781
|
1781
|
|
|
@@ -1835,7 +1835,7 @@ discard block |
|
|
block discarded – undo |
1835
|
1835
|
$attachments = []; |
1836
|
1836
|
} |
1837
|
1837
|
} else { |
1838
|
|
- $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
|
1838
|
+ $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
1839
|
1839
|
} |
1840
|
1840
|
'@phan-var-force Webklex\PHPIMAP\Attachment[] $attachments'; |
1841
|
1841
|
|
|
@@ -1936,7 +1936,7 @@ discard block |
|
|
block discarded – undo |
1936
|
1936
|
$subject = $overview['subject']; |
1937
|
1937
|
} else { |
1938
|
1938
|
$fromstring = $overview[0]->from; |
1939
|
|
- $replytostring = (!empty($overview['in_reply-to']) ? $overview['in_reply-to'] : (!empty($headers['Reply-To']) ? $headers['Reply-To'] : "")) ; |
|
1939
|
+ $replytostring = (!empty($overview['in_reply-to']) ? $overview['in_reply-to'] : (!empty($headers['Reply-To']) ? $headers['Reply-To'] : "")); |
1940
|
1940
|
|
1941
|
1941
|
$sender = !empty($overview[0]->sender) ? $overview[0]->sender : ''; |
1942
|
1942
|
$to = $overview[0]->to; |
|
@@ -2166,7 +2166,7 @@ discard block |
|
|
block discarded – undo |
2166
|
2166
|
} else { |
2167
|
2167
|
foreach ($arrayofreferences as $key => $referencetmp) { |
2168
|
2168
|
if (!str_contains($objectemail->origin_references, $referencetmp)) { |
2169
|
|
- $objectemail->origin_references.= " ".$referencetmp; |
|
2169
|
+ $objectemail->origin_references .= " ".$referencetmp; |
2170
|
2170
|
$changeonticket_references = true; |
2171
|
2171
|
} |
2172
|
2172
|
} |
|
@@ -2302,7 +2302,7 @@ discard block |
|
|
block discarded – undo |
2302
|
2302
|
|
2303
|
2303
|
// Make Operation |
2304
|
2304
|
dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id); |
2305
|
|
- dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object |
|
2305
|
+ dol_syslog("Execute action fk_element_id=".$fk_element_id." fk_element_type=".$fk_element_type); // If a Dolibarr tracker id is found, we should now the id of object |
2306
|
2306
|
|
2307
|
2307
|
$actioncode = 'EMAIL_IN'; |
2308
|
2308
|
// If we scan the Sent box, we use the code for out email |
|
@@ -2338,7 +2338,7 @@ discard block |
|
|
block discarded – undo |
2338
|
2338
|
$alreadycreated2 = $tickettocreate->fetch(0, '', '', $msgid); |
2339
|
2339
|
$alreadycreated = $alreadycreated1 + $alreadycreated2; |
2340
|
2340
|
if ($alreadycreated1 < 0 || $alreadycreated2 < 0) { |
2341
|
|
- $errorfetchticket ++; |
|
2341
|
+ $errorfetchticket++; |
2342
|
2342
|
} |
2343
|
2343
|
if (empty($errorfetchticket)) { |
2344
|
2344
|
if ($alreadycreated == 0) { |
|
@@ -2578,11 +2578,11 @@ discard block |
|
|
block discarded – undo |
2578
|
2578
|
$result = $contactstatic->fetch(0, null, '', $from); |
2579
|
2579
|
if ($result < 0) { |
2580
|
2580
|
$errorforactions++; |
2581
|
|
- $this->error = 'Error when getting contact with email ' . $from; |
|
2581
|
+ $this->error = 'Error when getting contact with email '.$from; |
2582
|
2582
|
$this->errors[] = $this->error; |
2583
|
2583
|
break; |
2584
|
2584
|
} elseif ($result == 0) { |
2585
|
|
- dol_syslog("Contact with email " . $from . " was not found. We try to create it."); |
|
2585
|
+ dol_syslog("Contact with email ".$from." was not found. We try to create it."); |
2586
|
2586
|
$contactstatic = new Contact($this->db); |
2587
|
2587
|
|
2588
|
2588
|
// Create contact |
|
@@ -2597,28 +2597,28 @@ discard block |
|
|
block discarded – undo |
2597
|
2597
|
} else { |
2598
|
2598
|
// Search country by name or code |
2599
|
2599
|
if (!empty($contactstatic->country)) { |
2600
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2600
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
2601
|
2601
|
$result = getCountry('', 3, $this->db, '', 1, $contactstatic->country); |
2602
|
2602
|
if ($result == 'NotDefined') { |
2603
|
2603
|
$errorforactions++; |
2604
|
|
- $this->error = "Error country not found by this name '" . $contactstatic->country . "'"; |
|
2604
|
+ $this->error = "Error country not found by this name '".$contactstatic->country."'"; |
2605
|
2605
|
} elseif (!($result > 0)) { |
2606
|
2606
|
$errorforactions++; |
2607
|
|
- $this->error = "Error when search country by this name '" . $contactstatic->country . "'"; |
|
2607
|
+ $this->error = "Error when search country by this name '".$contactstatic->country."'"; |
2608
|
2608
|
$this->errors[] = $this->db->lasterror(); |
2609
|
2609
|
} else { |
2610
|
2610
|
$contactstatic->country_id = $result; |
2611
|
2611
|
$operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result); |
2612
|
2612
|
} |
2613
|
2613
|
} elseif (!empty($contactstatic->country_code)) { |
2614
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2614
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
2615
|
2615
|
$result = getCountry($contactstatic->country_code, 3, $this->db); |
2616
|
2616
|
if ($result == 'NotDefined') { |
2617
|
2617
|
$errorforactions++; |
2618
|
|
- $this->error = "Error country not found by this code '" . $contactstatic->country_code . "'"; |
|
2618
|
+ $this->error = "Error country not found by this code '".$contactstatic->country_code."'"; |
2619
|
2619
|
} elseif (!($result > 0)) { |
2620
|
2620
|
$errorforactions++; |
2621
|
|
- $this->error = "Error when search country by this code '" . $contactstatic->country_code . "'"; |
|
2621
|
+ $this->error = "Error when search country by this code '".$contactstatic->country_code."'"; |
2622
|
2622
|
$this->errors[] = $this->db->lasterror(); |
2623
|
2623
|
} else { |
2624
|
2624
|
$contactstatic->country_id = $result; |
|
@@ -2629,28 +2629,28 @@ discard block |
|
|
block discarded – undo |
2629
|
2629
|
if (!$errorforactions) { |
2630
|
2630
|
// Search state by name or code (for country if defined) |
2631
|
2631
|
if (!empty($contactstatic->state)) { |
2632
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2632
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
2633
|
2633
|
$result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid'); |
2634
|
2634
|
if (empty($result)) { |
2635
|
2635
|
$errorforactions++; |
2636
|
|
- $this->error = "Error state not found by this name '" . $contactstatic->state . "'"; |
|
2636
|
+ $this->error = "Error state not found by this name '".$contactstatic->state."'"; |
2637
|
2637
|
} elseif (!($result > 0)) { |
2638
|
2638
|
$errorforactions++; |
2639
|
|
- $this->error = "Error when search state by this name '" . $contactstatic->state . "'"; |
|
2639
|
+ $this->error = "Error when search state by this name '".$contactstatic->state."'"; |
2640
|
2640
|
$this->errors[] = $this->db->lasterror(); |
2641
|
2641
|
} else { |
2642
|
2642
|
$contactstatic->state_id = $result; |
2643
|
2643
|
$operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result); |
2644
|
2644
|
} |
2645
|
2645
|
} elseif (!empty($contactstatic->state_code)) { |
2646
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2646
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
2647
|
2647
|
$result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid'); |
2648
|
2648
|
if (empty($result)) { |
2649
|
2649
|
$errorforactions++; |
2650
|
|
- $this->error = "Error state not found by this code '" . $contactstatic->state_code . "'"; |
|
2650
|
+ $this->error = "Error state not found by this code '".$contactstatic->state_code."'"; |
2651
|
2651
|
} elseif (!($result > 0)) { |
2652
|
2652
|
$errorforactions++; |
2653
|
|
- $this->error = "Error when search state by this code '" . $contactstatic->state_code . "'"; |
|
2653
|
+ $this->error = "Error when search state by this code '".$contactstatic->state_code."'"; |
2654
|
2654
|
$this->errors[] = $this->db->lasterror(); |
2655
|
2655
|
} else { |
2656
|
2656
|
$contactstatic->state_id = $result; |
|
@@ -2713,8 +2713,8 @@ discard block |
|
|
block discarded – undo |
2713
|
2713
|
$actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from; |
2714
|
2714
|
$actioncomm->note_private = $descriptionfull; |
2715
|
2715
|
$actioncomm->fk_project = $projectstatic->id; |
2716
|
|
- $actioncomm->datep = $date; // date of email |
2717
|
|
- $actioncomm->datef = $date; // date of email |
|
2716
|
+ $actioncomm->datep = $date; // date of email |
|
2717
|
+ $actioncomm->datef = $date; // date of email |
2718
|
2718
|
$actioncomm->percentage = -1; // Not applicable |
2719
|
2719
|
$actioncomm->socid = $thirdpartystatic->id; |
2720
|
2720
|
$actioncomm->contact_id = $contactstatic->id; |
|
@@ -2913,7 +2913,7 @@ discard block |
|
|
block discarded – undo |
2913
|
2913
|
} |
2914
|
2914
|
$hookmanager->initHooks(array('emailcolector')); |
2915
|
2915
|
$parameters = array('arrayobject' => $arrayobject); |
2916
|
|
- $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
|
2916
|
+ $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
2917
|
2917
|
if ($reshook > 0) { |
2918
|
2918
|
$arrayobject = $hookmanager->resArray; |
2919
|
2919
|
} |
|
@@ -2922,10 +2922,10 @@ discard block |
|
|
block discarded – undo |
2922
|
2922
|
|
2923
|
2923
|
foreach ($arrayobject as $key => $objectdesc) { |
2924
|
2924
|
$sql = 'SELECT DISTINCT t.rowid '; |
2925
|
|
- $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->db->sanitize($objectdesc['table']) . ' AS t'; |
|
2925
|
+ $sql .= ' FROM '.MAIN_DB_PREFIX.$this->db->sanitize($objectdesc['table']).' AS t'; |
2926
|
2926
|
$sql .= ' WHERE '; |
2927
|
2927
|
foreach ($objectdesc['fields'] as $field) { |
2928
|
|
- $sql .= "('" .$this->db->escape($subject) . "' LIKE CONCAT('%', t." . $this->db->sanitize($field) . ", '%') AND t." . $this->db->sanitize($field) . " <> '') OR "; |
|
2928
|
+ $sql .= "('".$this->db->escape($subject)."' LIKE CONCAT('%', t.".$this->db->sanitize($field).", '%') AND t.".$this->db->sanitize($field)." <> '') OR "; |
2929
|
2929
|
} |
2930
|
2930
|
$sql = substr($sql, 0, -4); |
2931
|
2931
|
|
|
@@ -2945,8 +2945,8 @@ discard block |
|
|
block discarded – undo |
2945
|
2945
|
foreach ($ids as $val) { |
2946
|
2946
|
$res = $objectmanaged->fetch($val); |
2947
|
2947
|
if ($res) { |
2948
|
|
- $path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : ''); |
2949
|
|
- $dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/'; |
|
2948
|
+ $path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : ''); |
|
2949
|
+ $dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/'; |
2950
|
2950
|
} else { |
2951
|
2951
|
$this->errors[] = 'object not found'; |
2952
|
2952
|
} |
|
@@ -2955,7 +2955,7 @@ discard block |
|
|
block discarded – undo |
2955
|
2955
|
foreach ($dirs as $target) { |
2956
|
2956
|
$prefix = $this->actions[$this->id]['actionparam']; |
2957
|
2957
|
foreach ($data as $filename => $content) { |
2958
|
|
- $resr = saveAttachment($target, $prefix . '_' . $filename, $content); |
|
2958
|
+ $resr = saveAttachment($target, $prefix.'_'.$filename, $content); |
2959
|
2959
|
if ($resr == -1) { |
2960
|
2960
|
$this->errors[] = 'Doc not saved'; |
2961
|
2961
|
} |
|
@@ -3002,7 +3002,7 @@ discard block |
|
|
block discarded – undo |
3002
|
3002
|
$percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent'); |
3003
|
3003
|
|
3004
|
3004
|
$projecttocreate->title = $subject; |
3005
|
|
- $projecttocreate->date_start = $date; // date of email |
|
3005
|
+ $projecttocreate->date_start = $date; // date of email |
3006
|
3006
|
$projecttocreate->date_end = 0; |
3007
|
3007
|
$projecttocreate->opp_status = $id_opp_status; |
3008
|
3008
|
$projecttocreate->opp_percent = $percent_opp_status; |
|
@@ -3264,7 +3264,7 @@ discard block |
|
|
block discarded – undo |
3264
|
3264
|
$candidaturetocreate->note_private = $descriptionfull; |
3265
|
3265
|
$candidaturetocreate->entity = $conf->entity; |
3266
|
3266
|
$candidaturetocreate->email_msgid = $msgid; |
3267
|
|
- $candidaturetocreate->email_date = $date; // date of email |
|
3267
|
+ $candidaturetocreate->email_date = $date; // date of email |
3268
|
3268
|
$candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT; |
3269
|
3269
|
//$candidaturetocreate->fk_contact = $contactstatic->id; |
3270
|
3270
|
|
|
@@ -3631,8 +3631,8 @@ discard block |
|
|
block discarded – undo |
3631
|
3631
|
* append increment number to the original filename |
3632
|
3632
|
*/ |
3633
|
3633
|
while (file_exists($destdir.$file_name.".".$extension)) { |
3634
|
|
- $file_name = $file_name_original . ' (' . $num . ')'; |
3635
|
|
- $file_name_complete = $file_name . "." . $extension; |
|
3634
|
+ $file_name = $file_name_original.' ('.$num.')'; |
|
3635
|
+ $file_name_complete = $file_name.".".$extension; |
3636
|
3636
|
$destination = $destdir.$file_name_complete; |
3637
|
3637
|
$num++; |
3638
|
3638
|
} |
|
@@ -3746,7 +3746,7 @@ discard block |
|
|
block discarded – undo |
3746
|
3746
|
*/ |
3747
|
3747
|
private function saveAttachment($destdir, $filename, $content) |
3748
|
3748
|
{ |
3749
|
|
- require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; |
|
3749
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
3750
|
3750
|
|
3751
|
3751
|
$tmparraysize = getDefaultImageSizes(); |
3752
|
3752
|
$maxwidthsmall = $tmparraysize['maxwidthsmall']; |