1<!-- BEGIN TEMPLATE resource_view.tpl.php -->
 
    4if (empty($conf) || !is_object($conf)) {
 
    5  print 
"Error, template page can't be called as URL";
 
   13print 
'<div class="tagtable centpercent noborder allwidth">';
 
   15print 
'<form method="POST" class="tagtable centpercent noborder borderbottom allwidth">';
 
   17print 
'<div class="tagtr liste_titre">';
 
   18print 
'<div class="tagtd liste_titre">'.$langs->trans(
'Resource').
'</div>';
 
   19print 
'<div class="tagtd liste_titre">'.$langs->trans(
'Type').
'</div>';
 
   20print 
'<div class="tagtd liste_titre center">'.$langs->trans(
'Busy').
'</div>';
 
   21print 
'<div class="tagtd liste_titre center">'.$langs->trans(
'Mandatory').
'</div>';
 
   22print 
'<div class="tagtd liste_titre"></div>';
 
   25print 
'<input type="hidden" name="token" value="'.newToken().
'" />';
 
   26print 
'<input type="hidden" name="id" value="'.$element_id.
'" />';
 
   27print 
'<input type="hidden" name="action" value="update_linked_resource" />';
 
   28print 
'<input type="hidden" name="resource_type" value="'.$resource_type.
'" />';
 
   30if ((array) $linked_resources && count($linked_resources) > 0) {
 
   31  foreach ($linked_resources as $linked_resource) {
 
   32    $object_resource = 
fetchObjectByElement($linked_resource[
'resource_id'], $linked_resource[
'resource_type']);
 
   36    if ($mode == 
'edit' && $linked_resource[
'rowid'] == 
GETPOST(
'lineid', 
'int')) {
 
   37      print 
'<div class="tagtr oddeven">';
 
   38      print 
'<input type="hidden" name="lineid" value="'.$linked_resource[
'rowid'].
'" />';
 
   39      print 
'<input type="hidden" name="element" value="'.$element.
'" />';
 
   40      print 
'<input type="hidden" name="element_id" value="'.$element_id.
'" />';
 
   42      print 
'<div class="tagtd">'.$object_resource->getNomUrl(1).
'</div>';
 
   43      print 
'<div class="tagtd">'.$object_resource->type_label.
'</div>';
 
   44      print 
'<div class="tagtd center">'.$form->selectyesno(
'busy', $linked_resource[
'busy'] ? 1 : 0, 1).
'</div>';
 
   45      print 
'<div class="tagtd center">'.$form->selectyesno(
'mandatory', $linked_resource[
'mandatory'] ? 1 : 0, 1).
'</div>';
 
   46      print 
'<div class="tagtd right"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'"></div>';
 
   50      if ($linked_resource[
'rowid'] == 
GETPOST(
'lineid', 
'int')) {
 
   54      print 
'<div class="tagtr oddeven'.($class ? 
' '.$class : 
'').
'">';
 
   56      print 
'<div class="tagtd">';
 
   57      print $object_resource->getNomUrl(1);
 
   60      print 
'<div class="tagtd">';
 
   61      print $object_resource->type_label;
 
   64      print 
'<div class="tagtd center">';
 
   65      print 
yn($linked_resource[
'busy']);
 
   68      print 
'<div class="tagtd center">';
 
   69      print 
yn($linked_resource[
'mandatory']);
 
   72      print 
'<div class="tagtd right">';
 
   73      print 
'<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?mode=edit&token='.newToken().
'&resource_type='.$linked_resource[
'resource_type'].
'&element='.$element.
'&element_id='.$element_id.
'&lineid='.$linked_resource[
'rowid'].
'">';
 
   77      print 
'<a class="marginleftonly marginrightonly" href="'.$_SERVER[
'PHP_SELF'].
'?action=delete_resource&token='.newToken().
'&id='.$linked_resource[
'resource_id'].
'&element='.$element.
'&element_id='.$element_id.
'&lineid='.$linked_resource[
'rowid'].
'">';
 
   78      print 
img_picto($langs->trans(
"Unlink"), 
'unlink');
 
   86  print 
'<div class="tagtr oddeven">';
 
   87  print 
'<div class="tagtd opacitymedium">'.$langs->trans(
'NoResourceLinked').
'</div>';
 
   88  print 
'<div class="tagtd opacitymedium"></div>';
 
   89  print 
'<div class="tagtd opacitymedium"></div>';
 
   90  print 
'<div class="tagtd opacitymedium"></div>';
 
   91  print 
'<div class="tagtd opacitymedium"></div>';
 
  100<!-- END TEMPLATE resource_view.tpl.php -->
 
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
 
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
fetchObjectByElement($element_id, $element_type, $element_ref='')
Fetch an object from its id and element_type Inclusion of classes is automatic.
 
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.