month_report.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <?php
  2. /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2011 François Legastelois <flegastelois@teclib.com>
  4. * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
  5. * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file month_report.php
  22. * \ingroup holiday
  23. * \brief Monthly report of leave requests.
  24. */
  25. // Load Dolibarr environment
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  32. // Load translation files required by the page
  33. $langs->loadLangs(array('holiday', 'hrm'));
  34. $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
  35. $massaction = GETPOST('massaction', 'alpha');
  36. $contextpage = GETPOST('contextpage', 'aZ');
  37. $optioncss = GETPOST('optioncss', 'aZ');
  38. $socid = 0;
  39. $id = GETPOST('id', 'int');
  40. $search_ref = GETPOST('search_ref', 'alphanohtml');
  41. $search_employee = GETPOST('search_employee', 'int');
  42. $search_type = GETPOST('search_type', 'int');
  43. $search_description = GETPOST('search_description', 'alphanohtml');
  44. $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
  45. $sortfield = GETPOST('sortfield', 'aZ09comma');
  46. $sortorder = GETPOST('sortorder', 'aZ09comma');
  47. if (!$sortfield) {
  48. $sortfield = "cp.rowid";
  49. }
  50. if (!$sortorder) {
  51. $sortorder = "ASC";
  52. }
  53. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  54. if (empty($page) || $page == -1) {
  55. $page = 0;
  56. }
  57. $hookmanager->initHooks(array('leavemovementlist'));
  58. $arrayfields = array();
  59. $arrayofmassactions = array();
  60. // Security check
  61. if ($user->socid > 0) { // Protection if external user
  62. //$socid = $user->socid;
  63. accessforbidden();
  64. }
  65. $result = restrictedArea($user, 'holiday', $id, '');
  66. /*
  67. * Actions
  68. */
  69. if (GETPOST('cancel', 'alpha')) {
  70. $action = 'list';
  71. $massaction = '';
  72. }
  73. if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
  74. $massaction = '';
  75. }
  76. $parameters = array();
  77. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  78. if ($reshook < 0) {
  79. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  80. }
  81. if (empty($reshook)) {
  82. // Selection of new fields
  83. include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
  84. // Purge search criteria
  85. 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
  86. $search_ref = '';
  87. $search_employee = '';
  88. $search_type = '';
  89. $search_description = '';
  90. $toselect = array();
  91. $search_array_options = array();
  92. }
  93. if (GETPOST('button_removefilter_x', 'alpha')
  94. || GETPOST('button_removefilter.x', 'alpha')
  95. || GETPOST('button_removefilter', 'alpha')
  96. || GETPOST('button_search_x', 'alpha')
  97. || GETPOST('button_search.x', 'alpha')
  98. || GETPOST('button_search', 'alpha')) {
  99. $massaction = '';
  100. }
  101. }
  102. $arrayfields = array(
  103. 'cp.ref'=>array('label' => 'Ref', 'checked'=>1, 'position'=>5),
  104. 'cp.fk_type'=>array('label' => 'Type', 'checked'=>1, 'position'=>10),
  105. 'cp.fk_user'=>array('label' => 'Employee', 'checked'=>1, 'position'=>20),
  106. 'cp.date_debut'=>array('label' => 'DateDebCP', 'checked'=>-1, 'position'=>30),
  107. 'cp.date_fin'=>array('label' => 'DateFinCP', 'checked'=>-1, 'position'=>32),
  108. 'used_days'=>array('label' => 'NbUseDaysCPShort', 'checked'=>-1, 'position'=>34),
  109. 'date_start_month'=>array('label' => 'DateStartInMonth', 'checked'=>1, 'position'=>50),
  110. 'date_end_month'=>array('label' => 'DateEndInMonth', 'checked'=>1, 'position'=>52),
  111. 'used_days_month'=>array('label' => 'NbUseDaysCPShortInMonth', 'checked'=>1, 'position'=>54),
  112. 'cp.description'=>array('label' => 'DescCP', 'checked'=>-1, 'position'=>800),
  113. );
  114. /*
  115. * View
  116. */
  117. $form = new Form($db);
  118. $formother = new FormOther($db);
  119. $holidaystatic = new Holiday($db);
  120. $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
  121. $title = $langs->trans('CPTitreMenu');
  122. llxHeader('', $title);
  123. $search_month = GETPOST("remonth", 'int') ? GETPOST("remonth", 'int') : date("m", time());
  124. $search_year = GETPOST("reyear", 'int') ? GETPOST("reyear", 'int') : date("Y", time());
  125. $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
  126. $sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status";
  127. $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
  128. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
  129. $sql .= " WHERE cp.rowid > 0";
  130. $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
  131. $sql .= " AND (";
  132. $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
  133. $sql .= " OR"; // For leave over several months
  134. $sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
  135. $sql .= " )";
  136. if (!empty($search_ref)) {
  137. $sql .= natural_search('cp.ref', $search_ref);
  138. }
  139. if (!empty($search_employee) && $search_employee > 0) {
  140. $sql .= " AND cp.fk_user = ".((int) $search_employee);
  141. }
  142. if (!empty($search_type) && $search_type != '-1') {
  143. $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')';
  144. }
  145. if (!empty($search_description)) {
  146. $sql .= natural_search('cp.description', $search_description);
  147. }
  148. $sql .= $db->order($sortfield, $sortorder);
  149. $resql = $db->query($sql);
  150. if (empty($resql)) {
  151. dol_print_error($db);
  152. exit;
  153. }
  154. $num = $db->num_rows($resql);
  155. $param = '';
  156. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  157. $param .= '&contextpage='.urlencode($contextpage);
  158. }
  159. if ($limit > 0 && $limit != $conf->liste_limit) {
  160. $param .= '&limit='.((int) $limit);
  161. }
  162. if (!empty($search_ref)) {
  163. $param .= '&search_ref='.urlencode($search_ref);
  164. }
  165. if (!empty($search_employee)) {
  166. $param .= '&search_employee='.urlencode($search_employee);
  167. }
  168. if (!empty($search_type)) {
  169. $param .= '&search_type='.urlencode($search_type);
  170. }
  171. if (!empty($search_description)) {
  172. $param .= '&search_description='.urlencode($search_description);
  173. }
  174. print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
  175. if ($optioncss != '') {
  176. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  177. }
  178. print '<input type="hidden" name="token" value="'.newToken().'">';
  179. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  180. print '<input type="hidden" name="action" value="list">';
  181. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  182. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  183. print '<input type="hidden" name="page" value="'.$page.'">';
  184. print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
  185. print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
  186. // Selection filter
  187. print '<div class="tabBar">';
  188. print $formother->select_month($search_month, 'remonth', 0, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
  189. print $formother->selectyear($search_year, 'reyear', 0, 10, 5, 0, 0, '', 'valignmiddle width75', true);
  190. print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Search")).'" />';
  191. print '</div>';
  192. print '<br>';
  193. $moreforfilter = '';
  194. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  195. $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
  196. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  197. print '<div class="div-table-responsive">';
  198. print '<table class="tagtable nobottomiftotal liste">';
  199. print '<tr class="liste_titre_filter">';
  200. // Action column
  201. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  202. print '<th class="wrapcolumntitle center maxwidthsearch liste_titre">';
  203. $searchpicto = $form->showFilterButtons('left');
  204. print $searchpicto;
  205. print '</th>';
  206. }
  207. // Filter: Ref
  208. if (!empty($arrayfields['cp.ref']['checked'])) {
  209. print '<th class="liste_titre">';
  210. print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
  211. print '</th>';
  212. }
  213. // Filter: Type
  214. if (!empty($arrayfields['cp.fk_type']['checked'])) {
  215. $typeleaves = $holidaystatic->getTypes(1, -1);
  216. $arraytypeleaves = array();
  217. foreach ($typeleaves as $key => $val) {
  218. $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
  219. $arraytypeleaves[$val['rowid']] = $labeltoshow;
  220. }
  221. print '<th class="liste_titre">';
  222. print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
  223. print '</th>';
  224. }
  225. // Filter: Employee
  226. if (!empty($arrayfields['cp.fk_user']['checked'])) {
  227. print '<th class="liste_titre">';
  228. print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth100');
  229. print '</th>';
  230. }
  231. if (!empty($arrayfields['cp.date_debut']['checked'])) {
  232. print '<th class="liste_titre"></th>';
  233. }
  234. if (!empty($arrayfields['cp.date_fin']['checked'])) {
  235. print '<th class="liste_titre"></th>';
  236. }
  237. if (!empty($arrayfields['used_days']['checked'])) {
  238. print '<th class="liste_titre"></th>';
  239. }
  240. if (!empty($arrayfields['date_start_month']['checked'])) {
  241. print '<th class="liste_titre"></th>';
  242. }
  243. if (!empty($arrayfields['date_end_month']['checked'])) {
  244. print '<th class="liste_titre"></th>';
  245. }
  246. if (!empty($arrayfields['used_days_month']['checked'])) {
  247. print '<th class="liste_titre"></th>';
  248. }
  249. // Filter: Description
  250. if (!empty($arrayfields['cp.description']['checked'])) {
  251. print '<th class="liste_titre">';
  252. print '<input type="text" class="maxwidth100" name="search_description" value="'.$search_description.'">';
  253. print '</th>';
  254. }
  255. // Action column
  256. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  257. print '<th class="liste_titre maxwidthsearch">';
  258. $searchpicto = $form->showFilterButtons();
  259. print $searchpicto;
  260. print '</th>';
  261. }
  262. print '</tr>';
  263. print '<tr class="liste_titre">';
  264. // Action column
  265. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  266. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  267. }
  268. if (!empty($arrayfields['cp.ref']['checked'])) {
  269. print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder);
  270. }
  271. if (!empty($arrayfields['cp.fk_type']['checked'])) {
  272. print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
  273. }
  274. if (!empty($arrayfields['cp.fk_user']['checked'])) {
  275. print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'u.lastname', '', '', '', $sortfield, $sortorder);
  276. }
  277. if (!empty($arrayfields['ct.label']['checked'])) {
  278. print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
  279. }
  280. if (!empty($arrayfields['cp.date_debut']['checked'])) {
  281. print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', '', '', $sortfield, $sortorder, 'center ');
  282. }
  283. if (!empty($arrayfields['cp.date_fin']['checked'])) {
  284. print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', '', '', $sortfield, $sortorder, 'center ');
  285. }
  286. if (!empty($arrayfields['used_days']['checked'])) {
  287. print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
  288. }
  289. if (!empty($arrayfields['date_start_month']['checked'])) {
  290. print_liste_field_titre($arrayfields['date_start_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
  291. }
  292. if (!empty($arrayfields['date_end_month']['checked'])) {
  293. print_liste_field_titre($arrayfields['date_end_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
  294. }
  295. if (!empty($arrayfields['used_days_month']['checked'])) {
  296. print_liste_field_titre($arrayfields['used_days_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
  297. }
  298. if (!empty($arrayfields['cp.description']['checked'])) {
  299. print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', '', '', $sortfield, $sortorder);
  300. }
  301. // Action column
  302. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  303. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  304. }
  305. print '</tr>';
  306. if ($num == 0) {
  307. print '<tr><td colspan="11"><span class="opacitymedium">'.$langs->trans('None').'</span></td></tr>';
  308. } else {
  309. $tmpuser = new User($db);
  310. while ($obj = $db->fetch_object($resql)) {
  311. $tmpuser->fetch($obj->fk_user);
  312. $date_start = $db->jdate($obj->date_debut, true);
  313. $date_end = $db->jdate($obj->date_fin, true);
  314. $tmpstart = dol_getdate($date_start);
  315. $tmpend = dol_getdate($date_end);
  316. $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
  317. $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
  318. $halfdayinmonth = $obj->halfday;
  319. $starthalfdayinmonth = $starthalfday;
  320. $endhalfdayinmonth = $endhalfday;
  321. //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
  322. // Set date_start_gmt and date_end_gmt that are date to show for the selected month
  323. $date_start_inmonth = $db->jdate($obj->date_debut, true);
  324. $date_end_inmonth = $db->jdate($obj->date_fin, true);
  325. if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month) {
  326. $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
  327. $starthalfdayinmonth = 'morning';
  328. if ($halfdayinmonth == 2) {
  329. $halfdayinmonth = 1;
  330. }
  331. if ($halfdayinmonth == -1) {
  332. $halfdayinmonth = 0;
  333. }
  334. }
  335. if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month) {
  336. $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
  337. $endhalfdayinmonth = 'afternoon';
  338. if ($halfdayinmonth == 2) {
  339. $halfdayinmonth = -1;
  340. }
  341. if ($halfdayinmonth == 1) {
  342. $halfdayinmonth = 0;
  343. }
  344. }
  345. // Leave request
  346. $holidaystatic->id = $obj->rowid;
  347. $holidaystatic->ref = $obj->ref;
  348. $holidaystatic->statut = $obj->status;
  349. $holidaystatic->status = $obj->status;
  350. $holidaystatic->fk_user = $obj->fk_user;
  351. $holidaystatic->fk_type = $obj->fk_type;
  352. $holidaystatic->description = $obj->description;
  353. $holidaystatic->halfday = $obj->halfday;
  354. $holidaystatic->date_debut = $db->jdate($obj->date_debut);
  355. $holidaystatic->date_fin = $db->jdate($obj->date_fin);
  356. print '<tr class="oddeven">';
  357. // Action column
  358. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  359. print '<td></td>';
  360. }
  361. if (!empty($arrayfields['cp.ref']['checked'])) {
  362. print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1, 1).'</td>';
  363. }
  364. if (!empty($arrayfields['cp.fk_type']['checked'])) {
  365. print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
  366. }
  367. if (!empty($arrayfields['cp.fk_user']['checked'])) {
  368. print '<td class="tdoverflowmax150">'.$tmpuser->getNomUrl(-1).'</td>';
  369. }
  370. if (!empty($arrayfields['cp.date_debut']['checked'])) {
  371. print '<td class="center">'.dol_print_date($db->jdate($obj->date_debut), 'day');
  372. print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
  373. print '</td>';
  374. }
  375. if (!empty($arrayfields['cp.date_fin']['checked'])) {
  376. print '<td class="center">'.dol_print_date($db->jdate($obj->date_fin), 'day');
  377. print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
  378. print '</td>';
  379. }
  380. if (!empty($arrayfields['used_days']['checked'])) {
  381. print '<td class="right">'.num_open_day($date_start, $date_end, 0, 1, $obj->halfday).'</td>';
  382. }
  383. if (!empty($arrayfields['date_start_month']['checked'])) {
  384. print '<td class="center">'.dol_print_date($date_start_inmonth, 'day');
  385. print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
  386. print '</td>';
  387. }
  388. if (!empty($arrayfields['date_end_month']['checked'])) {
  389. print '<td class="center">'.dol_print_date($date_end_inmonth, 'day');
  390. print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
  391. print '</td>';
  392. }
  393. if (!empty($arrayfields['used_days_month']['checked'])) {
  394. print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
  395. }
  396. if (!empty($arrayfields['cp.description']['checked'])) {
  397. print '<td class="maxwidth300 small">';
  398. print '<div class="twolinesmax">';
  399. print dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1));
  400. print '</div>';
  401. print '</td>';
  402. }
  403. // Action column
  404. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  405. print '<td></td>';
  406. }
  407. print '</tr>';
  408. }
  409. }
  410. print '</table>';
  411. print '</div>';
  412. print '</form>';
  413. // End of page
  414. llxFooter();
  415. $db->close();