Commit d4ccbc7b authored by jfefe's avatar jfefe

Avoid PHPCS errors

parent b8450346
......@@ -73,7 +73,7 @@ class ActionsHosting
$error = 0; // Error counter
if (in_array($parameters['currentcontext'], array('commonobject'))) { // do something only for the context 'somecontext1' or 'somecontext2'
if (in_array($parameters['currentcontext'], array('commonobject'))) { // do something only for the context 'somecontext1' or 'somecontext2'
if (is_object($object->thirdparty) && ! empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
$listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) {
......@@ -102,5 +102,4 @@ class ActionsHosting
return -1;
}
}
}
......@@ -19,8 +19,7 @@
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
if (empty($conf) || ! is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
......@@ -32,37 +31,45 @@ if (empty($conf) || ! is_object($conf))
<?php
global $user;
global $noMoreLinkedObjectBlockAfter;
global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
$langs->load('hosting@hosting');
//$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$total=0; $ilink=0;
foreach($linkedObjectBlock as $key => $objectlink)
{
$total=0;
$ilink=0;
foreach ($linkedObjectBlock as $key => $objectlink) {
$ilink++;
$trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
$trclass.=' liste_sub_total';
}
?>
<tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element" ><?php echo $langs->trans("Host"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0,'',0,1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
<?php
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
?>
</td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1, '', 0, '', -1, 1); ?></td>
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_creation,'day'); ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_creation, 'day'); ?></td>
<td class="linkedcol-amount" align="right"><?php
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td class="linkedcol-statut" align="right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action" align="right">
<?php
// For now, shipments must stay linked to order, so link is not deletable
if($object->element != 'shipping') {
if ($object->element != 'shipping') {
?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a>
<?php
......@@ -72,8 +79,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
</tr>
<?php
}
if (count($linkedObjectBlock) > 1)
{
if (count($linkedObjectBlock) > 1) {
?>
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
<td><?php echo $langs->trans("Total"); ?></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment