1 <!-- BEGIN TEMPLATE resource_view.tpl.php -->
4 if (empty($conf) || !is_object($conf))
6 print "Error, template page can't be called as URL";
11 $form =
new Form($db);
14 print '<div class="tagtable centpercent noborder allwidth">';
16 print '<form method="POST" class="tagtable centpercent noborder borderbottom allwidth">';
18 print '<div class="tagtr liste_titre">';
19 print '<div class="tagtd liste_titre">'.$langs->trans(
'Resource').
'</div>';
20 print '<div class="tagtd liste_titre">'.$langs->trans(
'Type').
'</div>';
21 print '<div class="tagtd liste_titre center">'.$langs->trans(
'Busy').
'</div>';
22 print '<div class="tagtd liste_titre center">'.$langs->trans(
'Mandatory').
'</div>';
23 print '<div class="tagtd liste_titre"></div>';
26 print '<input type="hidden" name="token" value="'.newToken().
'" />';
27 print '<input type="hidden" name="id" value="'.$element_id.
'" />';
28 print '<input type="hidden" name="action" value="update_linked_resource" />';
29 print '<input type="hidden" name="resource_type" value="'.$resource_type.
'" />';
31 if ((array) $linked_resources && count($linked_resources) > 0)
33 foreach ($linked_resources as $linked_resource)
35 $object_resource =
fetchObjectByElement($linked_resource[
'resource_id'], $linked_resource[
'resource_type']);
39 if ($mode ==
'edit' && $linked_resource[
'rowid'] ==
GETPOST(
'lineid'))
41 print '<div class="tagtr oddeven">';
42 print '<input type="hidden" name="lineid" value="'.$linked_resource[
'rowid'].
'" />';
43 print '<input type="hidden" name="element" value="'.$element.
'" />';
44 print '<input type="hidden" name="element_id" value="'.$element_id.
'" />';
46 print '<div class="tagtd">'.$object_resource->getNomUrl(1).
'</div>';
47 print '<div class="tagtd">'.$object_resource->type_label.
'</div>';
48 print '<div class="tagtd center">'.$form->selectyesno(
'busy', $linked_resource[
'busy'] ? 1 : 0, 1).
'</div>';
49 print '<div class="tagtd center">'.$form->selectyesno(
'mandatory', $linked_resource[
'mandatory'] ? 1 : 0, 1).
'</div>';
50 print '<div class="tagtd right"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'"></div>';
54 if ($linked_resource[
'rowid'] ==
GETPOST(
'lineid'))
57 print '<div class="tagtr oddeven'.($class ?
' '.$class :
'').
'">';
59 print '<div class="tagtd">';
60 print $object_resource->getNomUrl(1);
63 print
'<div class="tagtd">';
64 print $object_resource->type_label;
67 print
'<div class="tagtd center">';
68 print
yn($linked_resource[
'busy']);
71 print
'<div class="tagtd center">';
72 print
yn($linked_resource[
'mandatory']);
75 print
'<div class="tagtd right">';
76 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'].
'">';
80 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'].
'">';
81 print
img_picto($langs->trans(
"Unlink"),
'unlink');
89 print '<div class="tagtr oddeven">';
90 print '<div class="tagtd opacitymedium">'.$langs->trans(
'NoResourceLinked').
'</div>';
91 print '<div class="tagtd opacitymedium"></div>';
92 print '<div class="tagtd opacitymedium"></div>';
93 print '<div class="tagtd opacitymedium"></div>';
94 print '<div class="tagtd opacitymedium"></div>';
103 <!-- END TEMPLATE resource_view.tpl.php -->
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
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)
print
Draft customers invoices.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
fetchObjectByElement($element_id, $element_type, $element_ref= '')
Fetch an object from its id and element_type Inclusion of classes is automatic.