admin_extrafields_view.tpl.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /* Copyright (C) 2010-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* To call this template, you must define
  19. * $textobject
  20. * $langs
  21. * $extrafield
  22. * $elementtype
  23. */
  24. ?>
  25. <!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
  26. <?php
  27. print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
  28. print '<br>';
  29. // Load attribute_label
  30. $extrafields->fetch_name_optionals_label($elementtype);
  31. print '<div class="div-table-responsive">';
  32. print '<table summary="listofattributes" class="noborder" width="100%">';
  33. print '<tr class="liste_titre">';
  34. print '<td align="left">'.$langs->trans("Position");
  35. print '<span class="nowrap"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" alt="" title="A-Z" class="imgdown"></span>';
  36. print '</td>';
  37. print '<td>'.$langs->trans("Label").'</td>';
  38. print '<td>'.$langs->trans("AttributeCode").'</td>';
  39. print '<td>'.$langs->trans("Type").'</td>';
  40. print '<td align="right">'.$langs->trans("Size").'</td>';
  41. print '<td align="center">'.$langs->trans("Unique").'</td>';
  42. print '<td>'.$langs->trans("ComputedFormula").'</td>';
  43. print '<td align="center">'.$langs->trans("Required").'</td>';
  44. print '<td align="center">'.$langs->trans("AlwaysEditable").'</td>';
  45. if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.$langs->trans("Hidden").'</td>';
  46. print '<td width="80">&nbsp;</td>';
  47. print "</tr>\n";
  48. if (count($extrafields->attribute_type))
  49. {
  50. foreach($extrafields->attribute_type as $key => $value)
  51. {
  52. print '<tr class="oddeven">';
  53. print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
  54. print "<td>".$extrafields->attribute_label[$key]."</td>\n";
  55. print "<td>".$key."</td>\n";
  56. print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
  57. print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
  58. print '<td align="center">'.yn($extrafields->attribute_unique[$key])."</td>\n";
  59. print '<td>'.dol_trunc($extrafields->attribute_computed[$key], 20)."</td>\n";
  60. print '<td align="center">'.yn($extrafields->attribute_required[$key])."</td>\n";
  61. print '<td align="center">'.yn($extrafields->attribute_alwayseditable[$key])."</td>\n";
  62. if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) print '<td align="center">'.yn($extrafields->attribute_hidden[$key])."</td>\n"; // Add hidden option on not working feature. Why hide if user can't see it.
  63. print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
  64. print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=$key\">".img_delete()."</a></td>\n";
  65. print "</tr>";
  66. }
  67. }
  68. else
  69. {
  70. $colspan=9;
  71. if (! empty($conf->global->MAIN_CAN_HIDE_EXTRAFIELDS)) $colspan++;
  72. print '<tr class="oddeven">';
  73. print '<td class="opacitymedium" colspan="'.$colspan.'">';
  74. print $langs->trans("None");
  75. print '</td>';
  76. print '</tr>';
  77. }
  78. print "</table>";
  79. print '</div>';
  80. ?>
  81. <!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->