/application/views/admin/reports/reports_js.php
PHP | 58 lines | 30 code | 8 blank | 20 comment | 7 complexity | 781b9dcec130b217e076b0d893092c8f MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-3.0, BSD-3-Clause, GPL-2.0, LGPL-2.1
- /**
- * Main reports js file.
- *
- * Handles javascript stuff related to reports function.
- *
- * PHP version 5
- * LICENSE: This source file is subject to LGPL license
- * that is available through the world-wide-web at the following URI:
- * http://www.gnu.org/copyleft/lesser.html
- * @author Ushahidi Team <team@ushahidi.com>
- * @package Ushahidi - http://source.ushahididev.com
- * @module API Controller
- * @copyright Ushahidi - http://www.ushahidi.com
- * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
- */
- <?php require SYSPATH.'../application/views/admin/utils_js.php' ?>
- // Ajax Submission
- function reportAction ( action, confirmAction, incident_id )
- {
- var statusMessage;
- if( !isChecked( "incident" ) && incident_id=='' )
- {
- alert('Please select at least one report.');
- } else {
- var answer = confirm('<?php echo Kohana::lang('ui_admin.are_you_sure_you_want_to'); ?> ' + confirmAction + '?')
- if (answer){
-
- // Set Submit Type
- $("#action").attr("value", action);
-
- if (incident_id != '')
- {
- // Submit Form For Single Item
- $("#incident_single").attr("value", incident_id);
- $("#reportMain").submit();
- }
- else
- {
- // Set Hidden form item to 000 so that it doesn't return server side error for blank value
- $("#incident_single").attr("value", "000");
-
- // Submit Form For Multiple Items
- $("#reportMain").submit();
- }
-
- } else {
- return false;
- }
- }
- }
-
- function showLog(id)
- {
- $('#' + id).toggle(400);
- }