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
8a69cdd4
Commit
8a69cdd4
authored
12 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: delete of survey
parent
5c1b3d86
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/opensurvey/class/opensurveysondage.class.php
+5
-3
5 additions, 3 deletions
htdocs/opensurvey/class/opensurveysondage.class.php
htdocs/opensurvey/list.php
+5
-10
5 additions, 10 deletions
htdocs/opensurvey/list.php
with
10 additions
and
13 deletions
htdocs/opensurvey/class/opensurveysondage.class.php
+
5
−
3
View file @
8a69cdd4
...
@@ -337,7 +337,7 @@ class Opensurveysondage extends CommonObject
...
@@ -337,7 +337,7 @@ class Opensurveysondage extends CommonObject
*
*
* @param User $user User that deletes
* @param User $user User that deletes
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @param string $numsondageadmin Num sondage to delete
* @param string $numsondageadmin Num sondage
admin
to delete
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, >0 if OK
*/
*/
function
delete
(
$user
,
$notrigger
,
$numsondageadmin
)
function
delete
(
$user
,
$notrigger
,
$numsondageadmin
)
...
@@ -345,6 +345,8 @@ class Opensurveysondage extends CommonObject
...
@@ -345,6 +345,8 @@ class Opensurveysondage extends CommonObject
global
$conf
,
$langs
;
global
$conf
,
$langs
;
$error
=
0
;
$error
=
0
;
$numsondage
=
substr
(
$numsondageadmin
,
0
,
16
);
$this
->
db
->
begin
();
$this
->
db
->
begin
();
if
(
!
$error
)
if
(
!
$error
)
...
@@ -366,10 +368,10 @@ class Opensurveysondage extends CommonObject
...
@@ -366,10 +368,10 @@ class Opensurveysondage extends CommonObject
if
(
!
$error
)
if
(
!
$error
)
{
{
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_comments WHERE id_sondage
_admin
= '"
.
$numsondage
admin
.
"'"
;
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_comments WHERE id_sondage = '"
.
$numsondage
.
"'"
;
dol_syslog
(
get_class
(
$this
)
.
"::delete sql="
.
$sql
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::delete sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_user_studs WHERE id_sondage
_admin
= '"
.
$numsondage
admin
.
"'"
;
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_user_studs WHERE id_sondage = '"
.
$numsondage
.
"'"
;
dol_syslog
(
get_class
(
$this
)
.
"::delete sql="
.
$sql
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
"::delete sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$this
->
db
->
query
(
$sql
);
$resql
=
$this
->
db
->
query
(
$sql
);
...
...
This diff is collapsed.
Click to expand it.
htdocs/opensurvey/list.php
+
5
−
10
View file @
8a69cdd4
...
@@ -27,6 +27,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
...
@@ -27,6 +27,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
$action
=
GETPOST
(
'action'
);
$action
=
GETPOST
(
'action'
);
$id
=
GETPOST
(
'id'
);
$id
=
GETPOST
(
'id'
);
$numsondage
=
substr
(
$id
,
0
,
16
);
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
if
(
!
$sortorder
)
$sortorder
=
"ASC"
;
if
(
!
$sortfield
)
$sortfield
=
"p.titre"
;
if
(
!
$sortfield
)
$sortfield
=
"p.titre"
;
...
@@ -45,15 +46,9 @@ if ($action == 'delete_confirm')
...
@@ -45,15 +46,9 @@ if ($action == 'delete_confirm')
{
{
$db
->
begin
();
$db
->
begin
();
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_comments WHERE id_sondage_admin = '"
.
$id
.
"'"
;
$object
=
new
Opensurveysondage
(
$db
);
dol_syslog
(
"Delete poll sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$db
->
query
(
$sql
);
$result
=
$object
->
delete
(
$user
,
''
,
$numsondageadmin
);
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_user_studs WHERE id_sondage_admin = '"
.
$id
.
"'"
;
dol_syslog
(
"Delete poll sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$db
->
query
(
$sql
);
$sql
=
'DELETE FROM '
.
MAIN_DB_PREFIX
.
"opensurvey_sondage WHERE id_sondage_admin = '"
.
$id
.
"'"
;
dol_syslog
(
"Delete poll sql="
.
$sql
,
LOG_DEBUG
);
$resql
=
$db
->
query
(
$sql
);
$db
->
commit
();
$db
->
commit
();
}
}
...
...
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