Révision 389fb945
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/webform/includes/webform.submissions.inc | ||
---|---|---|
95 | 95 |
* The existing submission SID. |
96 | 96 |
*/ |
97 | 97 |
function webform_submission_update($node, $submission) { |
98 |
$transaction = db_transaction(); |
|
98 | 99 |
// Allow other modules to modify the submission before saving. |
99 | 100 |
foreach (module_implements('webform_submission_presave') as $module) { |
100 | 101 |
$function = $module . '_webform_submission_presave'; |
... | ... | |
145 | 146 |
* The new submission SID. |
146 | 147 |
*/ |
147 | 148 |
function webform_submission_insert($node, $submission) { |
149 |
$transaction = db_transaction(); |
|
148 | 150 |
// The submission ID may already be set if being called as an update. |
149 | 151 |
if (!isset($submission->sid) && (!isset($submission->is_new) || $submission->is_new == FALSE)) { |
150 | 152 |
// Allow other modules to modify the submission before saving. |
... | ... | |
191 | 193 |
* The webform submission object to be deleted from the database. |
192 | 194 |
*/ |
193 | 195 |
function webform_submission_delete($node, $submission) { |
196 |
$transaction = db_transaction(); |
|
194 | 197 |
// Iterate through all components and let each do cleanup if necessary. |
195 | 198 |
foreach ($node->webform['components'] as $cid => $component) { |
196 | 199 |
if (isset($submission->data[$cid])) { |
... | ... | |
507 | 510 |
|
508 | 511 |
// Determine the mode in which we're displaying this submission. |
509 | 512 |
$mode = ($format != 'form') ? 'display' : 'form'; |
510 |
if (strpos(request_uri(), 'print/') !== FALSE) {
|
|
513 |
if (strpos(request_path(), 'print/') !== FALSE) {
|
|
511 | 514 |
$mode = 'print'; |
512 | 515 |
} |
513 |
if (strpos(request_uri(), 'printpdf/') !== FALSE) {
|
|
516 |
if (strpos(request_path(), 'printpdf/') !== FALSE) {
|
|
514 | 517 |
$mode = 'pdf'; |
515 | 518 |
} |
516 | 519 |
|
... | ... | |
663 | 666 |
} |
664 | 667 |
|
665 | 668 |
/** |
666 |
* Print a Webform submission for display on a page or in an e-mail. |
|
669 |
* Prepare a Webform submission for display on a page or in an e-mail. |
|
670 |
* |
|
671 |
* @param object $node |
|
672 |
* The node object. |
|
673 |
* @param object $submission |
|
674 |
* The submission object. |
|
675 |
* @param array $email |
|
676 |
* The email configuration array. |
|
677 |
* @param string $format |
|
678 |
* The format the form should be displayed as. May be one of the following: |
|
679 |
* - form: Show as an editable form. |
|
680 |
* - html: Show as HTML results. |
|
681 |
* - text: Show as plain text. |
|
682 |
* @param array $excluded_components |
|
683 |
* An array of components to exclude as cid. |
|
684 |
* |
|
685 |
* @return array |
|
686 |
* A renderable array of the submission. |
|
667 | 687 |
*/ |
668 | 688 |
function webform_submission_render($node, $submission, $email, $format, $excluded_components = NULL) { |
669 | 689 |
$component_tree = array(); |
... | ... | |
948 | 968 |
if ($uid === 0) { |
949 | 969 |
$submissions = isset($_SESSION['webform_submission']) ? $_SESSION['webform_submission'] : NULL; |
950 | 970 |
if ($submissions) { |
951 |
$query->condition('ws.sid', $submissions, 'IN');
|
|
971 |
$query->condition('ws.sid', array_keys($submissions), 'IN');
|
|
952 | 972 |
} |
953 | 973 |
else { |
954 | 974 |
// Intentionally never match anything if the anonymous user has no |
Formats disponibles : Unified diff
Weekly update of contrib modules