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
385aca8b
Commit
385aca8b
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix sort of list and number of records
parent
8a5bafc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/societe/notify/card.php
+48
-38
48 additions, 38 deletions
htdocs/societe/notify/card.php
with
48 additions
and
38 deletions
htdocs/societe/notify/card.php
+
48
−
38
View file @
385aca8b
...
...
@@ -52,7 +52,7 @@ $offset = $conf->liste_limit * $page;
$pageprev
=
$page
-
1
;
$pagenext
=
$page
+
1
;
if
(
!
$sortorder
)
$sortorder
=
"DESC"
;
if
(
!
$sortfield
)
$sortfield
=
"
a
.daten"
;
if
(
!
$sortfield
)
$sortfield
=
"
n
.daten"
;
$now
=
dol_now
();
...
...
@@ -264,8 +264,30 @@ if ($result > 0)
print
'</form>'
;
print
'<br>'
;
// List of notifications enabled for contacts
$sql
=
"SELECT n.rowid, n.type,"
;
$sql
.
=
" a.code, a.label,"
;
$sql
.
=
" c.rowid as contactid, c.lastname, c.firstname, c.email"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"c_action_trigger as a,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"notify_def as n,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"socpeople c"
;
$sql
.
=
" WHERE a.rowid = n.fk_action"
;
$sql
.
=
" AND c.rowid = n.fk_contact"
;
$sql
.
=
" AND c.fk_soc = "
.
$object
->
id
;
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
$num
=
$db
->
num_rows
(
$resql
);
}
else
{
dol_print_error
(
$db
);
}
// List of active notifications
print
load_fiche_titre
(
$langs
->
trans
(
"ListOfActiveNotifications"
),
''
,
''
);
print
load_fiche_titre
(
$langs
->
trans
(
"ListOfActiveNotifications"
)
.
' ('
.
$num
.
')'
,
''
,
''
);
$var
=
true
;
// Line with titles
...
...
@@ -280,21 +302,8 @@ if ($result > 0)
$langs
->
load
(
"errors"
);
$langs
->
load
(
"other"
);
// List of notifications enabled for contacts
$sql
=
"SELECT n.rowid, n.type,"
;
$sql
.
=
" a.code, a.label,"
;
$sql
.
=
" c.rowid as contactid, c.lastname, c.firstname, c.email"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"c_action_trigger as a,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"notify_def as n,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"socpeople c"
;
$sql
.
=
" WHERE a.rowid = n.fk_action"
;
$sql
.
=
" AND c.rowid = n.fk_contact"
;
$sql
.
=
" AND c.fk_soc = "
.
$object
->
id
;
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
if
(
$num
)
{
$num
=
$db
->
num_rows
(
$resql
);
$i
=
0
;
$contactstatic
=
new
Contact
(
$db
);
...
...
@@ -336,10 +345,6 @@ if ($result > 0)
}
$db
->
free
(
$resql
);
}
else
{
dol_print_error
(
$db
);
}
// List of notifications enabled for fixed email
/*
...
...
@@ -395,20 +400,6 @@ if ($result > 0)
print
'<br>'
;
// List of notifications done
print
load_fiche_titre
(
$langs
->
trans
(
"ListOfNotificationsDone"
),
''
,
''
);
$var
=
true
;
// Line with titles
print
'<table width="100%" class="noborder">'
;
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
"Target"
),
$_SERVER
[
"PHP_SELF"
],
"c.lastname"
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Action"
),
$_SERVER
[
"PHP_SELF"
],
"a.titre"
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Type"
),
$_SERVER
[
"PHP_SELF"
],
""
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
//print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
print_liste_field_titre
(
$langs
->
trans
(
"Date"
),
$_SERVER
[
"PHP_SELF"
],
"a.daten"
,
''
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print
'</tr>'
;
// List
$sql
=
"SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"
;
$sql
.
=
" c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"
;
...
...
@@ -418,11 +409,34 @@ if ($result > 0)
$sql
.
=
" LEFT JOIN "
.
MAIN_DB_PREFIX
.
"socpeople as c ON n.fk_contact = c.rowid"
;
$sql
.
=
" WHERE a.rowid = n.fk_action"
;
$sql
.
=
" AND n.fk_soc = "
.
$object
->
id
;
$sql
.
=
$db
->
order
(
$sortfield
,
$sortorder
);
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
$num
=
$db
->
num_rows
(
$resql
);
}
else
{
dol_print_error
(
$db
);
}
// List of notifications done
print
load_fiche_titre
(
$langs
->
trans
(
"ListOfNotificationsDone"
)
.
' ('
.
$num
.
')'
,
''
,
''
);
$var
=
true
;
// Line with titles
print
'<table width="100%" class="noborder">'
;
print
'<tr class="liste_titre">'
;
print_liste_field_titre
(
$langs
->
trans
(
"Target"
),
$_SERVER
[
"PHP_SELF"
],
"c.lastname,c.firstname"
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Action"
),
$_SERVER
[
"PHP_SELF"
],
""
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
print_liste_field_titre
(
$langs
->
trans
(
"Type"
),
$_SERVER
[
"PHP_SELF"
],
"n.type"
,
''
,
$param
,
''
,
$sortfield
,
$sortorder
);
//print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
print_liste_field_titre
(
$langs
->
trans
(
"Date"
),
$_SERVER
[
"PHP_SELF"
],
"n.daten"
,
''
,
$param
,
'align="right"'
,
$sortfield
,
$sortorder
);
print
'</tr>'
;
if
(
$num
>
0
)
{
$i
=
0
;
$contactstatic
=
new
Contact
(
$db
);
...
...
@@ -471,10 +485,6 @@ if ($result > 0)
}
$db
->
free
(
$resql
);
}
else
{
dol_print_error
(
$db
);
}
print
'</table>'
;
}
...
...
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