28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/comm/mailing/class/mailing.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
35$hookmanager->initHooks(array(
'mailingindex'));
38$langs->loadLangs(array(
'commercial',
'orders',
'mails'));
50$help_url =
'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing';
51$title = $langs->trans(
'MailingArea');
59print
'<div class="fichecenter"><div class="fichethirdleft">';
61$titlesearch = $langs->trans(
"SearchAMailing");
63 $titlesearch .=
' | '.$langs->trans(
"smsing");
67print
'<form method="post" action="'.DOL_URL_ROOT.
'/comm/mailing/list.php">';
68print
'<input type="hidden" name="token" value="'.newToken().
'">';
69print
'<div class="div-table-responsive-no-min">';
70print
'<table class="noborder nohover centpercent">';
71print
'<tr class="liste_titre"><td colspan="3">'.$titlesearch.
'</td></tr>';
72print
'<tr class="oddeven"><td class="nowrap">';
73print $langs->trans(
"Ref").
':</td><td><input type="text" class="flat inputsearch" name="sref"></td>';
74print
'<td rowspan="2"><input type="submit" value="'.$langs->trans(
"Search").
'" class="button"></td></tr>';
75print
'<tr class="oddeven"><td class="nowrap">';
76print $langs->trans(
"Other").
':</td><td><input type="text" class="flat inputsearch" name="sall"></td>';
78print
"</table></div></form><br>\n";
84print
'<table class="noborder centpercent">';
85print
'<tr class="liste_titre"><td colspan="2">'.$langs->trans(
"TargetsStatistics").
'</td></tr>';
87$dir = DOL_DOCUMENT_ROOT.
"/core/modules/mailings";
88$handle = opendir($dir);
90if (is_resource($handle)) {
91 while (($file = readdir($handle)) !==
false) {
92 if (substr($file, 0, 1) !=
'.' && substr($file, 0, 3) !=
'CVS') {
93 if (preg_match(
"/(.*)\.(.*)\.(.*)/i", $file, $reg)) {
94 $modulename = $reg[1];
95 if ($modulename ==
'example') {
100 $file = $dir.
"/".$modulename.
".modules.php";
101 $classname =
"mailing_".$modulename;
103 $mailmodule =
new $classname($db);
106 foreach ($mailmodule->require_module as $key) {
107 if (!isModEnabled($key) || (!$user->admin && !empty($mailmodule->require_admin))) {
116 foreach ($mailmodule->getSqlArrayForStats() as $sql) {
117 print
'<tr class="oddeven">';
119 $result = $db->query($sql);
121 $num = $db->num_rows($result);
125 $obj = $db->fetch_object($result);
126 print
'<td>'.img_object(
'', $mailmodule->picto).
' '.
dol_escape_htmltag($obj->label).
'</td>';
127 print
'<td class="right">'.$obj->nb.
'</td>';
148print
'</div><div class="fichetwothirdright">';
155$sql =
"SELECT m.rowid, m.titre as title, m.nbemail, m.statut as status, m.date_creat";
156$sql .=
" FROM ".MAIN_DB_PREFIX.
"mailing as m";
157$sql .=
" WHERE m.entity = ".$conf->entity;
158$sql .=
" ORDER BY m.date_creat DESC";
159$sql .=
" LIMIT ".$limit;
160$result = $db->query($sql);
162 print
'<div class="div-table-responsive-no-min">';
163 print
'<table class="noborder centpercent">';
164 print
'<tr class="liste_titre">';
165 print
'<td colspan="2">'.$langs->trans(
"LastMailings", $limit).
'</td>';
166 print
'<td class="center">'.$langs->trans(
"DateCreation").
'</td>';
167 print
'<td class="center">'.$langs->trans(
"NbOfEMails").
'</td>';
168 print
'<td class="right"><a href="'.DOL_URL_ROOT.
'/comm/mailing/list.php">'.$langs->trans(
"AllEMailings").
'</a></td></tr>';
170 $num = $db->num_rows($result);
175 $obj = $db->fetch_object($result);
176 $mailstatic =
new Mailing($db);
177 $mailstatic->id = $obj->rowid;
178 $mailstatic->ref = $obj->rowid;
180 print
'<tr class="oddeven">';
181 print
'<td class="nowrap">'.$mailstatic->getNomUrl(1).
'</td>';
182 print
'<td>'.(!empty($obj->title) ?
dol_trunc($obj->title, 38) :
'').
'</td>';
183 print
'<td class="center">'.dol_print_date($db->jdate($obj->date_creat),
'day').
'</td>';
184 print
'<td class="center">'.($obj->nbemail ? $obj->nbemail :
"0").
'</td>';
185 print
'<td class="right">'.$mailstatic->LibStatut($obj->status, 5).
'</td>';
190 print
'<tr><td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
192 print
"</table></div><br>";
202$parameters = array(
'user' => $user);
203$reshook = $hookmanager->executeHooks(
'dashboardEmailings', $parameters, $object);
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage emailings module.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.