36 $langs->load(
"emailcollector@emailcollector");
41 $head[$h][0] = DOL_URL_ROOT .
'/admin/emailcollector_card.php?id='.$object->id;
42 $head[$h][1] = $langs->trans(
"EmailCollector");
43 $head[$h][2] =
'card';
97 return isset($structure->parts) ? $structure->parts :
false;
108 return $part->ifdparameters ? $part->dparameters :
false;
120 $structure = imap_fetchstructure($mbox, $jk, FT_UID);
124 $attachments = array();
126 if ($nb && !empty($parts)) {
127 for ($i = 1; $i < $nb; $i++) {
130 if ($part->ifdisposition && strtolower($part->disposition) ==
"attachment") {
131 $ext = $part->subtype;
135 $filename = $part->dparameters[0]->value;
136 $filename = imap_utf8($filename);
137 $attachments[] = array(
'type' => $part->type,
'filename' => $filename,
'pos' => $fpos);
157 $merge = imap_fetchbody($mbox, $jk, $fpos, FT_UID);
173 $tmp = explode(
'.', $filename);
174 $ext = array_pop($tmp);
175 $filename = implode(
'.', $tmp);
176 if (!file_exists($path)) {
183 $filepath = $path . $filename .
'.' . $ext;
185 while (file_exists($filepath)) {
186 $filepath = $path . $filename .
'(' . $i .
').' . $ext;
189 file_put_contents($filepath, $data);
205 $message = imap_8bit($message);
208 $message = imap_binary($message);
214 $message = imap_base64($message);
217 $message = imap_qprint($message);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
saveAttachment($path, $filename, $data)
Save the attached file into a directory with a given name.
emailcollectorPrepareHead($object)
Prepare array of tabs for EmailCollector.
getFileData($jk, $fpos, $type, $mbox)
Get content of a joined file from its position into a given email.
getDParameters($part)
Array with joined files.
getParts($structure)
Get parts of a message.
getDecodeValue($message, $coding)
Decode content of a message.
getAttachments($jk, $mbox)
Get attachments of a given mail.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...