1<!-- BEGIN TEMPLATE resource_view.tpl.php -->
33 print
"Error, template page can't be called as URL";
38@phan-var-force string $element
39@phan-var-force int $element_id
40@phan-var-force string $resource_type
41@phan-var-force array<array{rowid:int,resource_id:int,resource_type:string,busy:int<0,1>,mandatory:int<0,1>}> $linked_resources
48print
'<div class="tagtable centpercent noborder allwidth">';
50print
'<form method="POST" class="tagtable centpercent noborder borderbottom allwidth">';
52print
'<div class="tagtr liste_titre">';
53print
'<div class="tagtd liste_titre">'.$langs->trans(
'Resource').
'</div>';
54print
'<div class="tagtd liste_titre">'.$langs->trans(
'Type').
'</div>';
55print
'<div class="tagtd liste_titre center">'.$langs->trans(
'Busy').
'</div>';
56print
'<div class="tagtd liste_titre center">'.$langs->trans(
'Mandatory').
'</div>';
57print
'<div class="tagtd liste_titre"></div>';
60print
'<input type="hidden" name="token" value="'.newToken().
'" />';
61print
'<input type="hidden" name="id" value="'.$element_id.
'" />';
62print
'<input type="hidden" name="action" value="update_linked_resource" />';
63print
'<input type="hidden" name="resource_type" value="'.$resource_type.
'" />';
65if ((array) $linked_resources && count($linked_resources) > 0) {
66 foreach ($linked_resources as $linked_resource) {
67 $object_resource =
fetchObjectByElement($linked_resource[
'resource_id'], $linked_resource[
'resource_type']);
71 if ($mode ==
'edit' && $linked_resource[
'rowid'] ==
GETPOSTINT(
'lineid')) {
72 print
'<div class="tagtr oddeven">';
73 print
'<input type="hidden" name="lineid" value="'.$linked_resource[
'rowid'].
'" />';
74 print
'<input type="hidden" name="element" value="'.$element.
'" />';
75 print
'<input type="hidden" name="element_id" value="'.$element_id.
'" />';
77 print
'<div class="tagtd">'.$object_resource->getNomUrl(1).
'</div>';
78 print
'<div class="tagtd">'.$object_resource->type_label.
'</div>';
79 print
'<div class="tagtd center">'.$form->selectyesno(
'busy', $linked_resource[
'busy'] ? 1 : 0, 1).
'</div>';
80 print
'<div class="tagtd center">'.$form->selectyesno(
'mandatory', $linked_resource[
'mandatory'] ? 1 : 0, 1).
'</div>';
81 print
'<div class="tagtd right"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'"></div>';
85 if ($linked_resource[
'rowid'] ==
GETPOSTINT(
'lineid')) {
89 print
'<div class="tagtr oddeven'.($class ?
' '.$class :
'').
'">';
91 print
'<div class="tagtd">';
92 print $object_resource->getNomUrl(1);
95 print
'<div class="tagtd">';
96 print $object_resource->type_label;
99 print
'<div class="tagtd center">';
100 print
yn($linked_resource[
'busy']);
103 print
'<div class="tagtd center">';
104 print
yn($linked_resource[
'mandatory']);
107 print
'<div class="tagtd right">';
108 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'].
'">';
112 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'].
'">';
113 print
img_picto($langs->trans(
"Unlink"),
'unlink');
121 print
'<div class="tagtr oddeven">';
122 print
'<div class="tagtd opacitymedium">'.$langs->trans(
'NoResourceLinked').
'</div>';
123 print
'<div class="tagtd opacitymedium"></div>';
124 print
'<div class="tagtd opacitymedium"></div>';
125 print
'<div class="tagtd opacitymedium"></div>';
126 print
'<div class="tagtd opacitymedium"></div>';
135<!-- END TEMPLATE resource_view.tpl.php -->
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
fetchObjectByElement($element_id, $element_type, $element_ref='', $useCache=0, $maxCacheByType=10)
Fetch an object from its id and element_type Inclusion of classes is automatic.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...