25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
30 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
31 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32 include_once DOL_DOCUMENT_ROOT.
'/emailcollector/class/emailcollector.class.php';
33 include_once DOL_DOCUMENT_ROOT.
'/emailcollector/class/emailcollectorfilter.class.php';
34 include_once DOL_DOCUMENT_ROOT.
'/emailcollector/class/emailcollectoraction.class.php';
35 include_once DOL_DOCUMENT_ROOT.
'/emailcollector/lib/emailcollector.lib.php';
40 if (empty($conf->emailcollector->enabled)) {
45 $langs->loadLangs(array(
"admin",
"mails",
"other"));
50 $action =
GETPOST(
'action',
'aZ09');
51 $confirm =
GETPOST(
'confirm',
'alpha');
52 $cancel =
GETPOST(
'cancel',
'aZ09');
53 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'emailcollectorcard';
54 $backtopage =
GETPOST(
'backtopage',
'alpha');
56 $operationid =
GETPOST(
'operationid',
'int');
61 $diroutputmassaction = $conf->emailcollector->dir_output.
'/temp/massgeneration/'.$user->id;
62 $hookmanager->initHooks(array(
'emailcollectorcard'));
65 $extrafields->fetch_name_optionals_label($object->table_element);
67 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
70 $search_all =
GETPOST(
"search_all",
'alpha');
72 foreach ($object->fields as $key => $val) {
73 if (
GETPOST(
'search_'.$key,
'alpha')) {
74 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
78 if (
GETPOST(
'saveoperation2')) {
79 $action =
'updateoperation';
81 if (empty($action) && empty($id) && empty($ref)) {
86 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
94 $permissionnote = $user->rights->emailcollector->write;
95 $permissiondellink = $user->rights->emailcollector->write;
96 $permissiontoadd = $user->rights->emailcollector->write;
105 $parameters = array();
106 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
112 if (empty($reshook)) {
115 $permissiontoadd = 1;
116 $permissiontodelete = 1;
117 if (empty($backtopage)) {
118 $backtopage = DOL_URL_ROOT.
'/admin/emailcollector_card.php?id='.($id > 0 ? $id :
'__ID__');
120 $backurlforlist = DOL_URL_ROOT.
'/admin/emailcollector_list.php';
123 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
126 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
129 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
132 if (
GETPOST(
'addfilter',
'alpha')) {
134 $emailcollectorfilter->type =
GETPOST(
'filtertype',
'aZ09');
135 $emailcollectorfilter->rulevalue =
GETPOST(
'rulevalue',
'alpha');
136 $emailcollectorfilter->fk_emailcollector = $object->id;
137 $emailcollectorfilter->status = 1;
138 $result = $emailcollectorfilter->create($user);
141 $object->fetchFilters();
143 setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error,
'errors');
147 if ($action ==
'deletefilter') {
149 $emailcollectorfilter->fetch(
GETPOST(
'filterid',
'int'));
150 if ($emailcollectorfilter->id > 0) {
151 $result = $emailcollectorfilter->delete($user);
153 $object->fetchFilters();
155 setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error,
'errors');
160 if (
GETPOST(
'addoperation',
'alpha')) {
162 $emailcollectoroperation->type =
GETPOST(
'operationtype',
'aZ09');
163 $emailcollectoroperation->actionparam =
GETPOST(
'operationparam',
'restricthtml');
164 $emailcollectoroperation->fk_emailcollector = $object->id;
165 $emailcollectoroperation->status = 1;
166 $emailcollectoroperation->position = 50;
168 if ($emailcollectoroperation->type ==
'-1') {
170 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Operation")),
null,
'errors');
173 if (in_array($emailcollectoroperation->type, array(
'loadthirdparty',
'loadandcreatethirdparty'))
174 && empty($emailcollectoroperation->actionparam)) {
176 setEventMessages($langs->trans(
"ErrorAParameterIsRequiredForThisOperation"),
null,
'errors');
180 $result = $emailcollectoroperation->create($user);
183 $object->fetchActions();
186 setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error,
'errors');
191 if ($action ==
'updateoperation') {
193 $emailcollectoroperation->fetch(
GETPOST(
'rowidoperation2',
'int'));
195 $emailcollectoroperation->actionparam =
GETPOST(
'operationparam2',
'restricthtml');
197 if (in_array($emailcollectoroperation->type, array(
'loadthirdparty',
'loadandcreatethirdparty'))
198 && empty($emailcollectoroperation->actionparam)) {
200 setEventMessages($langs->trans(
"ErrorAParameterIsRequiredForThisOperation"),
null,
'errors');
204 $result = $emailcollectoroperation->update($user);
207 $object->fetchActions();
210 setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error,
'errors');
214 if ($action ==
'deleteoperation') {
216 $emailcollectoroperation->fetch(
GETPOST(
'operationid',
'int'));
217 if ($emailcollectoroperation->id > 0) {
218 $result = $emailcollectoroperation->delete($user);
220 $object->fetchActions();
222 setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error,
'errors');
227 if ($action ==
'confirm_collect') {
230 $res = $object->doCollectOneCollector();
232 $debuginfo = $object->debuginfo;
235 $debuginfo = $object->debuginfo;
251 $help_url =
"EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector";
256 if ($action ==
'create') {
257 print
load_fiche_titre($langs->trans(
"NewEmailCollector", $langs->transnoentitiesnoconv(
"EmailCollector")));
259 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
260 print
'<input type="hidden" name="token" value="'.newToken().
'">';
261 print
'<input type="hidden" name="action" value="add">';
262 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
266 print
'<table class="border centpercent tableforfield">'.
"\n";
271 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_add.tpl.php';
274 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
276 print
'</table>'.
"\n";
280 print
$form->buttonsSaveCancel(
"Create");
286 if (($id || $ref) && $action ==
'edit') {
289 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
290 print
'<input type="hidden" name="token" value="'.newToken().
'">';
291 print
'<input type="hidden" name="action" value="update">';
292 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
293 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
297 print
'<table class="border centpercent tableforfield">'.
"\n";
300 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_edit.tpl.php';
303 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_edit.tpl.php';
309 print
$form->buttonsSaveCancel();
315 if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
316 $res = $object->fetch_optionals();
318 $object->fetchFilters();
319 $object->fetchActions();
322 print
dol_get_fiche_head($head,
'card', $langs->trans(
"EmailCollector"), -1,
'email');
327 if ($action ==
'delete') {
328 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteEmailCollector'), $langs->trans(
'ConfirmDeleteEmailCollector'),
'confirm_delete',
'', 0, 1);
332 if ($action ==
'clone') {
334 $formquestion = array();
335 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneEmailCollector', $object->ref),
'confirm_clone', $formquestion,
'yes', 1);
339 if ($action ==
'collect') {
340 $formquestion = array(
341 'text' => $langs->trans(
"EmailCollectorConfirmCollect"),
343 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'EmailCollectorConfirmCollectTitle'), $text,
'confirm_collect', $formquestion, 0, 1, 220);
347 $parameters = array(
'formConfirm' =>
$formconfirm,
'lineid' => $lineid);
348 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
349 if (empty($reshook)) {
351 } elseif ($reshook > 0) {
360 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/emailcollector_list.php?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
362 $morehtmlref =
'<div class="refidno">';
363 $morehtmlref .=
'</div>';
365 $morehtml = $langs->trans(
"NbOfEmailsInInbox").
' : ';
367 $sourcedir = $object->source_directory;
368 $targetdir = ($object->target_directory ? $object->target_directory :
'');
371 $connectstringserver =
'';
372 $connectstringsource =
'';
373 $connectstringtarget =
'';
375 if (function_exists(
'imap_open')) {
379 $connectstringserver = $object->getConnectStringIMAP($usessl);
381 if ($action ==
'scan') {
385 $connectstringsource = $connectstringserver.$object->getEncodedUtf7($sourcedir);
389 $connectstringtarget = $connectstringserver.$object->getEncodedUtf7($targetdir);
392 $timeoutconnect = empty($conf->global->MAIN_USE_CONNECT_TIMEOUT) ? 5 : $conf->global->MAIN_USE_CONNECT_TIMEOUT;
393 $timeoutread = empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT) ? 20 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT;
395 dol_syslog(
"imap_open connectstring=".$connectstringsource.
" login=".$object->login.
" password=".$object->password.
" timeoutconnect=".$timeoutconnect.
" timeoutread=".$timeoutread);
397 $result1 = imap_timeout(IMAP_OPENTIMEOUT, $timeoutconnect);
398 $result2 = imap_timeout(IMAP_READTIMEOUT, $timeoutread);
399 $result3 = imap_timeout(IMAP_WRITETIMEOUT, 5);
400 $result4 = imap_timeout(IMAP_CLOSETIMEOUT, 5);
402 dol_syslog(
"result1=".$result1.
" result2=".$result2.
" result3=".$result3.
" result4=".$result4);
404 $connection = imap_open($connectstringsource, $object->login, $object->password);
408 print $e->getMessage();
412 $morehtml .=
'Failed to open IMAP connection '.$connectstringsource;
413 if (function_exists(
'imap_last_error')) {
414 $morehtml .=
'<br>'.imap_last_error();
419 dol_syslog(
"Imap connected. Now we call imap_num_msg()");
420 $morehtml .= imap_num_msg($connection);
425 imap_close($connection);
428 $morehtml .=
'<a class="flat" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=scan&token='.
newToken().
'">'.
img_picto(
'',
'refresh',
'class="paddingrightonly"').$langs->trans(
"Refresh").
'</a>';
431 $morehtml .=
$form->textwithpicto(
'',
'connect string '.$connectstringserver);
433 $morehtml .=
'IMAP functions not available on your PHP. ';
436 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref.
'<div class="refidno">'.$morehtml.
'</div>',
'', 0,
'',
'', 0,
'');
438 print
'<div class="fichecenter">';
439 print
'<div class="fichehalfleft">';
440 print
'<div class="underbanner clearboth"></div>';
441 print
'<table class="border centpercent tableforfield">'.
"\n";
445 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
448 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
453 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
454 print
'<input type="hidden" name="token" value="'.newToken().
'">';
455 print
'<input type="hidden" name="action" value="updatefiltersactions">';
456 print
'<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
457 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
460 print
'<div class="div-table-responsive-no-min">';
461 print
'<table id="tablelineoffilters" class="noborder margintable noshadow">';
462 print
'<tr class="liste_titre nodrag nodrop">';
463 print
'<td>'.img_picto(
'',
'filter',
'class="pictofixedwidth opacitymedium"').$form->textwithpicto($langs->trans(
"Filters"), $langs->trans(
"EmailCollectorFilterDesc")).
'</td><td></td><td></td>';
466 print
'<tr class="oddeven nodrag nodrop">';
468 $arrayoftypes = array(
469 'from'=>array(
'label'=>
'MailFrom',
'data-placeholder'=>$langs->trans(
'SearchString')),
470 'to'=>array(
'label'=>
'MailTo',
'data-placeholder'=>$langs->trans(
'SearchString')),
471 'cc'=>array(
'label'=>
'Cc',
'data-placeholder'=>$langs->trans(
'SearchString')),
472 'bcc'=>array(
'label'=>
'Bcc',
'data-placeholder'=>$langs->trans(
'SearchString')),
473 'subject'=>array(
'label'=>
'Subject',
'data-placeholder'=>$langs->trans(
'SearchString')),
474 'body'=>array(
'label'=>
'Body',
'data-placeholder'=>$langs->trans(
'SearchString')),
481 'seen'=>array(
'label'=>
'AlreadyRead',
'data-noparam'=>1),
482 'unseen'=>array(
'label'=>
'NotRead',
'data-noparam'=>1),
483 'unanswered'=>array(
'label'=>
'Unanswered',
'data-noparam'=>1),
484 'answered'=>array(
'label'=>
'Answered',
'data-noparam'=>1),
485 'smaller'=>array(
'label'=>
'SmallerThan',
'data-placeholder'=>$langs->trans(
'NumberOfBytes')),
486 'larger'=>array(
'label'=>
'LargerThan',
'data-placeholder'=>$langs->trans(
'NumberOfBytes')),
488 'withtrackingid'=>array(
'label'=>
'WithDolTrackingID',
'data-noparam'=>1),
489 'withouttrackingid'=>array(
'label'=>
'WithoutDolTrackingID',
'data-noparam'=>1),
490 'withtrackingidinmsgid'=>array(
'label'=>
'WithDolTrackingIDInMsgId',
'data-noparam'=>1),
491 'withouttrackingidinmsgid'=>array(
'label'=>
'WithoutDolTrackingIDInMsgId',
'data-noparam'=>1),
493 'isnotanswer'=>array(
'label'=>
'IsNotAnAnswer',
'data-noparam'=>1),
494 'isanswer'=>array(
'label'=>
'IsAnAnswer',
'data-noparam'=>1)
496 print
$form->selectarray(
'filtertype', $arrayoftypes,
'', 1, 0, 0,
'', 1, 0, 0,
'',
'maxwidth300', 1,
'', 2);
500 print
'jQuery("#filtertype").change(function() {
501 console.log("We change a filter");
502 if (jQuery("#filtertype option:selected").attr("data-noparam")) {
503 jQuery("#rulevalue").attr("placeholder", "");
504 jQuery("#rulevalue").text(""); jQuery("#rulevalue").prop("disabled", true);
506 else { jQuery("#rulevalue").prop("disabled", false); }
507 jQuery("#rulevalue").attr("placeholder", (jQuery("#filtertype option:selected").attr("data-placeholder")));
515 print
'</script>'.
"\n";
518 print
'<input type="text" name="rulevalue" id="rulevalue">';
520 print
'<td class="right"><input type="submit" name="addfilter" id="addfilter" class="flat button small" value="'.$langs->trans(
"Add").
'"></td>';
523 foreach ($object->filters as $rulefilter) {
525 $rulefilterobj->fetch($rulefilter[
'id']);
527 print
'<tr class="oddeven">';
528 print
'<td title="'.dol_escape_htmltag($langs->trans(
"Filter").
': '.$rulefilter[
'type']).
'">';
529 print $langs->trans($arrayoftypes[$rulefilter[
'type']][
'label']);
531 print
'<td>'.$rulefilter[
'rulevalue'].
'</td>';
532 print
'<td class="right">';
533 print
' <a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=deletefilter&token='.urlencode(
newToken()).
'&filterid='.$rulefilter[
'id'].
'">'.
img_delete().
'</a>';
542 print
'<div class="clearboth"></div><br>';
545 print
'<div class="div-table-responsive">';
546 print
'<table id="tablelines" class="noborder margintable noshadow">';
547 print
'<tr class="liste_titre nodrag nodrop">';
548 print
'<td>'.img_picto(
'',
'technic',
'class="pictofixedwidth"').$form->textwithpicto($langs->trans(
"EmailcollectorOperations"), $langs->trans(
"EmailcollectorOperationsDesc")).
'</td><td></td><td></td><td></td>';
551 $arrayoftypes = array(
552 'loadthirdparty'=>$langs->trans(
'LoadThirdPartyFromName', $langs->transnoentities(
"ThirdPartyName")),
553 'loadandcreatethirdparty'=>$langs->trans(
'LoadThirdPartyFromNameOrCreate', $langs->transnoentities(
"ThirdPartyName")),
554 'recordjoinpiece'=>
'AttachJoinedDocumentsToObject',
555 'recordevent'=>
'RecordEvent');
556 $arrayoftypesnocondition = $arrayoftypes;
557 if (!empty($conf->project->enabled)) {
558 $arrayoftypes[
'project'] =
'CreateLeadAndThirdParty';
560 $arrayoftypesnocondition[
'project'] =
'CreateLeadAndThirdParty';
561 if (!empty($conf->ticket->enabled)) {
562 $arrayoftypes[
'ticket'] =
'CreateTicketAndThirdParty';
564 $arrayoftypesnocondition[
'ticket'] =
'CreateTicketAndThirdParty';
565 if (!empty($conf->recruitment->enabled)) {
566 $arrayoftypes[
'candidature'] =
'CreateCandidature';
568 $arrayoftypesnocondition[
'candidature'] =
'CreateCandidature';
571 $parameters = array(
'arrayoftypes' => $arrayoftypes);
572 $res = $hookmanager->executeHooks(
'addMoreActionsEmailCollector', $parameters, $object, $action);
575 $arrayoftypes = $hookmanager->resArray;
577 foreach ($hookmanager->resArray as $k => $desc) {
578 $arrayoftypes[$k] = $desc;
583 print
'<tr class="oddeven nodrag nodrop">';
585 print
$form->selectarray(
'operationtype', $arrayoftypes,
'', 1, 0, 0,
'', 1, 0, 0,
'',
'maxwidth300', 1);
587 print
'<input type="text" name="operationparam">';
590 $htmltext = $langs->transnoentitiesnoconv(
"OperationParamDesc");
591 print
$form->textwithpicto(
'', $htmltext, 1,
'help',
'', 0, 2,
'operationparamtt');
593 print
'<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button small" value="'.$langs->trans(
"Add").
'"></td>';
596 $nboflines = count($object->actions);
597 $table_element_line =
'emailcollector_emailcollectoraction';
598 $fk_element =
'position';
600 foreach ($object->actions as $ruleaction) {
601 $ruleactionobj =
new EmailcollectorAction($db);
602 $ruleactionobj->fetch($ruleaction[
'id']);
604 print
'<tr class="drag drop oddeven" id="row-'.$ruleaction[
'id'].
'">';
605 print
'<td title="'.dol_escape_htmltag($langs->trans(
"Operation").
': '.$ruleaction[
'type']).
'">';
606 print
'<!-- type of action: '.$ruleaction[
'type'].
' -->';
607 if (array_key_exists($ruleaction[
'type'], $arrayoftypes)) {
608 print $langs->trans($arrayoftypes[$ruleaction[
'type']]);
610 if (array_key_exists($ruleaction[
'type'], $arrayoftypesnocondition)) {
611 print
'<span class="opacitymedium">'.$langs->trans($arrayoftypesnocondition[$ruleaction[
'type']]).
' - '.$langs->trans(
"Disabled").
'</span>';
615 if (in_array($ruleaction[
'type'], array(
'recordevent'))) {
616 print
$form->textwithpicto(
'', $langs->transnoentitiesnoconv(
'IfTrackingIDFoundEventWillBeLinked'));
617 } elseif (in_array($ruleaction[
'type'], array(
'loadthirdparty',
'loadandcreatethirdparty'))) {
618 print
$form->textwithpicto(
'', $langs->transnoentitiesnoconv(
'EmailCollectorLoadThirdPartyHelp'));
621 print
'<td class="wordbreak minwidth300 small">';
622 if ($action ==
'editoperation' && $ruleaction[
'id'] == $operationid) {
623 print
'<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="'.$ruleaction[
'actionparam'].
'"><br>';
624 print
'<input type="hidden" name="rowidoperation2" value="'.$ruleaction[
'id'].
'">';
625 print
'<input type="submit" class="button small button-save" name="saveoperation2" value="'.$langs->trans(
"Save").
'">';
626 print
'<input type="submit" class="button small button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
628 print $ruleaction[
'actionparam'];
632 print
'<td class="center linecolmove tdlineupdown">';
634 print
'<a class="lineupdown" href="'.$_SERVER[
'PHP_SELF'].
'?action=up&rowid='.$ruleaction[
'id'].
'">'.
img_up(
'default', 0,
'imgupforline').
'</a>';
636 if ($i < count($object->actions) - 1) {
637 print
'<a class="lineupdown" href="'.$_SERVER[
'PHP_SELF'].
'?action=down&rowid='.$ruleaction[
'id'].
'">'.
img_down(
'default', 0,
'imgdownforline').
'</a>';
641 print
'<td class="right nowraponall">';
642 print
'<a class="editfielda marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=editoperation&token='.
newToken().
'&operationid='.$ruleaction[
'id'].
'">'.
img_edit().
'</a>';
643 print
' <a href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=deleteoperation&token='.
newToken().
'&operationid='.$ruleaction[
'id'].
'">'.
img_delete().
'</a>';
653 if (!empty($conf->use_javascript_ajax)) {
654 $urltorefreshaftermove = DOL_URL_ROOT.
'/admin/emailcollector_card.php?id='.$id;
655 include DOL_DOCUMENT_ROOT.
'/core/tpl/ajaxrow.tpl.php';
664 print
'<div class="clearboth"></div><br>';
669 if ($action !=
'presend' && $action !=
'editline') {
670 print
'<div class="tabsAction">'.
"\n";
671 $parameters = array();
672 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
677 if (empty($reshook)) {
679 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Edit").
'</a></div>';
682 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&socid='.$object->socid.
'&action=clone&token='.
newToken().
'&object=order">'.$langs->trans(
"ToClone").
'</a></div>';
685 if (count($object->actions) > 0) {
686 print
'<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=collect&token='.
newToken().
'">'.$langs->trans(
"CollectNow").
'</a></div>';
688 print
'<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans(
"NoOperations")).
'">'.$langs->trans(
"CollectNow").
'</a></div>';
691 print
'<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&action=delete&token='.urlencode(
newToken()).
'">'.$langs->trans(
'Delete').
'</a></div>';
696 if (!empty($debuginfo)) {