45 print
"Error, template page can't be called as URL";
49print
"<!-- BEGIN PHP TEMPLATE mrp/tpl/linkedobjectblock.tpl.php -->\n";
58 $mo_static =
new Mo(
$db);
59 $res = $mo_static->fetch(
$object->id);
60 $TMoChilds = $mo_static->getMoChilds();
61 '@phan-var-force Mo[] $TMoChilds';
63 $hookmanager->initHooks(array(
'LinesLinkedObjectBlock'));
64 $parameters = array(
'TMoChilds' => $TMoChilds);
65 $reshook = $hookmanager->executeHooks(
'LinesLinkedObjectBlock', $parameters,
$object, $action);
66 if (empty($reshook)) {
67 foreach ($TMoChilds as $key => $objectlink) {
72 echo
'<tr class="' . $trclass .
'" >';
73 echo
'<td class="linkedcol-element tdoverflowmax125">' . $langs->trans(
"ManufacturingOrder");
74 if (!empty($showImportButton) &&
getDolGlobalInt(
'MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
75 print
'<a class="objectlinked_importbtn" href="' . $objectlink->getNomUrl(0,
'', 0,
'1') .
'&action=selectlines&token='.newToken().
'" data-element="' . $objectlink->element .
'" data-id="' . $objectlink->id .
'" > <i class="fa fa-indent"></i> </a';
78 echo
'<td class="linkedcol-name nowraponall" >' . $objectlink->getNomUrl(1) .
'</td>';
80 echo
'<td class="linkedcol-ref center">';
83 echo
'<td class="linkedcol-date center">' .
dol_print_date($objectlink->date_creation,
'day') .
'</td>';
84 echo
'<td class="linkedcol-amount right">-</td>';
85 echo
'<td class="linkedcol-statut right">' . $objectlink->getLibStatut(3) .
'</td>';
86 echo
'<td class="linkedcol-action right">';
89 $sql =
" Select rowid from " . MAIN_DB_PREFIX .
"element_element";
92 $resql =
$db->query($sql);
95 $obj =
$db->fetch_object($resql);
96 if ($obj->rowid && $obj->rowid > 0) {
100 echo
'<a class="reposition" href="' . $_SERVER[
"PHP_SELF"] .
'?id=' .
$object->id .
'&action=dellink&token=' . newToken() .
'&dellinkid=' . $k .
'">' .
img_picto($langs->transnoentitiesnoconv(
"RemoveLink"),
'unlink') .
'</a>';
106 $linkedObjectBlock =
dol_sort_array($linkedObjectBlock,
'date,ref',
'desc', 0, 0, 1);
107 '@phan-var-force array<CommonObject> $linkedObjectBlock';
111 foreach ($linkedObjectBlock as $key => $objectlink) {
113 $refWithThirdparty = $objectlink->ref_client ?
dolPrintHTML($objectlink->ref_client).
'<br>' :
'';
115 $objectlink->fetch_thirdparty();
117 $refWithThirdparty =
'<span class="small">'.$refWithThirdparty;
118 $refWithThirdparty .= !empty($objectlink->thirdparty) ? $objectlink->thirdparty->getNomUrl(1) :
'';
119 $refWithThirdparty .=
'</span>';
121 $trclass =
'oddeven';
122 if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
123 $trclass .=
' liste_sub_total';
125 print
'<tr class="'.$trclass.
'" data-element="'.$objectlink->element.
'" data-id="'.$objectlink->id.
'" >';
126 print
'<td class="linkedcol-element tdoverflowmax100">'.$langs->trans(
"ManufacturingOrder");
127 if (!empty($showImportButton) &&
getDolGlobalInt(
'MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
128 $url = DOL_URL_ROOT.
'/mrp/mo_card.php?id='.$objectlink->id;
129 print
'<a class="objectlinked_importbtn" href="'.$url.
'&action=selectlines&token='.newToken().
'" data-element="'.$objectlink->element.
'" data-id="'.$objectlink->id.
'" > <i class="fa fa-indent"></i> </a>';
133 print
'<td class="linkedcol-name tdoverflowmax150">'.$objectlink->getNomUrl(1).
'</td>';
134 print
'<td class="linkedcol-ref tdoverflowmax150 nopaddingtopimp nopaddingbottomimp" title="'.dolPrintHTMLForAttribute($objectlink->ref_client).
'">'.$refWithThirdparty.
'</td>';
135 print
'<td class="linkedcol-date center">'.dol_print_date($objectlink->date_start_planned,
'day').
'</td>';
136 print
'<td class="linkedcol-amount right">-</td>';
137 print
'<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).
'</td>';
138 print
'<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&action=dellink&token='.newToken().
'&dellinkid='.$key.
'">'.
img_picto($langs->transnoentitiesnoconv(
"RemoveLink"),
'unlink').
'</a></td>';
143echo
"<!-- END PHP TEMPLATE -->\n";
if(! $sortfield) if(! $sortorder) $object
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...