Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
hosting
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Dolibarr
modules
hosting
Commits
d4ccbc7b
Commit
d4ccbc7b
authored
Jul 18, 2019
by
jfefe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid PHPCS errors
parent
b8450346
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
actions_hosting.class.php
class/actions_hosting.class.php
+1
-2
linkedobjectblock.tpl.php
host/tpl/linkedobjectblock.tpl.php
+22
-16
No files found.
class/actions_hosting.class.php
View file @
d4ccbc7b
...
...
@@ -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
;
}
}
}
host/tpl/linkedobjectblock.tpl.php
View file @
d4ccbc7b
...
...
@@ -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
)
.
'&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
)
.
'&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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment