dolibarr  9.0.0
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
6  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
8  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
9  * Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array('contracts', 'products', 'companies', 'compta'));
40 
41 $action=GETPOST('action','alpha');
42 $massaction=GETPOST('massaction','alpha');
43 $show_files=GETPOST('show_files','int');
44 $confirm=GETPOST('confirm','alpha');
45 $toselect = GETPOST('toselect', 'array');
46 $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
47 
48 $search_name=GETPOST('search_name');
49 $search_email=GETPOST('search_email');
50 $search_town=GETPOST('search_town','alpha');
51 $search_zip=GETPOST('search_zip','alpha');
52 $search_state=trim(GETPOST("search_state"));
53 $search_country=GETPOST("search_country",'int');
54 $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
55 $search_contract=GETPOST('search_contract');
56 $search_ref_customer=GETPOST('search_ref_customer','alpha');
57 $search_ref_supplier=GETPOST('search_ref_supplier','alpha');
58 $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
59 $search_status=GETPOST('search_status');
60 $socid=GETPOST('socid');
61 $search_user=GETPOST('search_user','int');
62 $search_sale=GETPOST('search_sale','int');
63 $search_product_category=GETPOST('search_product_category','int');
64 $search_dfmonth=GETPOST('search_dfmonth','int');
65 $search_dfyear=GETPOST('search_dfyear','int');
66 $search_op2df=GETPOST('search_op2df','alpha');
67 $day=GETPOST("day","int");
68 $year=GETPOST("year","int");
69 $month=GETPOST("month","int");
70 
71 $optioncss = GETPOST('optioncss','alpha');
72 
73 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
74 $sortfield = GETPOST("sortfield",'alpha');
75 $sortorder = GETPOST("sortorder",'alpha');
76 $page = GETPOST("page",'int');
77 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
78 $offset = $limit * $page;
79 $pageprev = $page - 1;
80 $pagenext = $page + 1;
81 if (! $sortfield) $sortfield='c.ref';
82 if (! $sortorder) $sortorder='DESC';
83 
84 // Security check
85 $id=GETPOST('id','int');
86 if ($user->societe_id) $socid=$user->societe_id;
87 $result = restrictedArea($user, 'contrat', $id);
88 
89 $diroutputmassaction=$conf->contrat->dir_output . '/temp/massgeneration/'.$user->id;
90 
91 $staticcontrat=new Contrat($db);
92 $staticcontratligne=new ContratLigne($db);
93 
94 if ($search_status == '') $search_status=1;
95 
96 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
97 $object = new Contrat($db);
98 $hookmanager->initHooks(array('contractlist'));
99 $extrafields = new ExtraFields($db);
100 
101 // fetch optionals attributes and labels
102 $extralabels = $extrafields->fetch_name_optionals_label('contrat');
103 $search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_');
104 // List of fields to search into when doing a "search in all"
105 $fieldstosearchall = array(
106  'c.ref'=>'Ref',
107  'c.ref_customer'=>'RefCustomer',
108  'c.ref_supplier'=>'RefSupplier',
109  's.nom'=>"ThirdParty",
110  'c.note_public'=>'NotePublic',
111 );
112 if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate";
113 
114 $arrayfields=array(
115  'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
116  'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
117  'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1),
118  's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
119  's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0),
120  's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
121  's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
122  'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
123  'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
124  'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
125  'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
126  'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
127  'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
128  'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900, 'help'=>$langs->trans("LowerDateEndPlannedShort")),
129  'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
130 );
131 // Extra fields
132 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
133 {
134  foreach($extrafields->attribute_label as $key => $val)
135  {
136  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]));
137  }
138 }
139 
140 
141 /*
142  * Action
143  */
144 
145 if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
146 if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
147 
148 $parameters=array('socid'=>$socid);
149 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
150 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
151 
152 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
153 
154 // Purge search criteria
155 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
156 {
157  $day='';
158  $month='';
159  $year='';
160  $search_dfmonth='';
161  $search_dfyear='';
162  $search_op2df='';
163  $search_name="";
164  $search_email="";
165  $search_town='';
166  $search_zip="";
167  $search_state="";
168  $search_type='';
169  $search_country='';
170  $search_contract="";
171  $search_ref_customer="";
172  $search_ref_supplier="";
173  $search_user='';
174  $search_sale='';
175  $search_product_category='';
176  $sall="";
177  $search_status="";
178  $toselect='';
179  $search_array_options=array();
180 }
181 
182 if (empty($reshook))
183 {
184  $objectclass='Contrat';
185  $objectlabel='Contracts';
186  $permtoread = $user->rights->contrat->lire;
187  $permtodelete = $user->rights->contrat->supprimer;
188  $uploaddir = $conf->contrat->dir_output;
189  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
190 }
191 
192 
193 /*
194  * View
195  */
196 
197 $now=dol_now();
198 $form = new Form($db);
199 $formfile = new FormFile($db);
200 $formother = new FormOther($db);
201 $socstatic = new Societe($db);
202 $contracttmp = new Contrat($db);
203 
204 $sql = 'SELECT';
205 $sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
206 $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
207 $sql.= " typent.code as typent_code,";
208 $sql.= " state.code_departement as state_code, state.nom as state_name,";
209 $sql.= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,";
210 $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
211 $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,';
212 $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
213 $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
214 $sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed';
215 // Add fields from extrafields
216 foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
217 // Add fields from hooks
218 $parameters=array();
219 $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
220 $sql.=$hookmanager->resPrint;
221 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
222 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
223 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
224 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
225 if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
226 $sql.= ", ".MAIN_DB_PREFIX."contrat as c";
227 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contrat_extrafields as ef on (c.rowid = ef.fk_object)";
228 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
229 if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product';
230 if ($search_user > 0)
231 {
232  $sql.=", ".MAIN_DB_PREFIX."element_contact as ec";
233  $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc";
234 }
235 $sql.= " WHERE c.fk_soc = s.rowid ";
236 $sql.= ' AND c.entity IN ('.getEntity('contract').')';
237 if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
238 if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid);
239 if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
240 if ($month > 0)
241 {
242  if ($year > 0 && empty($day))
243  $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
244  else if ($year > 0 && ! empty($day))
245  $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
246  else
247  $sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'";
248 }
249 else if ($year > 0)
250 {
251  $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
252 }
253 if ($search_name) $sql .= natural_search('s.nom', $search_name);
254 if ($search_email) $sql .= natural_search('s.email', $search_email);
255 if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
256 if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
257 if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
258 if ($search_sale > 0)
259 {
260  $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
261 }
262 if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
263 if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
264 // Add where from extra fields
265 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
266 // Add where from hooks
267 $parameters=array();
268 $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
269 $sql.=$hookmanager->resPrint;
270 $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
271 $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
272 $sql.= " typent.code,";
273 $sql.= " state.code_departement, state.nom";
274 // Add fields from extrafields
275 foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
276 // Add where from hooks
277 $parameters=array();
278 $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
279 $sql.=$hookmanager->resPrint;
280 if ($search_dfyear > 0 && $search_op2df)
281 {
282  if ($search_op2df == '<=') $sql.= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") <= '".$db->idate(dol_get_last_day($search_dfyear,$search_dfmonth,false))."'";
283  elseif ($search_op2df == '>=') $sql.= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") >= '".$db->idate(dol_get_first_day($search_dfyear,$search_dfmonth,false))."'";
284  else $sql.= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") <= '".$db->idate(dol_get_last_day($search_dfyear,$search_dfmonth,false))."' AND MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") >= '".$db->idate(dol_get_first_day($search_dfyear,$search_dfmonth,false))."'";
285 }
286 $sql.= $db->order($sortfield,$sortorder);
287 //print $sql;
288 
289 $totalnboflines=0;
290 $result=$db->query($sql);
291 if ($result)
292 {
293  $totalnboflines = $db->num_rows($result);
294 }
295 
296 $nbtotalofrecords = '';
297 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
298 {
299  $result = $db->query($sql);
300  $nbtotalofrecords = $db->num_rows($result);
301  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
302  {
303  $page = 0;
304  $offset = 0;
305  }
306 }
307 
308 $sql.= $db->plimit($limit + 1, $offset);
309 
310 $resql=$db->query($sql);
311 if (! $resql)
312 {
313  dol_print_error($db);
314  exit;
315 }
316 
317 $num = $db->num_rows($resql);
318 
319 // Direct jump if only one record found
320 if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
321 {
322  $obj = $db->fetch_object($resql);
323  $id = $obj->rowid;
324  header("Location: ".DOL_URL_ROOT.'/contrat/card.php?id='.$id);
325  exit;
326 }
327 
328 
329 // Output page
330 // --------------------------------------------------------------------
331 
332 llxHeader('', $langs->trans("Contracts"));
333 
334 $i = 0;
335 
336 $arrayofselected=is_array($toselect)?$toselect:array();
337 
338 if ($socid > 0)
339 {
340  $soc = new Societe($db);
341  $soc->fetch($socid);
342  if (empty($search_name)) $search_name = $soc->name;
343 }
344 
345 $param='';
346 if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
347 if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
348 if ($sall != '') $param.='&sall='.urlencode($sall);
349 if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract);
350 if ($search_name != '') $param.='&search_name='.urlencode($search_name);
351 if ($search_email != '') $param.='&search_email='.urlencode($search_email);
352 if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer);
353 if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier);
354 if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df);
355 if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear);
356 if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth);
357 if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale);
358 if ($search_user != '') $param.='&search_user=' .urlencode($search_user);
359 if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category);
360 if ($show_files) $param.='&show_files=' .urlencode($show_files);
361 if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
362 // Add $param from extra fields
363 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
364 
365 // List of mass actions available
366 $arrayofmassactions = array(
367  'presend'=>$langs->trans("SendByMail"),
368  'builddoc'=>$langs->trans("PDFMerge"),
369 );
370 if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
371 if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
372 $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
373 
374 $newcardbutton='';
375 if ($user->rights->contrat->creer)
376 {
377  $newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewContractSubscription').'</span>';
378  $newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
379  $newcardbutton.= '</a>';
380 }
381 
382 print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
383 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
384 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
385 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
386 print '<input type="hidden" name="action" value="list">';
387 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
388 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
389 print '<input type="hidden" name="page" value="'.$page.'">';
390 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
391 
392 print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, $newcardbutton, '', $limit);
393 
394 $topicmail="SendContractRef";
395 $modelmail="contract";
396 $objecttmp=new Contrat($db);
397 $trackid='con'.$object->id;
398 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
399 
400 if ($sall)
401 {
402  foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
403  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
404 }
405 
406 $moreforfilter='';
407 
408 // If the user can view prospects other than his'
409 if ($user->rights->societe->client->voir || $socid)
410 {
411  $langs->load("commercial");
412  $moreforfilter.='<div class="divsearchfield">';
413  $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
414  $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200');
415  $moreforfilter.='</div>';
416 }
417 // If the user can view other users
418 if ($user->rights->user->user->lire)
419 {
420  $moreforfilter.='<div class="divsearchfield">';
421  $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
422  $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
423  $moreforfilter.='</div>';
424 }
425 // If the user can view categories of products
426 if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
427 {
428  include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
429  $moreforfilter.='<div class="divsearchfield">';
430  $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
431  $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
432  $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
433  $moreforfilter.='</div>';
434 }
435 
436 $parameters=array();
437 $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
438 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
439 else $moreforfilter = $hookmanager->resPrint;
440 
441 if (! empty($moreforfilter))
442 {
443  print '<div class="liste_titre liste_titre_bydiv centpercent">';
444  print $moreforfilter;
445  print '</div>';
446 }
447 
448 $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
449 $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
450 if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
451 
452 print '<div class="div-table-responsive">';
453 print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
454 
455 print '<tr class="liste_titre_filter">';
456 if (! empty($arrayfields['c.ref']['checked']))
457 {
458  print '<td class="liste_titre">';
459  print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
460  print '</td>';
461 }
462 if (! empty($arrayfields['c.ref_customer']['checked']))
463 {
464  print '<td class="liste_titre">';
465  print '<input type="text" class="flat" size="6" name="search_ref_customer" value="'.dol_escape_htmltag($search_ref_customer).'">';
466  print '</td>';
467 }
468 if (! empty($arrayfields['c.ref_supplier']['checked']))
469 {
470  print '<td class="liste_titre">';
471  print '<input type="text" class="flat" size="6" name="search_ref_supplier" value="'.dol_escape_htmltag($search_ref_supplier).'">';
472  print '</td>';
473 }
474 if (! empty($arrayfields['s.nom']['checked']))
475 {
476  print '<td class="liste_titre">';
477  print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
478  print '</td>';
479 }
480 if (! empty($arrayfields['s.email']['checked']))
481 {
482  print '<td class="liste_titre">';
483  print '<input type="text" class="flat" size="6" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
484  print '</td>';
485 }
486 // Town
487 if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
488 // Zip
489 if (! empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
490 // State
491 if (! empty($arrayfields['state.nom']['checked']))
492 {
493  print '<td class="liste_titre">';
494  print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
495  print '</td>';
496 }
497 // Country
498 if (! empty($arrayfields['country.code_iso']['checked']))
499 {
500  print '<td class="liste_titre" align="center">';
501  print $form->select_country($search_country,'search_country','',0,'maxwidth100');
502  print '</td>';
503 }
504 // Company type
505 if (! empty($arrayfields['typent.code']['checked']))
506 {
507  print '<td class="liste_titre maxwidthonsmartphone" align="center">';
508  print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
509  print '</td>';
510 }
511 if (! empty($arrayfields['sale_representative']['checked']))
512 {
513  print '<td class="liste_titre"></td>';
514 }
515 if (! empty($arrayfields['c.date_contrat']['checked']))
516 {
517  // Date contract
518  print '<td class="liste_titre center nowraponall">';
519  //print $langs->trans('Month').': ';
520  if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.$day.'">';
521  print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.$month.'">';
522  //print '&nbsp;'.$langs->trans('Year').': ';
523  $syear = $year;
524  print $formother->selectyear($syear,'year',1, 20, 5);
525  print '</td>';
526 }
527 // Extra fields
528 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
529 
530 // Fields from hook
531 $parameters=array('arrayfields'=>$arrayfields);
532 $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
533 print $hookmanager->resPrint;
534 // Date creation
535 if (! empty($arrayfields['c.datec']['checked']))
536 {
537  print '<td class="liste_titre">';
538  print '</td>';
539 }
540 // Date modification
541 if (! empty($arrayfields['c.tms']['checked']))
542 {
543  print '<td class="liste_titre">';
544  print '</td>';
545 }
546 // First end date
547 if (! empty($arrayfields['lower_planned_end_date']['checked']))
548 {
549  print '<td class="liste_titre nowraponall" align="center">';
550  $arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>=');
551  print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0);
552  print '</br>';
553  print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0, 'valignmiddle');
554  print ' ';
555  $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, '', 'valignmiddle');
556  print '</td>';
557 }
558 // Status
559 if (! empty($arrayfields['status']['checked']))
560 {
561  print '<td class="liste_titre" colspan="4" align="right"></td>';
562 }
563 print '<td class="liste_titre" align="middle">';
564 $searchpicto=$form->showFilterButtons();
565 print $searchpicto;
566 print '</td>';
567 print "</tr>\n";
568 
569 print '<tr class="liste_titre">';
570 if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder);
571 if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
572 if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
573 if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
574 if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder);
575 if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
576 if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
577 if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
578 if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
579 if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
580 if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder);
581 if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
582 // Extra fields
583 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
584 // Hook fields
585 $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
586 $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
587 print $hookmanager->resPrint;
588 if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
589 if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
590 if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
591 if (! empty($arrayfields['status']['checked']))
592 {
593  print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"');
594  print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"');
595  print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"');
596  print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"');
597 }
598 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
599 print "</tr>\n";
600 
601 while ($i < min($num,$limit))
602 {
603  $obj = $db->fetch_object($resql);
604 
605  $contracttmp->ref=$obj->ref;
606  $contracttmp->id=$obj->rowid;
607  $contracttmp->ref_customer=$obj->ref_customer;
608  $contracttmp->ref_supplier=$obj->ref_supplier;
609 
610  if ($obj->socid > 0)
611  {
612  $result=$socstatic->fetch($obj->socid);
613  }
614 
615  print '<tr class="oddeven">';
616  if (! empty($arrayfields['c.ref']['checked']))
617  {
618  print '<td class="nowrap">';
619  print $contracttmp->getNomUrl(1);
620  if ($obj->nb_late) print img_warning($langs->trans("Late"));
621  if (!empty($obj->note_private) || !empty($obj->note_public))
622  {
623  print ' <span class="note">';
624  print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'&save_lastsearch_values=1">'.img_picto($langs->trans("ViewPrivateNote"),'note').'</a>';
625  print '</span>';
626  }
627 
628  $filename=dol_sanitizeFileName($obj->ref);
629  $filedir=$conf->contrat->dir_output . '/' . dol_sanitizeFileName($obj->ref);
630  $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
631  print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir);
632  print '</td>';
633 
634  print '</td>';
635  }
636  if (! empty($arrayfields['c.ref_customer']['checked']))
637  {
638  print '<td>'.$obj->ref_customer.'</td>';
639  }
640  if (! empty($arrayfields['c.ref_supplier']['checked']))
641  {
642  print '<td>'.$obj->ref_supplier.'</td>';
643  }
644  if (! empty($arrayfields['s.nom']['checked']))
645  {
646  print '<td>';
647  //print '<a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a>';
648  if ($obj->socid > 0)
649  {
650  print $socstatic->getNomUrl(1, '');
651  }
652  print '</td>';
653  }
654  if (! empty($arrayfields['s.email']['checked']))
655  {
656  print '<td>'.$obj->email.'</td>';
657  }
658  // Town
659  if (! empty($arrayfields['s.town']['checked']))
660  {
661  print '<td class="nocellnopadd">';
662  print $obj->town;
663  print '</td>';
664  if (! $i) $totalarray['nbfield']++;
665  }
666  // Zip
667  if (! empty($arrayfields['s.zip']['checked']))
668  {
669  print '<td class="nocellnopadd">';
670  print $obj->zip;
671  print '</td>';
672  if (! $i) $totalarray['nbfield']++;
673  }
674  // State
675  if (! empty($arrayfields['state.nom']['checked']))
676  {
677  print "<td>".$obj->state_name."</td>\n";
678  if (! $i) $totalarray['nbfield']++;
679  }
680  // Country
681  if (! empty($arrayfields['country.code_iso']['checked']))
682  {
683  print '<td align="center">';
684  $tmparray=getCountry($obj->fk_pays,'all');
685  print $tmparray['label'];
686  print '</td>';
687  if (! $i) $totalarray['nbfield']++;
688  }
689  // Type ent
690  if (! empty($arrayfields['typent.code']['checked']))
691  {
692  print '<td align="center">';
693  if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
694  print $typenArray[$obj->typent_code];
695  print '</td>';
696  if (! $i) $totalarray['nbfield']++;
697  }
698  if (! empty($arrayfields['sale_representative']['checked']))
699  {
700  // Sales representatives
701  print '<td>';
702  if ($obj->socid > 0)
703  {
704  $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user);
705  if ($listsalesrepresentatives < 0) dol_print_error($db);
706  $nbofsalesrepresentative=count($listsalesrepresentatives);
707  if ($nbofsalesrepresentative > 3) // We print only number
708  {
709  print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
710  print $nbofsalesrepresentative;
711  print '</a>';
712  }
713  else if ($nbofsalesrepresentative > 0)
714  {
715  $userstatic=new User($db);
716  $j=0;
717  foreach($listsalesrepresentatives as $val)
718  {
719  $userstatic->id=$val['id'];
720  $userstatic->lastname=$val['lastname'];
721  $userstatic->firstname=$val['firstname'];
722  $userstatic->email=$val['email'];
723  $userstatic->statut=$val['statut'];
724  $userstatic->entity=$val['entity'];
725  $userstatic->photo=$val['photo'];
726 
727  //print '<div class="float">':
728  print $userstatic->getNomUrl(-2);
729  $j++;
730  if ($j < $nbofsalesrepresentative) print ' ';
731  //print '</div>';
732  }
733  }
734  //else print $langs->trans("NoSalesRepresentativeAffected");
735  }
736  else
737  {
738  print '&nbsp';
739  }
740  print '</td>';
741  }
742  // Date
743  if (! empty($arrayfields['c.date_contrat']['checked']))
744  {
745  print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
746  }
747  // Extra fields
748  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
749  // Fields from hook
750  $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
751  $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
752  print $hookmanager->resPrint;
753  // Date creation
754  if (! empty($arrayfields['c.datec']['checked']))
755  {
756  print '<td align="center" class="nowrap">';
757  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
758  print '</td>';
759  if (! $i) $totalarray['nbfield']++;
760  }
761  // Date modification
762  if (! empty($arrayfields['c.tms']['checked']))
763  {
764  print '<td align="center" class="nowrap">';
765  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
766  print '</td>';
767  if (! $i) $totalarray['nbfield']++;
768  }
769  // Date lower end date
770  if (! empty($arrayfields['lower_planned_end_date']['checked']))
771  {
772  print '<td align="center" class="nowrapforall">';
773  print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
774  print '</td>';
775  if (! $i) $totalarray['nbfield']++;
776  }
777  // Status
778  if (! empty($arrayfields['status']['checked']))
779  {
780  print '<td align="center">'.($obj->nb_initial>0?$obj->nb_initial:'').'</td>';
781  print '<td align="center">'.($obj->nb_running>0?$obj->nb_running:'').'</td>';
782  print '<td align="center">'.($obj->nb_expired>0?$obj->nb_expired:'').'</td>';
783  print '<td align="center">'.($obj->nb_closed>0 ?$obj->nb_closed:'').'</td>';
784  }
785  // Action column
786  print '<td class="nowrap" align="center">';
787  if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
788  {
789  $selected=0;
790  if (in_array($obj->rowid, $arrayofselected)) $selected=1;
791  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
792  }
793  print '</td>';
794  if (! $i) $totalarray['nbfield']++;
795 
796  print "</tr>\n";
797  $i++;
798 }
799 $db->free($resql);
800 
801 print '</table>';
802 print '</div>';
803 
804 print '</form>';
805 
806 $hidegeneratedfilelistifempty=1;
807 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0;
808 
809 // Show list of available documents
810 $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
811 $urlsource.=str_replace('&amp;','&',$param);
812 
813 $filedir=$diroutputmassaction;
814 $genallowed=$user->rights->contrat->lire;
815 $delallowed=$user->rights->contrat->lire;
816 
817 print $formfile->showdocuments('massfilesarea_contract','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty);
818 
819 
820 llxFooter();
821 $db->close();
img_warning($titlealt='default', $moreatt='')
Show warning logo.
llxFooter()
Empty footer.
Definition: wrapper.php:56
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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:1053
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
Class to manage Dolibarr users.
Definition: user.class.php:41
Class to manage contracts.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
Classe permettant la gestion des lignes de contrats.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
if(! GETPOST('transkey', 'alphanohtml') &&! GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:43
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
Class to manage third parties objects (customers, suppliers, prospects...)
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:44
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...
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
Definition: list.php:156
dol_now($mode='gmt')
Return date for now.
Class to offer components to list and upload files.
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:467
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)