Location: PHPKode > projects > HelpCORE > helpcore/module_helpcore_secure/incident_details_callbacks.php
<?php

/*
 * HelpCORE source file 
 * ====================
 * 
 * CVS:
 * ----
 * $header$
 * 
 * Purpose:
 * --------
 * Incident Details callbacks
 * 
 * Copyright:
 * ----------
 * Copyright (C) 2002-2003 Dennis Fleurbaaij <hide@address.com>
 * Copyright (C) 2002-2005 IO Software <hide@address.com>
 * 
 * This program is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software Foundation;
 * either version 2 of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this
 * program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, 
 * Cambridge, MA 02139, USA.
 * 
 * Please note that this software is dual licensed. For the commercial use of this 
 * software you will need a Commercial License. Please see http://www.io-software.nl
 * for the terms and conditions.
 * 
 * For more information you can contact IO Software at http://www.io-software.nl
 */

// Only load if CoreAPM is loaded
if( ! isset( $GLOBALS['coreapm'] ) ) {
	die( __FILE__ . '('.__LINE__.'): CoreAPM not set' );	
}

function incident_details_post_insert( $table_name, $id ) {
	if( $GLOBALS['coreapm']->plugin_active( 'files' ) && ( (isset( $_GET['incident_detailsaction'] ) && ( $_GET['incident_detailsaction'] == 'add' )) || (isset( $_POST['incident_detailsaction'] ) && ( $_POST['incident_detailsaction'] == 'insert' )) ) )
		handle_uploads( 'incident_details', $id );
	
	// Go back to the incident's screen after submitting
	$incidentid = getIncidnetID($id);
	$GLOBALS['relational']->reload_to = BASE_URL.'module_helpcore_secure/incidents.php?incidentsaction=show&incidentsshowid='.$incidentid;
	return TRUE;
}
$GLOBALS['coreapm']->plugin_register_relational_callback( 'incident_details', 'post_insert', 'incident_details_post_insert' );

function incident_details_post_update( $table_name, $id ) {
	// Go back to the incident's screen after submitting
	$incidentid = getIncidnetID($id);
	$GLOBALS['relational']->reload_to = BASE_URL.'module_helpcore_secure/incidents.php?incidentsaction=show&incidentsshowid='.$incidentid;
	return TRUE;
}
$GLOBALS['coreapm']->plugin_register_relational_callback( 'incident_details', 'post_update', 'incident_details_post_update' );

function incident_details_pre_delete( $table_name, $id ) {
	// Set id for later redirecting
	$GLOBALS['incident_redirect_id'] = getIncidnetID($id);
	return TRUE;
}
$GLOBALS['coreapm']->plugin_register_relational_callback( 'incident_details', 'pre_delete', 'incident_details_pre_delete' );

function incident_details_post_delete( $table_name, $id ) {
	// Go back to the incident's screen after submitting
	$GLOBALS['relational']->reload_to = BASE_URL.'module_helpcore_secure/incidents.php?incidentsaction=show&incidentsshowid='.$GLOBALS['incident_redirect_id'];
	return TRUE;
}
$GLOBALS['coreapm']->plugin_register_relational_callback( 'incident_details', 'post_delete', 'incident_details_post_delete' );

?>
Return current item: HelpCORE