Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
a762910f
Commit
a762910f
authored
9 years ago
by
aspangaro
Browse files
Options
Downloads
Patches
Plain Diff
Add getNomUrl on accounting for account
parent
967e7ea4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/accountancy/admin/account.php
+10
-4
10 additions, 4 deletions
htdocs/accountancy/admin/account.php
htdocs/accountancy/class/accountingaccount.class.php
+31
-14
31 additions, 14 deletions
htdocs/accountancy/class/accountingaccount.class.php
with
41 additions
and
18 deletions
htdocs/accountancy/admin/account.php
+
10
−
4
View file @
a762910f
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-201
4
Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-201
5
Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -154,7 +154,7 @@ if ($result) {
print_liste_field_titre
(
$langs
->
trans
(
"Accountparent"
),
$_SERVER
[
"PHP_SELF"
],
"aa.account_parent"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Pcgtype"
),
$_SERVER
[
"PHP_SELF"
],
"aa.pcg_type"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Pcgsubtype"
),
$_SERVER
[
"PHP_SELF"
],
"aa.pcg_subtype"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Activ
e
"
),
$_SERVER
[
"PHP_SELF"
],
"aa.active"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Activ
ated
"
),
$_SERVER
[
"PHP_SELF"
],
"aa.active"
,
""
,
$param
,
""
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Action"
),
$_SERVER
[
"PHP_SELF"
],
""
,
$param
,
""
,
'width="60" align="center"'
,
$sortfield
,
$sortorder
);
print
'</tr>'
;
...
...
@@ -174,12 +174,17 @@ if ($result) {
$var
=
true
;
$accountstatic
=
new
AccountingAccount
(
$db
);
while
(
$i
<
min
(
$num
,
$limit
)
)
{
$obj
=
$db
->
fetch_object
(
$resql
);
$var
=
!
$var
;
$accountstatic
->
id
=
$obj
->
rowid
;
$accountstatic
->
label
=
$obj
->
label
;
$accountstatic
->
account_number
=
$obj
->
account_number
;
print
'<tr '
.
$bc
[
$var
]
.
'>'
;
print
'<td>
<a href="./card.php?id='
.
$obj
->
rowid
.
'">'
.
$obj
->
account_number
.
'</td>'
;
print
'<td>
'
.
$accountstatic
->
getNomUrl
(
1
)
.
'</td>'
;
print
'<td>'
.
$obj
->
label
.
'</td>'
;
print
'<td>'
.
$obj
->
account_parent
.
'</td>'
;
print
'<td>'
.
$obj
->
pcg_type
.
'</td>'
;
...
...
@@ -210,6 +215,7 @@ if ($result) {
print
'</td>'
.
"
\n
"
;
print
"</tr>
\n
"
;
$var
=!
$var
;
$i
++
;
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/accountancy/class/accountingaccount.class.php
+
31
−
14
View file @
a762910f
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-201
4
Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-201
5
Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
*
...
...
@@ -66,8 +66,7 @@ class AccountingAccount extends CommonObject
*/
function
fetch
(
$rowid
=
null
,
$account_number
=
null
)
{
if
(
$rowid
||
$account_number
)
{
if
(
$rowid
||
$account_number
)
{
$sql
=
"SELECT rowid, datec, tms, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, fk_user_author, fk_user_modif, active"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"accountingaccount WHERE"
;
if
(
$rowid
)
{
...
...
@@ -78,12 +77,10 @@ class AccountingAccount extends CommonObject
dol_syslog
(
get_class
(
$this
)
.
"::fetch sql="
.
$sql
,
LOG_DEBUG
);
$result
=
$this
->
db
->
query
(
$sql
);
if
(
$result
)
{
if
(
$result
)
{
$obj
=
$this
->
db
->
fetch_object
(
$result
);
if
(
$obj
)
{
if
(
$obj
)
{
$this
->
id
=
$obj
->
rowid
;
$this
->
rowid
=
$obj
->
rowid
;
$this
->
datec
=
$obj
->
datec
;
...
...
@@ -99,18 +96,13 @@ class AccountingAccount extends CommonObject
$this
->
active
=
$obj
->
active
;
return
$this
->
id
;
}
else
{
}
else
{
return
0
;
}
}
else
{
}
else
{
dol_print_error
(
$this
->
db
);
}
}
return
-
1
;
}
...
...
@@ -344,6 +336,31 @@ class AccountingAccount extends CommonObject
}
}
/**
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @return string Chaine avec URL
*/
function
getNomUrl
(
$withpicto
=
0
)
{
global
$langs
;
$result
=
''
;
$link
=
'<a href="'
.
DOL_URL_ROOT
.
'/accountancy/admin/card.php?id='
.
$this
->
id
.
'">'
;
$linkend
=
'</a>'
;
$picto
=
'billr'
;
$label
=
$langs
->
trans
(
"Show"
)
.
': '
.
$this
->
account_number
.
' - '
.
$this
->
label
;
if
(
$withpicto
)
$result
.
=
(
$link
.
img_object
(
$label
,
$picto
)
.
$linkend
);
if
(
$withpicto
&&
$withpicto
!=
2
)
$result
.
=
' '
;
if
(
$withpicto
!=
2
)
$result
.
=
$link
.
$this
->
account_number
.
$linkend
;
return
$result
;
}
/**
* Information on record
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment