@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | |
68 | 68 | |
69 | 69 | const STATUS_DRAFT = 0; |
70 | - const STATUS_VALIDATED = 1; // Validate (no more draft) |
|
71 | - const STATUS_APPROVED = 2; // Approved |
|
72 | - const STATUS_REFUSED = 3; // Refused |
|
70 | + const STATUS_VALIDATED = 1; // Validate (no more draft) |
|
71 | + const STATUS_APPROVED = 2; // Approved |
|
72 | + const STATUS_REFUSED = 3; // Refused |
|
73 | 73 | const STATUS_CANCELED = 9; |
74 | 74 | |
75 | 75 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
105 | 105 | */ |
106 | - public $fields=array( |
|
106 | + public $fields = array( |
|
107 | 107 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
108 | 108 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), |
109 | 109 | 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'isModEnabled("multicompany")', 'position'=>15, 'notnull'=>1, 'visible'=>-2, 'default'=>'1', 'index'=>1,), |
@@ -361,32 +361,32 @@ discard block |
||
361 | 361 | if ($result) { |
362 | 362 | $obj = $this->db->fetch_object($result); |
363 | 363 | if ($obj) { |
364 | - $this->id = $obj->rowid; |
|
364 | + $this->id = $obj->rowid; |
|
365 | 365 | $this->entity = $obj->entity; |
366 | - $this->ref = $obj->ref; |
|
366 | + $this->ref = $obj->ref; |
|
367 | 367 | |
368 | 368 | $this->fk_type = $obj->fk_type; |
369 | - $this->type_code = $obj->type_code; |
|
369 | + $this->type_code = $obj->type_code; |
|
370 | 370 | $this->type_label = $obj->type_label; |
371 | 371 | |
372 | 372 | $this->fk_soc = $obj->fk_soc; |
373 | 373 | $this->fk_member = $obj->fk_member; |
374 | 374 | $this->status = $obj->status; |
375 | - $this->date_partnership_start = $this->db->jdate($obj->date_partnership_start); |
|
376 | - $this->date_partnership_end = $this->db->jdate($obj->date_partnership_end); |
|
375 | + $this->date_partnership_start = $this->db->jdate($obj->date_partnership_start); |
|
376 | + $this->date_partnership_end = $this->db->jdate($obj->date_partnership_end); |
|
377 | 377 | $this->date_creation = $this->db->jdate($obj->date_creation); |
378 | 378 | $this->fk_user_creat = $obj->fk_user_creat; |
379 | - $this->tms = $obj->tms; |
|
379 | + $this->tms = $obj->tms; |
|
380 | 380 | $this->fk_user_modif = $obj->fk_user_modif; |
381 | 381 | $this->note_private = $obj->note_private; |
382 | 382 | $this->note_public = $obj->note_public; |
383 | 383 | $this->last_main_doc = $obj->last_main_doc; |
384 | - $this->count_last_url_check_error = $obj->count_last_url_check_error; |
|
385 | - $this->last_check_backlink = $this->db->jdate($obj->last_check_backlink); |
|
386 | - $this->reason_decline_or_cancel = $obj->reason_decline_or_cancel; |
|
387 | - $this->import_key = $obj->import_key; |
|
388 | - $this->model_pdf = $obj->model_pdf; |
|
389 | - $this->url_to_check = $obj->url_to_check; |
|
384 | + $this->count_last_url_check_error = $obj->count_last_url_check_error; |
|
385 | + $this->last_check_backlink = $this->db->jdate($obj->last_check_backlink); |
|
386 | + $this->reason_decline_or_cancel = $obj->reason_decline_or_cancel; |
|
387 | + $this->import_key = $obj->import_key; |
|
388 | + $this->model_pdf = $obj->model_pdf; |
|
389 | + $this->url_to_check = $obj->url_to_check; |
|
390 | 390 | |
391 | 391 | // Retrieve all extrafield |
392 | 392 | // fetch optionals attributes and labels |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | return 0; |
839 | 839 | } |
840 | 840 | |
841 | - $this->status = self::STATUS_REFUSED; |
|
841 | + $this->status = self::STATUS_REFUSED; |
|
842 | 842 | $this->reason_decline_or_cancel = $reasondeclinenote; |
843 | 843 | |
844 | 844 | $result = $this->update($user); |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | $label = $langs->trans("ShowPartnership"); |
976 | 976 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
977 | 977 | } |
978 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
978 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
979 | 979 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
980 | 980 | } else { |
981 | 981 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1244,7 +1244,7 @@ |
||
1244 | 1244 | $maxfilesizearray = getMaxFileSizeArray(); |
1245 | 1245 | $maxmin = $maxfilesizearray['maxmin']; |
1246 | 1246 | if ($maxmin > 0) { |
1247 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
1247 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
1248 | 1248 | } |
1249 | 1249 | print '<input type="file" class="flat maxwidth200" name="photo" id="photoinput">'; |
1250 | 1250 | print '</td></tr>'; |
@@ -22,24 +22,24 @@ discard block |
||
22 | 22 | */ |
23 | 23 | |
24 | 24 | // Put here all includes required by your class file |
25 | -include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php'; |
|
26 | - |
|
27 | -require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; |
|
28 | -require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; |
|
29 | - |
|
30 | -require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal |
|
31 | -require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Sale Order |
|
32 | -require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice |
|
33 | -require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address |
|
34 | -require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery |
|
35 | -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
|
36 | -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
|
37 | -require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project |
|
38 | -require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception |
|
39 | -require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
|
40 | -require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party |
|
41 | -require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
|
42 | -require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket |
|
25 | +include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; |
|
26 | + |
|
27 | +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; |
|
28 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
29 | + |
|
30 | +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // Customer Proposal |
|
31 | +require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Sale Order |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Customer Invoice |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Contact / Address |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipping / Delivery |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // Purchase Order |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Project |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // Reception |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; // Third-Party |
|
41 | +require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; // Ticket |
|
43 | 43 | //require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report |
44 | 44 | //require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request) |
45 | 45 | |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | } elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && !empty($conf->global->IMAP_FORCE_NOSSL))) { |
793 | 793 | $flags .= ''; |
794 | 794 | } else { |
795 | - $flags .= '/' . $this->imap_encryption; |
|
795 | + $flags .= '/'.$this->imap_encryption; |
|
796 | 796 | } |
797 | 797 | |
798 | 798 | $flags .= '/novalidate-cert'; |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | } |
1404 | 1404 | |
1405 | 1405 | if ($rule['type'] == 'from') { |
1406 | - $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1406 | + $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1407 | 1407 | if (count($tmprulevaluearray) >= 2) { |
1408 | 1408 | foreach ($tmprulevaluearray as $tmprulevalue) { |
1409 | 1409 | $search .= ($search ? ' ' : '').$not.'FROM "'.str_replace('"', '', $tmprulevalue).'"'; |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | } |
1414 | 1414 | } |
1415 | 1415 | if ($rule['type'] == 'to') { |
1416 | - $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1416 | + $tmprulevaluearray = explode('*', $rule['rulevalue']); // Search on abc*def means searching on 'abc' and on 'def' |
|
1417 | 1417 | if (count($tmprulevaluearray) >= 2) { |
1418 | 1418 | foreach ($tmprulevaluearray as $tmprulevalue) { |
1419 | 1419 | $search .= ($search ? ' ' : '').$not.'TO "'.str_replace('"', '', $tmprulevalue).'"'; |
@@ -1569,7 +1569,7 @@ discard block |
||
1569 | 1569 | } |
1570 | 1570 | } |
1571 | 1571 | |
1572 | - $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
|
1572 | + $arrayofemailtodelete = array(); // Track email to delete to make the deletion at end. |
|
1573 | 1573 | |
1574 | 1574 | // Loop on each email found |
1575 | 1575 | if (!$error && !empty($arrayofemail) && count($arrayofemail) > 0) { |
@@ -1639,8 +1639,8 @@ discard block |
||
1639 | 1639 | } else { |
1640 | 1640 | $operationslog .= " - ".dol_escape_htmltag((string) $imapemail); |
1641 | 1641 | } |
1642 | - $operationslog .= " - References: ".dol_escape_htmltag($headers['References']??'')." - Subject: ".dol_escape_htmltag($headers['Subject']); |
|
1643 | - dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References']??'')." Subject: ".$headers['Subject']); |
|
1642 | + $operationslog .= " - References: ".dol_escape_htmltag($headers['References'] ?? '')." - Subject: ".dol_escape_htmltag($headers['Subject']); |
|
1643 | + dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References'] ?? '')." Subject: ".$headers['Subject']); |
|
1644 | 1644 | |
1645 | 1645 | |
1646 | 1646 | $trackidfoundintorecipienttype = ''; |
@@ -1760,7 +1760,7 @@ discard block |
||
1760 | 1760 | $attachments = []; |
1761 | 1761 | } |
1762 | 1762 | } else { |
1763 | - $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
|
1763 | + $this->getmsg($connection, $imapemail); // This set global var $charset, $htmlmsg, $plainmsg, $attachments |
|
1764 | 1764 | } |
1765 | 1765 | //print $plainmsg; |
1766 | 1766 | //var_dump($plainmsg); exit; |
@@ -2197,7 +2197,7 @@ discard block |
||
2197 | 2197 | |
2198 | 2198 | // Make Operation |
2199 | 2199 | dol_syslog("Execute action ".$operation['type']." actionparam=".$operation['actionparam'].' thirdpartystatic->id='.$thirdpartystatic->id.' contactstatic->id='.$contactstatic->id.' projectstatic->id='.$projectstatic->id); |
2200 | - 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 |
|
2200 | + 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 |
|
2201 | 2201 | |
2202 | 2202 | $actioncode = 'EMAIL_IN'; |
2203 | 2203 | // If we scan the Sent box, we use the code for out email |
@@ -2377,7 +2377,7 @@ discard block |
||
2377 | 2377 | $thirdpartystatic->name_alias = $namealiastouseforthirdparty; |
2378 | 2378 | } |
2379 | 2379 | } else { |
2380 | - $thirdpartystatic->name_alias = (empty($replytostring) ? (empty($fromtext) ? '': $fromtext) : $replytostring); |
|
2380 | + $thirdpartystatic->name_alias = (empty($replytostring) ? (empty($fromtext) ? '' : $fromtext) : $replytostring); |
|
2381 | 2381 | } |
2382 | 2382 | $thirdpartystatic->email = (empty($emailtouseforthirdparty) ? (empty($replyto) ? (empty($from) ? '' : $from) : $replyto) : $emailtouseforthirdparty); |
2383 | 2383 | |
@@ -2428,11 +2428,11 @@ discard block |
||
2428 | 2428 | $result = $contactstatic->fetch(0, null, '', $from); |
2429 | 2429 | if ($result < 0) { |
2430 | 2430 | $errorforactions++; |
2431 | - $this->error = 'Error when getting contact with email ' . $from; |
|
2431 | + $this->error = 'Error when getting contact with email '.$from; |
|
2432 | 2432 | $this->errors[] = $this->error; |
2433 | 2433 | break; |
2434 | 2434 | } elseif ($result == 0) { |
2435 | - dol_syslog("Contact with email " . $from . " was not found. We try to create it."); |
|
2435 | + dol_syslog("Contact with email ".$from." was not found. We try to create it."); |
|
2436 | 2436 | $contactstatic = new Contact($this->db); |
2437 | 2437 | |
2438 | 2438 | // Create contact |
@@ -2447,28 +2447,28 @@ discard block |
||
2447 | 2447 | } else { |
2448 | 2448 | // Search country by name or code |
2449 | 2449 | if (!empty($contactstatic->country)) { |
2450 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2450 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
2451 | 2451 | $result = getCountry('', 3, $this->db, '', 1, $contactstatic->country); |
2452 | 2452 | if ($result == 'NotDefined') { |
2453 | 2453 | $errorforactions++; |
2454 | - $this->error = "Error country not found by this name '" . $contactstatic->country . "'"; |
|
2454 | + $this->error = "Error country not found by this name '".$contactstatic->country."'"; |
|
2455 | 2455 | } elseif (!($result > 0)) { |
2456 | 2456 | $errorforactions++; |
2457 | - $this->error = "Error when search country by this name '" . $contactstatic->country . "'"; |
|
2457 | + $this->error = "Error when search country by this name '".$contactstatic->country."'"; |
|
2458 | 2458 | $this->errors[] = $this->db->lasterror(); |
2459 | 2459 | } else { |
2460 | 2460 | $contactstatic->country_id = $result; |
2461 | 2461 | $operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result); |
2462 | 2462 | } |
2463 | 2463 | } elseif (!empty($contactstatic->country_code)) { |
2464 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
2464 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
2465 | 2465 | $result = getCountry($contactstatic->country_code, 3, $this->db); |
2466 | 2466 | if ($result == 'NotDefined') { |
2467 | 2467 | $errorforactions++; |
2468 | - $this->error = "Error country not found by this code '" . $contactstatic->country_code . "'"; |
|
2468 | + $this->error = "Error country not found by this code '".$contactstatic->country_code."'"; |
|
2469 | 2469 | } elseif (!($result > 0)) { |
2470 | 2470 | $errorforactions++; |
2471 | - $this->error = "Error when search country by this code '" . $contactstatic->country_code . "'"; |
|
2471 | + $this->error = "Error when search country by this code '".$contactstatic->country_code."'"; |
|
2472 | 2472 | $this->errors[] = $this->db->lasterror(); |
2473 | 2473 | } else { |
2474 | 2474 | $contactstatic->country_id = $result; |
@@ -2479,28 +2479,28 @@ discard block |
||
2479 | 2479 | if (!$errorforactions) { |
2480 | 2480 | // Search state by name or code (for country if defined) |
2481 | 2481 | if (!empty($contactstatic->state)) { |
2482 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2482 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
|
2483 | 2483 | $result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid'); |
2484 | 2484 | if (empty($result)) { |
2485 | 2485 | $errorforactions++; |
2486 | - $this->error = "Error state not found by this name '" . $contactstatic->state . "'"; |
|
2486 | + $this->error = "Error state not found by this name '".$contactstatic->state."'"; |
|
2487 | 2487 | } elseif (!($result > 0)) { |
2488 | 2488 | $errorforactions++; |
2489 | - $this->error = "Error when search state by this name '" . $contactstatic->state . "'"; |
|
2489 | + $this->error = "Error when search state by this name '".$contactstatic->state."'"; |
|
2490 | 2490 | $this->errors[] = $this->db->lasterror(); |
2491 | 2491 | } else { |
2492 | 2492 | $contactstatic->state_id = $result; |
2493 | 2493 | $operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result); |
2494 | 2494 | } |
2495 | 2495 | } elseif (!empty($contactstatic->state_code)) { |
2496 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; |
|
2496 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; |
|
2497 | 2497 | $result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid'); |
2498 | 2498 | if (empty($result)) { |
2499 | 2499 | $errorforactions++; |
2500 | - $this->error = "Error state not found by this code '" . $contactstatic->state_code . "'"; |
|
2500 | + $this->error = "Error state not found by this code '".$contactstatic->state_code."'"; |
|
2501 | 2501 | } elseif (!($result > 0)) { |
2502 | 2502 | $errorforactions++; |
2503 | - $this->error = "Error when search state by this code '" . $contactstatic->state_code . "'"; |
|
2503 | + $this->error = "Error when search state by this code '".$contactstatic->state_code."'"; |
|
2504 | 2504 | $this->errors[] = $this->db->lasterror(); |
2505 | 2505 | } else { |
2506 | 2506 | $contactstatic->state_id = $result; |
@@ -2563,8 +2563,8 @@ discard block |
||
2563 | 2563 | $actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from; |
2564 | 2564 | $actioncomm->note_private = $descriptionfull; |
2565 | 2565 | $actioncomm->fk_project = $projectstatic->id; |
2566 | - $actioncomm->datep = $date; // date of email |
|
2567 | - $actioncomm->datef = $date; // date of email |
|
2566 | + $actioncomm->datep = $date; // date of email |
|
2567 | + $actioncomm->datef = $date; // date of email |
|
2568 | 2568 | $actioncomm->percentage = -1; // Not applicable |
2569 | 2569 | $actioncomm->socid = $thirdpartystatic->id; |
2570 | 2570 | $actioncomm->contact_id = $contactstatic->id; |
@@ -2736,7 +2736,7 @@ discard block |
||
2736 | 2736 | } |
2737 | 2737 | $hookmanager->initHooks(array('emailcolector')); |
2738 | 2738 | $parameters = array('arrayobject' => $arrayobject); |
2739 | - $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
|
2739 | + $reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks |
|
2740 | 2740 | if ($reshook > 0) { |
2741 | 2741 | $arrayobject = $hookmanager->resArray; |
2742 | 2742 | } |
@@ -2745,10 +2745,10 @@ discard block |
||
2745 | 2745 | |
2746 | 2746 | foreach ($arrayobject as $key => $objectdesc) { |
2747 | 2747 | $sql = 'SELECT DISTINCT t.rowid '; |
2748 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . $objectdesc['table'] . ' AS t'; |
|
2748 | + $sql .= ' FROM '.MAIN_DB_PREFIX.$objectdesc['table'].' AS t'; |
|
2749 | 2749 | $sql .= ' WHERE '; |
2750 | 2750 | foreach ($objectdesc['fields'] as $field) { |
2751 | - $sql .= "'" .$this->db->escape($subject) . "' LIKE CONCAT('%', t." . $field . ", '%') OR "; |
|
2751 | + $sql .= "'".$this->db->escape($subject)."' LIKE CONCAT('%', t.".$field.", '%') OR "; |
|
2752 | 2752 | } |
2753 | 2753 | $sql = substr($sql, 0, -4); |
2754 | 2754 | |
@@ -2768,8 +2768,8 @@ discard block |
||
2768 | 2768 | foreach ($ids as $val) { |
2769 | 2769 | $res = $objectmanaged->fetch($val); |
2770 | 2770 | if ($res) { |
2771 | - $path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : ''); |
|
2772 | - $dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/'; |
|
2771 | + $path = ($objectmanaged->entity > 1 ? "/".$objectmanaged->entity : ''); |
|
2772 | + $dirs[] = DOL_DATA_ROOT.$path."/".$elementpath.'/'.dol_sanitizeFileName($objectmanaged->ref).'/'; |
|
2773 | 2773 | } else { |
2774 | 2774 | $this->errors[] = 'object not found'; |
2775 | 2775 | } |
@@ -2778,7 +2778,7 @@ discard block |
||
2778 | 2778 | foreach ($dirs as $target) { |
2779 | 2779 | $prefix = $this->actions[$this->id]['actionparam']; |
2780 | 2780 | foreach ($data as $filename => $content) { |
2781 | - $resr = saveAttachment($target, $prefix . '_' . $filename, $content); |
|
2781 | + $resr = saveAttachment($target, $prefix.'_'.$filename, $content); |
|
2782 | 2782 | if ($resr == -1) { |
2783 | 2783 | $this->errors[] = 'Doc not saved'; |
2784 | 2784 | } |
@@ -2825,7 +2825,7 @@ discard block |
||
2825 | 2825 | $percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent'); |
2826 | 2826 | |
2827 | 2827 | $projecttocreate->title = $subject; |
2828 | - $projecttocreate->date_start = $date; // date of email |
|
2828 | + $projecttocreate->date_start = $date; // date of email |
|
2829 | 2829 | $projecttocreate->date_end = ''; |
2830 | 2830 | $projecttocreate->opp_status = $id_opp_status; |
2831 | 2831 | $projecttocreate->opp_percent = $percent_opp_status; |
@@ -3085,7 +3085,7 @@ discard block |
||
3085 | 3085 | $candidaturetocreate->note_private = $descriptionfull; |
3086 | 3086 | $candidaturetocreate->entity = $conf->entity; |
3087 | 3087 | $candidaturetocreate->email_msgid = $msgid; |
3088 | - $candidaturetocreate->email_date = $date; // date of email |
|
3088 | + $candidaturetocreate->email_date = $date; // date of email |
|
3089 | 3089 | $candidaturetocreate->status = $candidaturetocreate::STATUS_DRAFT; |
3090 | 3090 | //$candidaturetocreate->fk_contact = $contactstatic->id; |
3091 | 3091 | |
@@ -3448,8 +3448,8 @@ discard block |
||
3448 | 3448 | * append increment number to the original filename |
3449 | 3449 | */ |
3450 | 3450 | while (file_exists($destdir.$file_name.".".$extension)) { |
3451 | - $file_name = $file_name_original . ' (' . $num . ')'; |
|
3452 | - $file_name_complete = $file_name . "." . $extension; |
|
3451 | + $file_name = $file_name_original.' ('.$num.')'; |
|
3452 | + $file_name_complete = $file_name.".".$extension; |
|
3453 | 3453 | $destination = $destdir.$file_name_complete; |
3454 | 3454 | $num++; |
3455 | 3455 | } |
@@ -3583,7 +3583,7 @@ discard block |
||
3583 | 3583 | */ |
3584 | 3584 | private function saveAttachment($destdir, $filename, $content) |
3585 | 3585 | { |
3586 | - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; |
|
3586 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
3587 | 3587 | |
3588 | 3588 | $tmparraysize = getDefaultImageSizes(); |
3589 | 3589 | $maxwidthsmall = $tmparraysize['maxwidthsmall']; |