28if (empty($object) || !is_object($object)) {
29 print
"Error, template page can't be called as URL";
33if (!is_object($form)) {
34 $form =
new Form($db);
39<!-- BEGIN PHP TEMPLATE depreciation_options_view.tpl.php -->
42if (!is_array($parameters)) {
43 $parameters = array();
45if (empty($parameters[
'assetdepreciationoptions'])) {
46 $parameters[
'assetdepreciationoptions'] = &$assetdepreciationoptions;
48$reshook = $hookmanager->executeHooks(
'formAssetDeprecationOptions', $parameters, $object, $action);
49print $hookmanager->resPrint;
55 $class_type = get_class($object) ==
'Asset' ? 0 : 1;
56 foreach ($assetdepreciationoptions->deprecation_options_fields as $mode_key => $mode_info) {
57 if (!empty($mode_info[
'enabled_field'])) {
58 $info = explode(
':', $mode_info[
'enabled_field']);
59 if ($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]] != $info[2]) {
64 $assetdepreciationoptions->setInfosForMode($mode_key, $class_type,
true);
67 print
'<div class="fichecenter">';
68 print
'<div class="fichehalfleft">';
69 print
'<div class="underbanner clearboth"></div>';
70 print
'<table class="border centpercent tableforfield">' .
"\n";
71 $mode_info[
'fields'] =
dol_sort_array($mode_info[
'fields'],
'position');
72 foreach ($mode_info[
'fields'] as $field_key => $field_info) {
73 if (!empty($field_info[
'enabled_field'])) {
74 $info = explode(
':', $field_info[
'enabled_field']);
75 if ($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]] != $info[2]) {
80 if (abs($field_info[
'visible']) != 1 && abs($field_info[
'visible']) != 3 && abs($field_info[
'visible']) != 4 && abs($field_info[
'visible']) != 5) {
83 if (array_key_exists(
'enabled', $field_info) && isset($field_info[
'enabled']) && !
verifCond($field_info[
'enabled'])) {
86 if (!empty($field_info[
'column_break'])) {
91 print
'<div class="fichehalfright">';
93 print
'<div class="underbanner clearboth"></div>';
94 print
'<table class="border centpercent tableforfield">';
97 $key = $mode_key .
'_' . $field_key;
98 $value = $assetdepreciationoptions->deprecation_options[$mode_key][$field_key];
100 print
'<tr class="field_' . $key .
'"><td';
101 print
' class="' . (empty($field_info[
'tdcss']) ?
'titlefield' : $field_info[
'tdcss']) .
' fieldname_' . $key;
102 if ($field_info[
'type'] ==
'text' || $field_info[
'type'] ==
'html') {
106 if (!empty($field_info[
'help'])) {
107 print $form->textwithpicto($langs->trans($field_info[
'label']), $langs->trans($field_info[
'help']));
109 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 1) {
112 print $langs->trans($field_info[
'label']);
116 print
'<td class="valuefield fieldname_' . $key;
117 if ($field_info[
'type'] ==
'text') {
120 if (!empty($field_info[
'cssview'])) {
121 print
' ' . $field_info[
'cssview'];
124 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
125 print
'<div class="longmessagecut">';
127 if ($field_key ==
'lang') {
128 $langs->load(
"languages");
129 $labellang = ($value ? $langs->trans(
'Language_' . $value) :
'');
133 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 2) {
134 $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
137 print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
140 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
149 print
'<div class="clearboth"></div>';
154<!-- END PHP TEMPLATE depreciation_options_view.tpl.php -->
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
verifCond($strToEvaluate)
Verify if condition in string is ok or not.