28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/modules/mailings/modules_mailings.php';
30 require_once DOL_DOCUMENT_ROOT.
'/comm/mailing/class/mailing.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmailing.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/emailing.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
37 $langs->load(
"mails");
40 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
41 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
42 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
44 if (empty($page) || $page == -1) {
47 $offset = $limit * $page;
48 $pageprev = $page - 1;
49 $pagenext = $page + 1;
51 $sortfield =
"mc.statut,email";
54 $sortorder =
"DESC,ASC";
58 $rowid =
GETPOST(
'rowid',
'int');
59 $action =
GETPOST(
'action',
'aZ09');
60 $search_lastname =
GETPOST(
"search_lastname",
'alphanohtml');
61 $search_firstname =
GETPOST(
"search_firstname",
'alphanohtml');
62 $search_email =
GETPOST(
"search_email",
'alphanohtml');
63 $search_other =
GETPOST(
"search_other",
'alphanohtml');
64 $search_dest_status =
GETPOST(
'search_dest_status',
'int');
70 $result = $object->fetch($id);
73 $hookmanager->initHooks(array(
'ciblescard',
'globalcard'));
76 if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) {
86 if ($action ==
'add') {
87 $module =
GETPOST(
"module",
'alpha');
90 foreach ($modulesdir as $dir) {
93 dol_syslog(
"Scan directory ".$dir.
" for modules");
96 $file = $dir.
"/".$module.
".modules.php";
97 $classname =
"mailing_".$module;
99 if (file_exists($file)) {
103 $obj =
new $classname($db);
104 dol_syslog(
"Call add_to_target on class ".$classname);
105 $result = $obj->add_to_target($id);
116 setEventMessages($langs->trans(
"Error").($obj->error ?
' '.$obj->error :
''),
null,
'errors');
120 if (
GETPOST(
'clearlist',
'int')) {
123 $obj->clear_target($id);
130 if (
GETPOST(
'exportcsv',
'int')) {
131 $completefilename =
'targets_emailing'.$object->id.
'_'.
dol_print_date(
dol_now(),
'dayhourlog').
'.csv';
132 header(
'Content-Type: text/csv');
133 header(
'Content-Disposition: attachment;filename='.$completefilename);
136 $sql =
"SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut as status, mc.date_envoi, mc.tms,";
137 $sql .=
" mc.source_id, mc.source_type, mc.error_text";
138 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mailing_cibles as mc";
139 $sql .=
" WHERE mc.fk_mailing = ".((int) $object->id);
140 $sql .= $db->order($sortfield, $sortorder);
142 $resql = $db->query($sql);
144 $num = $db->num_rows(
$resql);
147 while ($obj = $db->fetch_object(
$resql)) {
148 print $obj->rowid.$sep;
149 print
'"'.$obj->lastname.
'"'.$sep;
150 print
'"'.$obj->firstname.
'"'.$sep;
151 print $obj->email.$sep;
152 print $obj->other.$sep;
153 print $obj->tms.$sep;
154 print $obj->source_type.$sep;
155 print $obj->source_id.$sep;
156 print $obj->date_envoi.$sep;
157 print $obj->status.$sep;
158 print
'"'.$obj->error_text.
'"'.$sep;
169 if ($action ==
'delete') {
171 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"mailing_cibles WHERE rowid = ".((int) $rowid);
172 $resql = $db->query($sql);
176 $obj->update_nb($id);
180 header(
"Location: list.php");
189 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
190 $search_lastname =
'';
191 $search_firstname =
'';
194 $search_dest_status =
'';
203 llxHeader(
'', $langs->trans(
"Mailing"),
'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing');
208 if ($object->fetch($id) >= 0) {
213 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/mailing/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
217 if ($object->statut == 2 || $object->statut == 3) {
218 $nbtry = $object->countNbOfTargets(
'alreadysent');
219 $nbko = $object->countNbOfTargets(
'alreadysentko');
220 $nbok = ($nbtry - $nbko);
222 $morehtmlright .=
' ('.$nbtry.
'/'.$object->nbemail;
224 $morehtmlright .=
' - '.$nbko.
' '.$langs->trans(
"Error");
226 $morehtmlright .=
') ';
229 dol_banner_tab($object,
'id', $linkback, 1,
'rowid',
'ref',
'',
'', 0,
'', $morehtmlright);
231 print
'<div class="fichecenter">';
232 print
'<div class="underbanner clearboth"></div>';
234 print
'<table class="border centpercent tableforfield">';
236 print
'<tr><td class="titlefield">'.$langs->trans(
"MailTitle").
'</td><td colspan="3">'.$object->title.
'</td></tr>';
238 print
'<tr><td>'.$langs->trans(
"MailFrom").
'</td><td colspan="3">';
240 foreach ($emailarray as $email => $name) {
241 if ($name && $name != $email) {
245 $langs->load(
"errors");
246 print
img_warning($langs->trans(
"ErrorBadEMail", $email));
257 print
'<tr><td>'.$langs->trans(
"MailErrorsTo").
'</td><td colspan="3">';
259 foreach ($emailarray as $email => $name) {
260 if ($name != $email) {
264 $langs->load(
"errors");
265 print
img_warning($langs->trans(
"ErrorBadEMail", $email));
275 print $langs->trans(
"TotalNbOfDistinctRecipients");
276 print
'</td><td colspan="3">';
277 $nbemail = ($object->nbemail ? $object->nbemail : 0);
278 if (is_numeric($nbemail)) {
280 if ((!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail))) {
281 if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0) {
282 $text .= $langs->trans(
'LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
284 $text .= $langs->trans(
'SendingFromWebInterfaceIsNotAllowed');
287 if (empty($nbemail)) {
288 $nbemail .=
' '.img_warning(
'').
' <span class="warning">'.$langs->trans(
"NoTargetYet").
'</span>';
291 print
$form->textwithpicto($nbemail, $text, 1,
'warning');
307 $allowaddtarget = ($object->statut == 0);
310 if ($allowaddtarget && $user->rights->mailing->creer) {
311 print
load_fiche_titre($langs->trans(
"ToAddRecipientsChooseHere"), ($user->admin ?
info_admin($langs->trans(
"YouCanAddYourOwnPredefindedListHere"), 1) :
''),
'generic');
315 print
'<div class="div-table-responsive">';
316 print
'<div class="tagtable centpercent liste_titre_bydiv borderbottom" id="tablelines">';
319 print
'<div class="tagtr liste_titre">';
321 print
'<div class="tagtd">'.$langs->trans(
"RecipientSelectionModules").
'</div>';
323 print
'<div class="tagtd" align="center">'.$langs->trans(
"NbOfUniqueEMails").
'</div>';
325 print
'<div class="tagtd left">'.$langs->trans(
"Filter").
'</div>';
327 print
'<div class="tagtd"> </div>';
333 foreach ($modulesdir as $dir) {
334 $modulenames = array();
338 dol_syslog(
"Scan directory ".$dir.
" for modules");
339 $handle = @opendir($dir);
340 if (is_resource($handle)) {
341 while (($file = readdir($handle)) !==
false) {
342 if (substr($file, 0, 1) <>
'.' && substr($file, 0, 3) <>
'CVS') {
344 if (preg_match(
"/(.*)\.modules\.php$/i", $file, $reg)) {
345 if ($reg[1] ==
'example') {
348 $modulenames[] = $reg[1];
361 foreach ($modulenames as $modulename) {
363 $file = $dir.$modulename.
".modules.php";
364 $classname =
"mailing_".$modulename;
367 $obj =
new $classname($db);
370 $qualified = (is_null($obj->enabled) ? 1 :
dol_eval($obj->enabled, 1));
373 foreach ($obj->require_module as $key) {
374 if (empty($conf->$key->enabled) || (empty($user->admin) && $obj->require_admin)) {
385 if ($allowaddtarget) {
386 print
'<form '.$bctag[$var].
' name="'.$modulename.
'" action="'.$_SERVER[
'PHP_SELF'].
'?action=add&token='.
newToken().
'&id='.$object->id.
'&module='.$modulename.
'" method="POST" enctype="multipart/form-data">';
387 print
'<input type="hidden" name="token" value="'.newToken().
'">';
388 print
'<input type="hidden" name="page_y" value="'.newToken().
'">';
390 print
'<div '.$bctag[$var].
'>';
393 print
'<div class="tagtd">';
394 if (empty($obj->picto)) {
395 $obj->picto =
'generic';
397 print
img_object($langs->trans(
"EmailingTargetSelector").
': '.get_class($obj), $obj->picto,
'class="valignmiddle pictomodule pictofixedwidth"');
399 print $obj->getDesc();
403 $nbofrecipient = $obj->getNbOfRecipients(
'');
408 print
'<div class="tagtd center">';
409 if ($nbofrecipient ===
'' || $nbofrecipient >= 0) {
410 print $nbofrecipient;
412 print $langs->trans(
"Error").
' '.
img_error($obj->error);
416 print
'<div class="tagtd left">';
417 if ($allowaddtarget) {
419 $filter = $obj->formFilter();
426 print $langs->trans(
"None");
431 print
'<div class="tagtd right">';
432 if ($allowaddtarget) {
433 print
'<input type="submit" class="button button-add small reposition" name="button_'.$modulename.
'" value="'.$langs->trans(
"Add").
'">';
435 print
'<input type="submit" class="button small disabled" disabled="disabled" name="button_'.$modulename.
'" value="'.$langs->trans(
"Add").
'">';
441 if ($allowaddtarget) {
450 $parameters = array();
451 $reshook = $hookmanager->executeHooks(
'formObjectOptions', $parameters, $object, $action);
452 print $hookmanager->resPrint;
461 $sql =
"SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.statut, mc.date_envoi, mc.tms,";
462 $sql .=
" mc.source_url, mc.source_id, mc.source_type, mc.error_text";
463 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mailing_cibles as mc";
464 $sql .=
" WHERE mc.fk_mailing=".((int) $object->id);
465 $asearchcriteriahasbeenset = 0;
466 if ($search_lastname) {
468 $asearchcriteriahasbeenset++;
470 if ($search_firstname) {
472 $asearchcriteriahasbeenset++;
476 $asearchcriteriahasbeenset++;
480 $asearchcriteriahasbeenset++;
482 if ($search_dest_status !=
'' && $search_dest_status >= -1) {
483 $sql .=
" AND mc.statut = ".((int) $search_dest_status);
484 $asearchcriteriahasbeenset++;
486 $sql .= $db->order($sortfield, $sortorder);
490 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
491 $result = $db->query($sql);
499 if (empty($asearchcriteriahasbeenset)) {
501 dol_syslog(
"We found a difference in nb of record in target table and the property ->nbemail, we fix ->nbemail");
503 $resultrefresh = $object->refreshNbOfTargets();
504 if ($resultrefresh < 0) {
512 $sql .= $db->plimit($limit + 1, $offset);
514 $resql = $db->query($sql);
516 $num = $db->num_rows(
$resql);
518 $param =
"&id=".$object->id;
520 if ($limit > 0 && $limit != $conf->liste_limit) {
521 $param .=
'&limit='.urlencode($limit);
523 if ($search_lastname) {
524 $param .=
"&search_lastname=".urlencode($search_lastname);
526 if ($search_firstname) {
527 $param .=
"&search_firstname=".urlencode($search_firstname);
530 $param .=
"&search_email=".urlencode($search_email);
533 $param .=
"&search_other=".urlencode($search_other);
536 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
537 print
'<input type="hidden" name="token" value="'.newToken().
'">';
538 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
539 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
540 print
'<input type="hidden" name="page" value="'.$page.
'">';
541 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
543 $morehtmlcenter =
'';
544 if ($allowaddtarget) {
545 $morehtmlcenter =
'<span class="opacitymedium hideonsmartphone">'.$langs->trans(
"ToClearAllRecipientsClickHere").
'</span> <a href="'.$_SERVER[
"PHP_SELF"].
'?clearlist=1&id='.$object->id.
'" class="button reposition smallpaddingimp">'.$langs->trans(
"TargetsReset").
'</a>';
547 $morehtmlcenter .=
' <a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=exportcsv&token='.
newToken().
'&exportcsv=1&id='.$object->id.
'">'.
img_picto(
'',
'download',
'class="pictofixedwidth"').$langs->trans(
"Download").
'</a>';
549 $massactionbutton =
'';
551 print_barre_liste($langs->trans(
"MailSelectedRecipients"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num,
$nbtotalofrecords,
'generic', 0,
'',
'', $limit);
555 print
"\n<!-- Liste destinataires selectionnes -->\n";
556 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
557 print
'<input type="hidden" name="token" value="'.newToken().
'">';
558 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
559 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
560 print
'<input type="hidden" name="page" value="'.$page.
'">';
561 print
'<input type="hidden" name="id" value="'.$object->id.
'">';
562 print
'<input type="hidden" name="limit" value="'.$limit.
'">';
564 print
'<div class="div-table-responsive">';
565 print
'<table class="noborder centpercent">';
568 print
'<tr class="liste_titre_filter">';
570 print
'<td class="liste_titre">';
571 print
'<input class="flat maxwidth75" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).
'">';
574 print
'<td class="liste_titre">';
575 print
'<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).
'">';
578 print
'<td class="liste_titre">';
579 print
'<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).
'">';
582 print
'<td class="liste_titre">';
583 print
'<input class="flat maxwidth100" type="text" name="search_other" value="'.dol_escape_htmltag($search_other).
'">';
586 print
'<td class="liste_titre">';
591 print
'<td class="liste_titre">';
596 print
'<td class="liste_titre">';
601 print
'<td class="liste_titre right">';
602 print $formmailing->selectDestinariesStatus($search_dest_status,
'search_dest_status', 1);
605 print
'<td class="liste_titre maxwidthsearch">';
606 $searchpicto =
$form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0,
'checkforselect', 1);
612 $param .=
"&page=".urlencode($page);
615 print
'<tr class="liste_titre">';
617 print_liste_field_titre(
"Lastname", $_SERVER[
"PHP_SELF"],
"mc.lastname", $param,
"",
"", $sortfield, $sortorder);
618 print_liste_field_titre(
"Firstname", $_SERVER[
"PHP_SELF"],
"mc.firstname", $param,
"",
"", $sortfield, $sortorder);
619 print_liste_field_titre(
"OtherInformations", $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
620 print_liste_field_titre(
"Source", $_SERVER[
"PHP_SELF"],
"", $param,
"",
'align="center"', $sortfield, $sortorder);
622 print_liste_field_titre(
"DateLastModification", $_SERVER[
"PHP_SELF"],
"mc.tms", $param,
"",
'align="center"', $sortfield, $sortorder);
624 print_liste_field_titre(
"DateSending", $_SERVER[
"PHP_SELF"],
"mc.date_envoi", $param,
'',
'align="center"', $sortfield, $sortorder);
625 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"mc.statut", $param,
'',
'class="right"', $sortfield, $sortorder);
632 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
633 include_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
634 include_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
635 include_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
636 include_once DOL_DOCUMENT_ROOT.
'/eventorganization/class/conferenceorboothattendee.class.php';
637 $objectstaticmember =
new Adherent($db);
638 $objectstaticuser =
new User($db);
639 $objectstaticcompany =
new Societe($db);
640 $objectstaticcontact =
new Contact($db);
643 while ($i < min($num, $limit)) {
644 $obj = $db->fetch_object(
$resql);
646 print
'<tr class="oddeven">';
647 print
'<td class="tdoverflowmax150">'.img_picto(
'$obj->email',
'email',
'class="paddingright"').dol_escape_htmltag($obj->email).
'</td>';
648 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).
'">'.
dol_escape_htmltag($obj->lastname).
'</td>';
649 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).
'">'.
dol_escape_htmltag($obj->firstname).
'</td>';
650 print
'<td><span class="small">'.dol_escape_htmltag($obj->other).
'</small></td>';
651 print
'<td class="center tdoverflowmax150">';
652 if (empty($obj->source_id) || empty($obj->source_type)) {
653 print empty($obj->source_url) ?
'' : $obj->source_url;
655 if ($obj->source_type ==
'member') {
656 $objectstaticmember->fetch($obj->source_id);
657 print $objectstaticmember->getNomUrl(1);
658 } elseif ($obj->source_type ==
'user') {
659 $objectstaticuser->fetch($obj->source_id);
660 print $objectstaticuser->getNomUrl(1);
661 } elseif ($obj->source_type ==
'thirdparty') {
662 $objectstaticcompany->fetch($obj->source_id);
663 print $objectstaticcompany->getNomUrl(1);
664 } elseif ($obj->source_type ==
'contact') {
665 $objectstaticcontact->fetch($obj->source_id);
666 print $objectstaticcontact->getNomUrl(1);
667 } elseif ($obj->source_type ==
'eventorganizationattendee') {
668 $objectstaticeventorganization->fetch($obj->source_id);
669 print $objectstaticeventorganization->getNomUrl(1);
671 print $obj->source_url;
677 print
'<td class="center nowraponall">';
682 if ($obj->statut == 0) {
684 print
'<td align="center"></td>';
686 print
'<td class="nowrap right">';
687 print $object::libStatutDest($obj->statut, 2,
'');
691 print
'<td class="center nowraponall">'.$obj->date_envoi.
'</td>';
693 print
'<td class="nowrap right">';
694 print $object::libStatutDest($obj->statut, 2, $obj->error_text);
699 print
'<td class="right">';
700 print
'<!-- ID mailing_cibles = '.$obj->rowid.
' -->';
701 if ($obj->statut == 0) {
702 if (!empty($user->rights->mailing->creer) && $allowaddtarget) {
703 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=delete&token='.
newToken().
'&rowid='.$obj->rowid.$param.
'">'.
img_delete($langs->trans(
"RemoveRecipient")).
'</a>';
716 if ($object->statut < 2) {
717 print
'<tr><td colspan="9" class="opacitymedium">';
718 print $langs->trans(
"NoTargetYet");
722 print
"</table><br>";
732 print
"\n<!-- Fin liste destinataires selectionnes -->\n";
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
static getArrayAddress($address)
Return a formatted array of address string for SMTP protocol.
Class for ConferenceOrBoothAttendee.
Class to manage emailings module.
Parent class of emailing target selectors modules.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
emailing_prepare_head(Mailing $object)
Prepare array with list of tabs.
dolGetModulesDirs($subdir='')
Return list of modules directories.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link formatted for HTML output.
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_error($titlealt='default')
Show error logo.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.