Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //require_once( config_get( 'class_path' ) . 'MantisPlugin.class.php' );
- //require_once( 'core.php' );
- //echo '<p>Here is a link to <a href="', plugin_page( 'dyzurny' ), '">page foo</a>.</p>';
- class dyzurnyPlugin extends MantisPlugin {
- function register() {
- $this->name = 'dyzurny';
- $this->description = 'niestrudzony dyzurny';
- $this->page = 'config';
- $this->version = '1.0';
- $this->requires = array(
- 'MantisCore' => '1.2',
- );
- $this->author = 'XXX';
- $this->contact = 'XXX';
- $this->url = 'XXX';
- }
- function init() {
- plugin_event_hook( 'EVENT_PLUGIN_INIT', 'header' );
- }
- function config() {
- return array(
- 'plugin_dyzurny_do' => 'XXX',
- 'plugin_dyzurny_ukopia' => 'XXX',
- );
- }
- function header() {
- header( 'X-Mantis: This Mantis has super cow powers.');
- }
- function install() {
- plugin_config_set('plugin_dyzurny_do','XXX');
- plugin_config_set('plugin_dyzurny_ukopia','XXX');
- return (TRUE);
- }
- function events() {
- return array(
- 'EVENT_DYZURNY_FOO' => EVENT_TYPE_EXECUTE,
- );
- }
- function hooks()
- {
- $hooks = array(
- //'EVENT_CORE_READY' => 'dyzurny_fun',
- 'EVENT_UPDATE_BUG' => 'bug_fun',
- );
- return $hooks;
- }
- function dyzurny_fun() {
- echo '<br/>';
- echo 'dupa!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!';
- echo '<br/>';
- }
- //function bug_fun( $p_event, $p_bug_data, $p_bug_id ) {
- function bug_fun($p_event, $p_params) {
- //require_once( 'core.php' );
- require_once( 'bug_api.php' );
- require_once( 'custom_field_api.php' );
- require_once( 'file_api.php' );
- require_once( 'date_api.php' );
- require_once( 'relationship_api.php' );
- require_once( 'last_visited_api.php' );
- require_once( 'tag_api.php' );
- //$f_bug_id = gpc_get_int( 'id' );
- //bug_ensure_exists( $f_bug_id );
- //$tpl_bug = bug_get( $f_bug_id, true );
- $f_bug_id = gpc_get_int( 'bug_id' );
- $f_mail_test = gpc_get_bool( 'mail_test' );
- require_once( 'current_user_api.php' );
- # grab the user id currently logged in
- $t_user_id = auth_get_current_user_id();
- # get the bugnote data
- $t_bugnote_order = current_user_get_pref( 'bugnote_order' );
- $t_bugnotes = bugnote_get_all_visible_bugnotes( $f_bug_id, $t_bugnote_order, 0, $t_user_id );
- $ourFileName = "dyzurny.txt";
- $fh = fopen($ourFileName, 'w') or die("can't open file");
- //fwrite($fh, $p_params->project_id . "\n");
- fwrite($fh, project_get_name($p_params->project_id) . "\n");
- fwrite($fh, $p_params->reporter_id . "\n");
- fwrite($fh, $p_params->build . "\n");
- fwrite($fh, $p_params->platform . "\n");
- fwrite($fh, $p_params->os . "\n");
- fwrite($fh, $p_params->os_build . "\n");
- fwrite($fh, $p_params->version . "\n");
- fwrite($fh, $p_params->profile_id . "\n");
- fwrite($fh, $p_params->handler_id . "\n");
- fwrite($fh, $p_params->view_state . "\n");
- fwrite($fh, $p_params->category_id . "\n");
- fwrite($fh, $p_params->reproductibility . "\n");
- fwrite($fh, get_enum_element( 'status',$p_params->severity) . "\n");
- fwrite($fh, get_enum_element( 'status',$p_params->priority) . "\n");
- fwrite($fh, $p_params->projection . "\n");
- fwrite($fh, $p_params->eta . "\n");
- fwrite($fh, $p_params->resolution . "\n");
- fwrite($fh, get_enum_element( 'status',$p_params->status) . "\n");
- fwrite($fh, $p_params->summary . "\n");
- fwrite($fh, $p_params->description . "\n");
- fwrite($fh, $p_params->steps_to_reproduce . "\n");
- fwrite($fh, $p_params->additional_information . "\n");
- foreach ($t_bugnotes as $t_bugnote) {
- fwrite($fh, $t_bugnote->note . "\n");
- }
- fclose($fh);
- $t_email_data = new EmailData;
- //$t_email_data->email = config_get_global( 'administrator_email' );
- $t_email_data->email = 'XXX';
- $t_email_data->subject = 'Testing PHP mail() function';
- $t_email_data->body = 'Your PHP mail settings appear to be correctly set.';
- //$t_email_data->metadata['priority'] = config_get( 'mail_priority' );
- $t_email_data->metadata['charset'] = 'utf-8';
- $result = email_send( $t_email_data );
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement