36 print
"Error, template page can't be called as URL";
40if (!is_object($form)) {
41 $form =
new Form($db);
46<!-- BEGIN PHP TEMPLATE depreciation_options_view.tpl.php -->
49if (!is_array($parameters)) {
50 $parameters = array();
52if (empty($parameters[
'assetdepreciationoptions'])) {
53 $parameters[
'assetdepreciationoptions'] = &$assetdepreciationoptions;
55$reshook = $hookmanager->executeHooks(
'formAssetDeprecationOptions', $parameters,
$object, $action);
56print $hookmanager->resPrint;
62 $class_type = get_class(
$object) ==
'Asset' ? 0 : 1;
63 foreach ($assetdepreciationoptions->deprecation_options_fields as $mode_key => $mode_info) {
64 if (!empty($mode_info[
'enabled_field'])) {
65 $info = explode(
':', $mode_info[
'enabled_field']);
66 if ($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]] != $info[2]) {
71 $assetdepreciationoptions->setInfosForMode($mode_key, $class_type,
true);
74 print
'<div class="fichecenter">';
75 print
'<div class="fichehalfleft">';
76 print
'<div class="underbanner clearboth"></div>';
77 print
'<table class="border centpercent tableforfield">' .
"\n";
78 $mode_info[
'fields'] =
dol_sort_array($mode_info[
'fields'],
'position');
79 foreach ($mode_info[
'fields'] as $field_key => $field_info) {
80 if (!empty($field_info[
'enabled_field'])) {
81 $info = explode(
':', $field_info[
'enabled_field']);
82 if ($assetdepreciationoptions->deprecation_options[$info[0]][$info[1]] != $info[2]) {
87 $isVisibleAbs = array_key_exists(
'visible', $field_info) ? abs((
int) $field_info[
'visible']) : 0;
88 if (!in_array($isVisibleAbs, array(1, 3, 4, 5))) {
91 if (array_key_exists(
'enabled', $field_info) && isset($field_info[
'enabled']) && !
verifCond($field_info[
'enabled'])) {
94 if (!empty($field_info[
'column_break'])) {
99 print
'<div class="fichehalfright">';
101 print
'<div class="underbanner clearboth"></div>';
102 print
'<table class="border centpercent tableforfield">';
105 $key = $mode_key .
'_' . $field_key;
106 $value = $assetdepreciationoptions->deprecation_options[$mode_key][$field_key];
108 print
'<tr class="field_' . $key .
'"><td';
109 print
' class="' . (empty($field_info[
'tdcss']) ?
'titlefield' : $field_info[
'tdcss']) .
' fieldname_' . $key;
110 if ($field_info[
'type'] ==
'text' || $field_info[
'type'] ==
'html') {
114 if (!empty($field_info[
'help'])) {
115 print $form->textwithpicto($langs->trans($field_info[
'label']), $langs->trans($field_info[
'help']));
117 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 1) {
120 print $langs->trans($field_info[
'label']);
124 print
'<td class="valuefield fieldname_' . $key;
125 if ($field_info[
'type'] ==
'text') {
128 if (!empty($field_info[
'cssview'])) {
129 print
' ' . $field_info[
'cssview'];
132 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
133 print
'<div class="longmessagecut">';
135 if ($field_key ==
'lang') {
136 $langs->load(
"languages");
137 $labellang = ($value ? $langs->trans(
'Language_' . $value) :
'');
141 if (isset($field_info[
'copytoclipboard']) && $field_info[
'copytoclipboard'] == 2) {
142 $out = $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
145 print $assetdepreciationoptions->showOutputField($field_info, $field_key, $value,
'',
'', $mode_key .
'_', 0);
148 if (in_array($field_info[
'type'], array(
'text',
'html'))) {
157 print
'<div class="clearboth"></div>';
162<!-- 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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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...