Skip to content

Commit

Permalink
Fix extrafields resource
Browse files Browse the repository at this point in the history
  • Loading branch information
inoveaconseil committed Jun 28, 2018
1 parent da138db commit c4513a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions htdocs/core/tpl/extrafields_list_print_fields.tpl.php
Expand Up @@ -58,10 +58,16 @@
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
{
$value = $db->jdate($obj->$tmpkey);
if(is_a($obj, "Dolresource")){
$value = $db->jdate($obj->array_options[$tmpkey]);
}
}
else
{
$value = $obj->$tmpkey;
if(is_a($obj, "Dolresource")){
$value = $obj->array_options[$tmpkey];
}
}
print $extrafields->showOutputField($key, $value, '');
print '</td>';
Expand Down
13 changes: 7 additions & 6 deletions htdocs/resource/list.php
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
*
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -237,34 +238,34 @@

if ($ret)
{
foreach ($object->lines as $resource)
foreach ($object->lines as $obj)
{
print '<tr class="oddeven">';

if (! empty($arrayfields['t.ref']['checked']))
{
print '<td>';
print $resource->getNomUrl(5);
print $obj->getNomUrl(5);
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

if (! empty($arrayfields['ty.label']['checked']))
{
print '<td>';
print $resource->type_label;
print $obj->type_label;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';

print '<td align="center">';
print '<a href="./card.php?action=edit&id='.$resource->id.'">';
print '<a href="./card.php?action=edit&id='.$obj->id.'">';
print img_edit();
print '</a>';
print '&nbsp;';
print '<a href="./card.php?action=delete&id='.$resource->id.'">';
print '<a href="./card.php?action=delete&id='.$obj->id.'">';
print img_delete();
print '</a>';
print '</td>';
Expand Down

0 comments on commit c4513a7

Please sign in to comment.