30 print
"Error, template page can't be called as URL";
34if (!is_object($form)) {
35 $form =
new Form($db);
40<!-- BEGIN PHP TEMPLATE depreciation_options_view.tpl.php -->
43if (!is_array($parameters)) {
44 $parameters = array();
46if (empty($parameters[
'assetdepreciationoptions'])) {
47 $parameters[
'assetdepreciationoptions'] = &$assetdepreciationoptions;
49$reshook = $hookmanager->executeHooks(
'formAssetDeprecationOptions', $parameters,
$object, $action);
50print $hookmanager->resPrint;
56 $class_type = get_class(
$object) ==
'Asset' ? 0 : 1;
58 foreach ($assetdepreciationoptions->deprecation_options_fields as $mode_key => $mode_info) {
59 if (!empty($mode_info[
'enabled_field'])) {
60 $info = explode(
':', $mode_info[
'enabled_field']);
61 if (empty($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]]) || $assetdepreciationoptions->deprecation_options[$info[0]][$info[1]] != $info[2]) {
66 $assetdepreciationoptions->setInfosForMode($mode_key, $class_type,
true);
69 print
'<table class="liste centpercent '. $width .
'" id="block_' . $mode_key .
'">' .
"\n";
70 print
'<tr class="liste_titre"><td colspan="5">'.$langs->trans($mode_info[
'label']).
'</td></tr>';
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 (empty($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]]) || $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 $key = $mode_key .
'_' . $field_key;
87 $value = $assetdepreciationoptions->deprecation_options[$mode_key][$field_key] ??
null;
89 print
'<tr class="field_' . $key .
'" id="block_' . $mode_key .
'"><td';
90 print
' class="' . (empty($field_info[
'tdcss']) ?
'titlefieldmiddle' : $field_info[
'tdcss']) .
' fieldname_' . $key;
91 if ($field_info[
'type'] ==
'text' || $field_info[
'type'] ==
'html') {
95 if (!empty($field_info[
'help'])) {
96 print $form->textwithpicto($langs->trans($field_info[
'label']), $langs->trans($field_info[
'help']));
98 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 1) {
101 print $langs->trans($field_info[
'label']);
105 print
'<td class="valuefield fieldname_' . $key;
106 if ($field_info[
'type'] ==
'text') {
109 if (!empty($field_info[
'cssview'])) {
110 print
' ' . $field_info[
'cssview'];
113 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
114 print
'<div class="longmessagecut">';
116 if ($field_key ==
'lang') {
117 $langs->load(
"languages");
118 $labellang = ($value ? $langs->trans(
'Language_' . $value) :
'');
122 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 2) {
123 $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
126 print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
129 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
136 print
'<div class="clearboth"></div>';
142<!-- END PHP TEMPLATE depreciation_options_view.tpl.php -->
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
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 the value of a given key, which produces ascending (default) or descending out...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.