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
55a4f545
Commit
55a4f545
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: After creating an event, go back to original page.
parent
e3562687
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/comm/action/fiche.php
+19
-13
19 additions, 13 deletions
htdocs/comm/action/fiche.php
htdocs/comm/action/index.php
+11
-9
11 additions, 9 deletions
htdocs/comm/action/index.php
with
30 additions
and
22 deletions
htdocs/comm/action/fiche.php
+
19
−
13
View file @
55a4f545
...
...
@@ -65,20 +65,21 @@ $contact = new Contact($db);
*/
if
(
$_POST
[
"action"
]
==
'add_action'
)
{
if
(
$_POST
[
"contactid"
])
$backtopage
=
''
;
if
(
!
empty
(
$_POST
[
"backtopage"
]))
$backtopage
=
$_POST
[
"backtopage"
];
if
(
!
$backtopage
)
{
if
(
$socid
>
0
)
$backtopage
=
DOL_URL_ROOT
.
'/comm/fiche.php?socid='
.
$socid
;
else
$backtopage
=
DOL_URL_ROOT
.
'/comm/action/index.php'
;
}
if
(
$_POST
[
"contactid"
])
{
$result
=
$contact
->
fetch
(
$_POST
[
"contactid"
]);
}
if
(
$_POST
[
'cancel'
])
{
$backtopage
=
''
;
if
(
!
empty
(
$_POST
[
"backtopage"
]))
$backtopage
=
$_POST
[
"backtopage"
];
if
(
!
$backtopage
)
{
if
(
$socid
>
0
)
$backtopage
=
DOL_URL_ROOT
.
'/comm/fiche.php?socid='
.
$socid
;
else
$backtopage
=
DOL_URL_ROOT
.
'/comm/action/index.php'
;
}
header
(
"Location: "
.
$backtopage
);
exit
;
}
...
...
@@ -226,10 +227,10 @@ if ($_POST["action"] == 'add_action')
if
(
!
$actioncomm
->
error
)
{
$db
->
commit
();
if
(
$_POST
[
"from"
]
)
if
(
!
empty
(
$backtopage
)
)
{
dol_syslog
(
"Back to "
.
$
_POST
[
"from"
]
);
Header
(
"Location: "
.
$
_POST
[
"from"
]
);
dol_syslog
(
"Back to "
.
$
backtopage
);
Header
(
"Location: "
.
$
backtopage
);
}
elseif
(
$idaction
)
{
...
...
@@ -396,11 +397,16 @@ if (GETPOST("action") == 'update')
}
else
{
if
(
!
empty
(
$_POST
[
"from"
]))
if
(
!
empty
(
$_POST
[
"from"
]))
// deprecated. Use backtopage instead
{
header
(
"Location: "
.
$_POST
[
"from"
]);
exit
;
}
if
(
!
empty
(
$_POST
[
"backtopage"
]))
{
header
(
"Location: "
.
$_POST
[
"backtopage"
]);
exit
;
}
}
}
...
...
@@ -717,7 +723,7 @@ if ($id)
print
'<input type="hidden" name="token" value="'
.
$_SESSION
[
'newtoken'
]
.
'">'
;
print
'<input type="hidden" name="action" value="update">'
;
print
'<input type="hidden" name="id" value="'
.
$id
.
'">'
;
if
(
GETPOST
(
"backtopage"
))
print
'<input type="hidden" name="
from
" value="'
.
(
GETPOST
(
"
from
"
)
?
GETPOST
(
"
from
"
)
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
if
(
GETPOST
(
"backtopage"
))
print
'<input type="hidden" name="
backtopage
" value="'
.
(
GETPOST
(
"
backtopage
"
)
?
GETPOST
(
"
backtopage
"
)
:
$_SERVER
[
"HTTP_REFERER"
])
.
'">'
;
print
'<table class="border" width="100%">'
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/comm/action/index.php
+
11
−
9
View file @
55a4f545
...
...
@@ -439,7 +439,7 @@ if ($_GET["action"] != 'show_day') // View by month
{
$style
=
'cal_other_month'
;
echo
' <td class="'
.
$style
.
'" width="14%" valign="top" nowrap="nowrap">'
;
show_day_events
(
$db
,
$max_day_in_prev_month
+
$tmpday
,
$prev_month
,
$prev_year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
);
show_day_events
(
$db
,
$max_day_in_prev_month
+
$tmpday
,
$prev_month
,
$prev_year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
,
$newparam
);
echo
" </td>
\n
"
;
}
/* Show days of the current month */
...
...
@@ -455,7 +455,7 @@ if ($_GET["action"] != 'show_day') // View by month
$style
=
'cal_current_month'
;
echo
' <td class="'
.
$style
.
'" width="14%" valign="top" nowrap="nowrap">'
;
show_day_events
(
$db
,
$tmpday
,
$month
,
$year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
);
show_day_events
(
$db
,
$tmpday
,
$month
,
$year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
,
$newparam
);
echo
" </td>
\n
"
;
}
/* Show days after the current month (next month) */
...
...
@@ -463,7 +463,7 @@ if ($_GET["action"] != 'show_day') // View by month
{
$style
=
'cal_other_month'
;
echo
' <td class="'
.
$style
.
'" width="14%" valign="top" nowrap="nowrap">'
;
show_day_events
(
$db
,
$tmpday
-
$max_day_in_month
,
$next_month
,
$next_year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
);
show_day_events
(
$db
,
$tmpday
-
$max_day_in_month
,
$next_month
,
$next_year
,
$month
,
$style
,
$actionarray
,
$conf
->
global
->
AGENDA_MAX_EVENTS_DAY_VIEW
,
$maxlength
,
$newparam
);
echo
"</td>
\n
"
;
}
$tmpday
++
;
...
...
@@ -504,15 +504,16 @@ llxFooter('$Date$ - $Revision$');
* @param $day Day
* @param $month Month
* @param $year Year
* @param $monthshown
M
onth shown in calendar view
* @param $monthshown
Current m
onth shown in calendar view
* @param $style Style to use for this day
* @param $actionarray Array of actions
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit)
* @param maxnbofchar Nb of characters to show for event line
* @param companystatic Object thirdparty
* @param contactstatic Object contact
* @param $maxnbofchar Nb of characters to show for event line
* @param $newparam Parameters on current URL
* @param $companystatic Object thirdparty
* @param $contactstatic Object contact
*/
function
show_day_events
(
$db
,
$day
,
$month
,
$year
,
$monthshown
,
$style
,
&
$actionarray
,
$maxPrint
=
0
,
$maxnbofchar
=
14
)
function
show_day_events
(
$db
,
$day
,
$month
,
$year
,
$monthshown
,
$style
,
&
$actionarray
,
$maxPrint
=
0
,
$maxnbofchar
=
14
,
$newparam
=
''
)
{
global
$user
,
$conf
,
$langs
;
global
$filter
,
$filtera
,
$filtert
,
$filterd
,
$status
;
...
...
@@ -531,7 +532,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
print
'</td><td align="right" nowrap="nowrap">'
;
if
(
$user
->
rights
->
agenda
->
myactions
->
create
||
$user
->
rights
->
agenda
->
allactions
->
create
)
{
print
'<a href="'
.
DOL_URL_ROOT
.
'/comm/action/fiche.php?action=create&datep='
.
sprintf
(
"%04d%02d%02d"
,
$year
,
$month
,
$day
)
.
'&backtopage='
.
urlencode
(
$_SERVER
[
"PHP_SELF"
])
.
'">'
;
//$param='month='.$monthshown.'&year='.$year;
print
'<a href="'
.
DOL_URL_ROOT
.
'/comm/action/fiche.php?action=create&datep='
.
sprintf
(
"%04d%02d%02d"
,
$year
,
$month
,
$day
)
.
'&backtopage='
.
urlencode
(
$_SERVER
[
"PHP_SELF"
]
.
(
$newparam
?
'?'
.
$newparam
:
''
))
.
'">'
;
print
img_picto
(
$langs
->
trans
(
"NewAction"
),
'edit_add.png'
);
print
'</a>'
;
}
...
...
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