Fix phpcs

This commit is contained in:
Laurent Destailleur 2019-04-25 21:48:35 +02:00
parent e332288e73
commit 1dd8d9fa8f
2 changed files with 11 additions and 9 deletions

View File

@ -714,7 +714,7 @@ if ($rowid > 0)
$subscriptionstatic->ref=$objp->crowid;
$subscriptionstatic->id=$objp->crowid;
if ($objp->cfk_type > 0)
if ($objp->cfk_type > 0)
{
$adht->fetch($objp->cfk_type);
}
@ -723,7 +723,7 @@ if ($rowid > 0)
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td class="center">'.dol_print_date($db->jdate($objp->datec), 'dayhour')."</td>\n";
print '<td class="center">';
if ($objp->cfk_type > 0)
if ($objp->cfk_type > 0)
{
print $adht->getNomUrl(1);
}

View File

@ -1820,7 +1820,8 @@ class EmailCollector extends CommonObject
* @param string $mid prefix
* @return array Array with number and object
*/
function getmsg($mbox, $mid) {
private function getmsg($mbox, $mid)
{
// input $mbox = IMAP stream, $mid = message id
// output all the following:
global $charset,$htmlmsg,$plainmsg,$attachments;
@ -1832,10 +1833,10 @@ class EmailCollector extends CommonObject
// add code here to get date, from, to, cc, subject...
// BODY
$s = imap_fetchstructure($mbox,$mid);
$s = imap_fetchstructure($mbox, $mid);
if (!$s->parts) // simple
$this->getpart($mbox,$mid,$s,0); // pass 0 as part-number
$this->getpart($mbox, $mid, $s, 0); // pass 0 as part-number
else { // multipart: cycle through each part
foreach ($s->parts as $partno0=>$p)
{
@ -1868,14 +1869,15 @@ class EmailCollector extends CommonObject
* @param string $partno Partno
* @return void
*/
private function getpart($mbox, $mid, $p, $partno) {
private function getpart($mbox, $mid, $p, $partno)
{
// $partno = '1', '2', '2.1', '2.1.3', etc for multipart, 0 if simple
global $htmlmsg,$plainmsg,$charset,$attachments;
// DECODE DATA
$data = ($partno)?
imap_fetchbody($mbox,$mid,$partno): // multipart
imap_body($mbox,$mid); // simple
imap_fetchbody($mbox, $mid, $partno): // multipart
imap_body($mbox, $mid); // simple
// Any part may be encoded, even plain text messages, so check everything.
if ($p->encoding==4)
$data = quoted_printable_decode($data);
@ -1934,7 +1936,7 @@ class EmailCollector extends CommonObject
if ($p->parts) {
foreach ($p->parts as $partno0=>$p2)
{
$this->getpart($mbox,$mid,$p2,$partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.
$this->getpart($mbox, $mid, $p2, $partno.'.'.($partno0+1)); // 1.2, 1.2.1, etc.
}
}
}