dolibarr  7.0.0-beta
mails_senderprofile_list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
24 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
25 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
26 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
27 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
28 //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test
29 //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
30 //if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on.
31 //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
32 //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
33 //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
34 //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
35 //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not load ajax.lib.php library
36 //if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
37 
38 
39 require '../main.inc.php';
40 require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
41 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
42 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
43 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
44 require_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
45 
46 // Load traductions files requiredby by page
47 $langs->loadLangs(array("errors","admin","mails","languages"));
48 
49 $action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
50 $massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
51 $show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ?
52 $confirm = GETPOST('confirm','alpha'); // Result of a confirmation
53 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
54 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
55 $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailsenderprofilelist'; // To manage different context of search
56 $backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
57 $optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
58 
59 $id = GETPOST('id','int');
60 
61 // Load variable for pagination
62 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
63 $sortfield = GETPOST('sortfield','alpha');
64 $sortorder = GETPOST('sortorder','alpha');
65 $page = GETPOST('page','int');
66 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
67 $offset = $limit * $page;
68 $pageprev = $page - 1;
69 $pagenext = $page + 1;
70 
71 // Initialize technical objects
72 $object=new EmailSenderProfile($db);
73 $extrafields = new ExtraFields($db);
74 $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->id;
75 $hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array
76 // Fetch optionals attributes and labels
77 $extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile');
78 $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
79 
80 // Default sort order (if not yet defined by previous GETPOST)
81 if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition.
82 if (! $sortorder) $sortorder="ASC";
83 
84 // Protection if external user
85 $socid=0;
86 if ($user->societe_id > 0)
87 {
88  //$socid = $user->societe_id;
90 }
91 
92 // Initialize array of search criterias
93 $search_all=trim(GETPOST("search_all",'alpha'));
94 $search=array();
95 foreach($object->fields as $key => $val)
96 {
97  if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
98 }
99 
100 // List of fields to search into when doing a "search in all"
101 $fieldstosearchall = array();
102 foreach($object->fields as $key => $val)
103 {
104  if ($val['searchall']) $fieldstosearchall['t.'.$key]=$val['label'];
105 }
106 
107 // Definition of fields for list
108 $arrayfields=array();
109 foreach($object->fields as $key => $val)
110 {
111  // If $val['visible']==0, then we never show the field
112  if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
113 }
114 // Extra fields
115 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
116 {
117  foreach($extrafields->attribute_label as $key => $val)
118  {
119  if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
120  }
121 }
122 
123 
124 
125 
126 /*
127  * Actions
128  */
129 
130 if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
131 if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
132 
133 $parameters=array();
134 $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
135 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
136 
137 if (empty($reshook))
138 {
139  // Selection of new fields
140  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
141 
142  // Purge search criteria
143  if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
144  {
145  foreach($object->fields as $key => $val)
146  {
147  $search[$key]='';
148  }
149  $toselect='';
150  $search_array_options=array();
151  }
152  if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
153  || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
154  {
155  $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
156  }
157 
158  // Mass actions
159  $objectclass='EmailSenderProfile';
160  $objectlabel='EmailSenderProfile';
161  $permtoread = $user->admin;
162  $permtodelete = $user->admin;
163  $uploaddir = $conf->admin->dir_output.'/senderprofiles';
164  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
165 }
166 
167 
168 
169 /*
170  * View
171  */
172 
173 $form=new Form($db);
174 
175 $now=dol_now();
176 
177 //$help_url="EN:Module_EmailSenderProfile|FR:Module_EmailSenderProfile_FR|ES:Módulo_EmailSenderProfile";
178 $help_url='';
179 $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailSenderProfiles"));
180 
181 
182 llxHeader();
183 
184 $titre=$langs->trans("EMailsSetup");
185 $linkback='';
186 $titlepicto='title_setup';
187 
188 print load_fiche_titre($titre,$linkback,$titlepicto);
189 
190 $head = email_admin_prepare_head();
191 
192 dol_fiche_head($head, 'senderprofiles', '', -1);
193 
194 // Build and execute select
195 // --------------------------------------------------------------------
196 $sql = 'SELECT ';
197 foreach($object->fields as $key => $val)
198 {
199  $sql.='t.'.$key.', ';
200 }
201 // Add fields from extrafields
202 foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
203 // Add fields from hooks
204 $parameters=array();
205 $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
206 $sql.=$hookmanager->resPrint;
207 $sql=preg_replace('/, $/','', $sql);
208 $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
209 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
210 if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")";
211 else $sql.=" WHERE 1 = 1";
212 foreach($search as $key => $val)
213 {
214  $mode_search=(($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))?1:0);
215  if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'status')?2:$mode_search));
216 }
217 if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all);
218 // Add where from extra fields
219 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
220 // Add where from hooks
221 $parameters=array();
222 $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
223 $sql.=$hookmanager->resPrint;
224 
225 /* If a group by is required
226 $sql.= " GROUP BY "
227 foreach($object->fields as $key => $val)
228 {
229  $sql.='t.'.$key.', ';
230 }
231 // Add fields from extrafields
232 foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
233 // Add where from hooks
234 $parameters=array();
235 $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
236 $sql.=$hookmanager->resPrint;
237 */
238 
239 $sql.=$db->order($sortfield,$sortorder);
240 
241 // Count total nb of records
242 $nbtotalofrecords = '';
243 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
244 {
245  $result = $db->query($sql);
246  $nbtotalofrecords = $db->num_rows($result);
247 }
248 
249 $sql.= $db->plimit($limit+1, $offset);
250 
251 $resql=$db->query($sql);
252 if (! $resql)
253 {
254  dol_print_error($db);
255  exit;
256 }
257 
258 $num = $db->num_rows($resql);
259 
260 // Direct jump if only one record found
261 if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
262 {
263  $obj = $db->fetch_object($resql);
264  $id = $obj->rowid;
265  header("Location: ".DOL_URL_ROOT.'/monmodule/emailsenderprofile_card.php?id='.$id);
266  exit;
267 }
268 
269 
270 // Example : Adding jquery code
271 print '<script type="text/javascript" language="javascript">
272 jQuery(document).ready(function() {
273  function init_myfunc()
274  {
275  jQuery("#myid").removeAttr(\'disabled\');
276  jQuery("#myid").attr(\'disabled\',\'disabled\');
277  }
278  init_myfunc();
279  jQuery("#mybutton").click(function() {
280  init_myfunc();
281  });
282 });
283 </script>';
284 
285 $arrayofselected=is_array($toselect)?$toselect:array();
286 
287 $param='';
288 if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
289 if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
290 foreach($search as $key => $val)
291 {
292  $param.= '&search_'.$key.'='.urlencode($search[$key]);
293 }
294 if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
295 // Add $param from extra fields
296 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
297 
298 // List of mass actions available
299 $arrayofmassactions = array(
300  //'presend'=>$langs->trans("SendByMail"),
301  //'builddoc'=>$langs->trans("PDFMerge"),
302 );
303 if ($user->rights->monmodule->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
304 if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
305 $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
306 
307 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
308 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
309 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
310 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
311 print '<input type="hidden" name="action" value="list">';
312 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
313 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
314 print '<input type="hidden" name="page" value="'.$page.'">';
315 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
316 
317 //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
318 
319 $topicmail="Information";
320 //$modelmail="subscription";
321 $objecttmp=new EmailSenderProfile($db);
322 //$trackid='sub'.$object->id;
323 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
324 
325 $moreforfilter = '';
326 /*$moreforfilter.='<div class="divsearchfield">';
327 $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
328 $moreforfilter.= '</div>';*/
329 
330 $parameters=array();
331 $reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
332 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
333 else $moreforfilter = $hookmanager->resPrint;
334 
335 if (! empty($moreforfilter))
336 {
337  print '<div class="liste_titre liste_titre_bydiv centpercent">';
338  print $moreforfilter;
339  print '</div>';
340 }
341 
342 $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
343 $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
344 $selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
345 
346 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
347 print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
348 
349 
350 // Fields title search
351 // --------------------------------------------------------------------
352 print '<tr class="liste_titre">';
353 foreach($object->fields as $key => $val)
354 {
355  $align='';
356  if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
357  if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
358  if ($key == 'status') $align.=($align?' ':'').'center';
359  if (! empty($arrayfields['t.'.$key]['checked'])) print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
360 }
361 // Extra fields
362 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
363 // Fields from hook
364 $parameters=array('arrayfields'=>$arrayfields);
365 $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
366 print $hookmanager->resPrint;
367 // Action column
368 print '<td class="liste_titre" align="right">';
369 $searchpicto=$form->showFilterButtons();
370 print $searchpicto;
371 print '</td>';
372 print '</tr>'."\n";
373 
374 
375 // Fields title label
376 // --------------------------------------------------------------------
377 print '<tr class="liste_titre">';
378 foreach($object->fields as $key => $val)
379 {
380  $align='';
381  if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
382  if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
383  if ($key == 'status') $align.=($align?' ':'').'center';
384  if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
385 }
386 // Extra fields
387 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
388 
389 // Hook fields
390 $parameters=array('arrayfields'=>$arrayfields);
391 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
392 print $hookmanager->resPrint;
393 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
394 print '</tr>'."\n";
395 
396 
397 // Detect if we need a fetch on each output line
398 $needToFetchEachLine=0;
399 foreach ($extrafields->attribute_computed as $key => $val)
400 {
401  if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object
402 }
403 
404 
405 // Loop on record
406 // --------------------------------------------------------------------
407 $i=0;
408 $totalarray=array();
409 while ($i < min($num, $limit))
410 {
411  $obj = $db->fetch_object($resql);
412  if (empty($obj)) break; // Should not happen
413 
414  // Store properties in $object
415  $object->id = $obj->rowid;
416  foreach($object->fields as $key => $val)
417  {
418  if (isset($obj->$key)) $object->$key = $obj->$key;
419  }
420 
421  // Show here line of result
422  print '<tr class="oddeven">';
423  foreach($object->fields as $key => $val)
424  {
425  $align='';
426  if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
427  if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
428  if ($key == 'status') $align.=($align?' ':'').'center';
429  if (! empty($arrayfields['t.'.$key]['checked']))
430  {
431  print '<td';
432  if ($align) print ' class="'.$align.'"';
433  print '>';
434  print $object->showOutputField($val, $key, $obj->$key, '');
435  print '</td>';
436  if (! $i) $totalarray['nbfield']++;
437  if (! empty($val['isameasure']))
438  {
439  if (! $i) $totalarray['pos'][$totalarray['nbfield']]='t.'.$key;
440  $totalarray['val']['t.'.$key] += $obj->$key;
441  }
442  }
443  }
444  // Extra fields
445  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
446  // Fields from hook
447  $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
448  $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
449  print $hookmanager->resPrint;
450  // Action column
451  print '<td class="nowrap" align="center">';
452  if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
453  {
454  $selected=0;
455  if (in_array($obj->rowid, $arrayofselected)) $selected=1;
456  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
457  }
458  print '</td>';
459  if (! $i) $totalarray['nbfield']++;
460 
461  print '</tr>';
462 
463  $i++;
464 }
465 
466 // Show total line
467 if (isset($totalarray['pos']))
468 {
469  print '<tr class="liste_total">';
470  $i=0;
471  while ($i < $totalarray['nbfield'])
472  {
473  $i++;
474  if (! empty($totalarray['pos'][$i])) print '<td align="right">'.price($totalarray['val'][$totalarray['pos'][$i]]).'</td>';
475  else
476  {
477  if ($i == 1)
478  {
479  if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
480  else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
481  }
482  else print '<td></td>';
483  }
484  }
485  print '</tr>';
486 }
487 
488 // If no record found
489 if ($num == 0)
490 {
491  $colspan=1;
492  foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
493  print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
494 }
495 
496 
497 $db->free($resql);
498 
499 $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
500 $reshook=$hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
501 print $hookmanager->resPrint;
502 
503 print '</table>'."\n";
504 print '</div>'."\n";
505 
506 print '</form>'."\n";
507 
508 if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords))
509 {
510  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
511  {
512  require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php');
513  $formfile = new FormFile($db);
514 
515  // Show list of available documents
516  $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
517  $urlsource.=str_replace('&amp;','&',$param);
518 
519  $filedir=$diroutputmassaction;
520  $genallowed=$user->rights->monmodule->read;
521  $delallowed=$user->rights->monmodule->create;
522 
523  print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
524  }
525  else
526  {
527  print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
528  }
529 }
530 
531 dol_fiche_end();
532 
533 // End of page
534 llxFooter();
535 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
email_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: admin.lib.php:1600
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='')
Get title line of an array.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
dol_fiche_end($notab=0)
Show tab footer of a card.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
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...
dol_now($mode='gmt')
Return date for now.
Class to offer components to list and upload files.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
print
Draft customers invoices.
Definition: index.php:91
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
Class for EmailSenderProfile.