CMS
Version 3.9
clone_survey.inc
Go to the documentation of this file.
1
<?php
2
/**************************************************************
3
4
Copyright (c) 2007,2008 Sonjara, Inc
5
6
Permission is hereby granted, free of charge, to any person
7
obtaining a copy of this software and associated documentation
8
files (the "Software"), to deal in the Software without
9
restriction, including without limitation the rights to use,
10
copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the
12
Software is furnished to do so, subject to the following
13
conditions:
14
15
The above copyright notice and this permission notice shall be
16
included in all copies or substantial portions of the Software.
17
18
Except as contained in this notice, the name(s) of the above
19
copyright holders shall not be used in advertising or otherwise
20
to promote the sale, use or other dealings in this Software
21
without prior written authorization.
22
23
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30
OTHER DEALINGS IN THE SOFTWARE.
31
32
*****************************************************************/
33
34
35
Fakoli::using
(
"survey"
,
"questionnaire"
);
36
37
$survey_id
= checkNumeric($_GET[
"survey_id"
]);
38
39
if
(!
$survey_id
)
40
{
41
Fakoli::end
(
"Clone Survey - unknown survey"
);
42
}
43
44
$survey
=
new
Survey
(
$survey_id
);
45
$mgr
=
new
SurveyDashboardManager
(
$survey
);
46
$form
=
$mgr
->buildCloneForm();
47
48
$form
->submitLabel =
"Save Survey Copy"
;
49
50
if
(
$method
==
"POST"
)
51
{
52
$obj
=&
$form
->data;
53
$obj
->fromPOST();
54
$form
->msg =
$form
->validator->validate();
55
if
(
$form
->msg ==
""
)
56
{
57
$dst =
$mgr
->cloneQuestionnaire();
58
Fakoli::end
(
"OK|{$dst->survey_id}"
);
59
}
60
else
61
{
62
Fakoli::end
(
$form
->msg);
63
}
64
}
65
66
echo
$form
->writeScript();
67
68
$form
->drawForm();
69
70
?>
$obj
$obj
Definition:
data_import_select.inc:29
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
Fakoli\end
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
Definition:
core.inc:1149
SurveyDashboardManager
Definition:
survey_manager.inc:242
Survey
Definition:
survey.inc:53
$form
$form
Definition:
clone_survey.inc:46
$mgr
$mgr
Definition:
clone_survey.inc:45
$survey_id
$survey_id
Definition:
clone_survey.inc:37
$survey
if(! $survey_id) $survey
Definition:
clone_survey.inc:44
$method
$method
Pull out a simple reference to the request method.
Definition:
core.inc:1573
code
cms.sonjara.com
cms
components
survey
handlers
clone_survey.inc
Generated on Tue Mar 23 2021 15:36:14 for CMS by
1.9.1