コード例 #1
0
 /**
  * If the whiteboard menu plugin isnt installed, show the storyboard menu instead
  *
  * @return null|string
  */
 function menu()
 {
     if (!plugin_is_installed('WhiteboardMenu') && plugin_config_get('ShowMenu') && $this->getUserHasLevel()) {
         return '<a href="' . plugin_page('storyboard_index') . '">' . plugin_lang_get('menu_title') . '</a>';
     }
     return null;
 }
コード例 #2
0
ファイル: Scrum.php プロジェクト: rombert/scrum
	public function menu($event)
	{
		$links = array();
		$links[] = '<a href="' . plugin_page("board") . '">' . plugin_lang_get("board") . '</a>';

		return $links;
	}
コード例 #3
0
 public function __construct()
 {
     plugin_push_current('CustomerManagement');
     $this->title = plugin_lang_get('customer_group');
     $this->column = 'customer_group';
     plugin_pop_current();
 }
コード例 #4
0
 function agileMantisStatusColorsAndNames($task_status)
 {
     switch ($task_status) {
         default:
         case '1':
             $status['name'] = plugin_lang_get('status_new');
             $status['color'] = '#FCBDBD';
             break;
         case '2':
             $status['name'] = plugin_lang_get('status_assigned');
             $status['color'] = '#C2DFFF';
             break;
         case '3':
             $status['name'] = plugin_lang_get('status_confirmed');
             $status['color'] = '#FFF494';
             break;
         case '4':
             $status['name'] = plugin_lang_get('status_resolved');
             $status['color'] = '#D2F5B0';
             break;
         case '5':
             $status['name'] = plugin_lang_get('status_closed');
             $status['color'] = '#c9ccc4';
             break;
     }
     return $status;
 }
コード例 #5
0
 public function __construct()
 {
     plugin_push_current('CustomerManagement');
     $this->title = plugin_lang_get('is_billable');
     $this->column = 'is_billable';
     plugin_pop_current();
 }
コード例 #6
0
 public function __construct()
 {
     plugin_push_current('CustomerManagement');
     $this->title = plugin_lang_get('invoice');
     $this->field = 'invoice';
     $this->type = FILTER_TYPE_STRING;
     plugin_pop_current();
 }
コード例 #7
0
 public function __construct()
 {
     plugin_push_current('CustomerManagement');
     $this->title = plugin_lang_get('customer_group');
     $this->field = 'customer';
     $this->type = FILTER_TYPE_MULTI_INT;
     plugin_pop_current();
 }
コード例 #8
0
 /**
  * When updating user preferences, allowing the user or admin to specify
  * a version control username to be associated with the account.
  * @param string Event name
  * @param int User ID
  */
 function account_update_form($p_event, $p_user_id)
 {
     if (!access_has_global_level(config_get('plugin_Source_username_threshold'))) {
         return;
     }
     $t_user = SourceUser::load($p_user_id);
     echo '<tr ', helper_alternate_class(), '><td class="category">', plugin_lang_get('vcs_username', 'Source'), '<input type="hidden" name="Source_vcs" value="1"/></td><td>', '<input name="Source_vcs_username" value="', $t_user->username, '"/></td></tr>';
 }
コード例 #9
0
ファイル: config.php プロジェクト: CarlosPinedaT/agileMantis
function lang_get_failsave_custom_field($p_custom_field_name)
{
    if (lang_exists($p_custom_field_name, lang_get_current())) {
        $t_str = lang_get($p_custom_field_name);
    } else {
        $t_str = plugin_lang_get($p_custom_field_name);
    }
    return $t_str;
}
コード例 #10
0
ファイル: XmlImportExport.php プロジェクト: rombert/mantisbt
	function install() {
		$result = extension_loaded("xmlreader") && extension_loaded("xmlwriter");
		if ( ! $result ) {
			#\todo returning false should trigger some error reporting, needs rethinking error_api
			error_parameters( plugin_lang_get( 'error_no_xml' ) );
			trigger_error( ERROR_PLUGIN_INSTALL_FAILED, ERROR );
		}
		return $result;
	}
コード例 #11
0
 function register()
 {
     $this->name = plugin_lang_get('plugin_title');
     $this->description = plugin_lang_get('plugin_description');
     $this->page = 'config.php';
     $this->version = '0.1.4';
     $this->requires = array('MantisCore' => '1.3.0');
     $this->author = 'Hennes Hervé';
     $this->url = 'http://www.h-hennes.fr';
 }
コード例 #12
0
 /**
  * A method that populates the plugin information and minimum requirements.
  * 
  * @return  void
  */
 public function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->version = '1.1.1';
     $this->requires = array('MantisCore' => '1.2.0, 1.3.0');
     $this->author = 'Frank Bültge';
     $this->contact = '*****@*****.**';
     $this->url = 'https://github.com/bueltge/Chosen-for-MantisBT';
 }
コード例 #13
0
ファイル: FilterBugList.php プロジェクト: fg-ok/codev
 /**
  *  A method that populates the plugin information and minimum requirements.
  */
 function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->version = '1.0.0';
     $this->requires = array('MantisCore' => '1.2.0');
     $this->author = 'Alain D\'EURVEILHER';
     $this->contact = '*****@*****.**';
     $this->url = 'https://github.com/mantisbt-plugins/FilterBugList';
 }
コード例 #14
0
 public function register()
 {
     $this->name = plugin_lang_get('name');
     $this->description = plugin_lang_get('description');
     $this->page = 'config_page';
     $this->version = self::VERSION;
     $this->requires = ['MantisCore' => '1.2.0'];
     $this->author = 'Andrzej Kupczyk';
     $this->contact = '*****@*****.**';
     $this->url = 'http://andrzejkupczyk.pl';
 }
コード例 #15
0
 function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->page = 'config_main';
     $this->version = '1.0';
     $this->requires = array('MantisCore' => '1.2.0');
     $this->author = 'AcanthiS';
     $this->contact = '*****@*****.**';
     $this->url = 'https://github.com/mantisbt-plugins/jabber-notify';
 }
コード例 #16
0
ファイル: MantisAcra.php プロジェクト: since2014/MantisAcra
 /**
  *  A method that populates the plugin information and minimum requirements.
  */
 function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->page = '';
     $this->version = '2.0';
     $this->requires = array('MantisCore' => '1.2.0', 'jQuery' => '1.8.2');
     $this->author = 'Sam';
     $this->contact = '*****@*****.**';
     $this->url = 'http://www.mantisbt.org';
 }
コード例 #17
0
function display_strategies($p_type = null)
{
    if (is_null($p_type)) {
        echo '<option value="0">', plugin_lang_get('select_one'), '</option>';
    }
    echo '<option value="', SOURCE_EXPLICIT, '"', $p_type == SOURCE_EXPLICIT ? ' selected="selected"' : '', '>', plugin_lang_get('mapping_explicit'), '</option>';
    if (!Source_PVM()) {
        echo '<option value="', SOURCE_NEAR, '"', $p_type == SOURCE_NEAR ? ' selected="selected"' : '', '>', plugin_lang_get('mapping_near'), '</option>', '<option value="', SOURCE_FAR, '"', $p_type == SOURCE_FAR ? ' selected="selected"' : '', '>', plugin_lang_get('mapping_far'), '</option>';
        echo '<option value="', SOURCE_FIRST, '"', $p_type == SOURCE_FIRST ? ' selected="selected"' : '', '>', plugin_lang_get('mapping_first'), '</option>', '<option value="', SOURCE_LAST, '"', $p_type == SOURCE_LAST ? ' selected="selected"' : '', '>', plugin_lang_get('mapping_last'), '</option>';
    }
}
コード例 #18
0
 public function display($p_bug, $p_columns_target)
 {
     plugin_push_current('Timecard');
     $p_bug_id = $p_bug->id;
     $t_bug = TimecardBug::load($p_bug_id, true);
     $t_bug->calculate();
     if ($t_bug->estimate >= 0) {
         echo $t_bug->estimate, plugin_lang_get('hours');
     }
     plugin_pop_current();
 }
コード例 #19
0
 /**
  * A method that populates the plugin information and minimum requirements.
  * @return void
  */
 function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->page = 'config_page';
     $this->version = '1.0.0';
     $this->requires = array('MantisCore' => '1.3.0');
     $this->author = 'Victor Boctor';
     $this->contact = '*****@*****.**';
     $this->url = 'http://www.mantishub.com';
 }
コード例 #20
0
 function menu()
 {
     require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'userprojectapi.php';
     if (!userprojectapi::checkPluginIsRegisteredInWhiteboardMenu()) {
         userprojectapi::addPluginToWhiteboardMenu();
     }
     if ((!plugin_is_installed('WhiteboardMenu') || !file_exists(config_get_global('plugin_path') . 'WhiteboardMenu')) && plugin_config_get('ShowMenu') && $this->getUserHasLevel()) {
         return '<a href="' . plugin_page('UserProject') . '&sortVal=userName&sort=ASC">' . plugin_lang_get('menu_title') . '</a>';
     }
     return null;
 }
コード例 #21
0
ファイル: Piwik.php プロジェクト: Jguilbaud/mantispluginPiwik
	/**
	 *  A method that populates the plugin information and minimum requirements.
	 */
	function register() {
		$this->name = 'Piwik';
		$this->description = plugin_lang_get( 'description' );
		$this->version = '1.0';
		$this->requires = array(
			'MantisCore' => '1.2.0',
		);
		$this->page = 'config';
		$this->author = 'Johan Guilbaud';
		$this->contact = '*****@*****.**';
		$this->url = 'http://www.lapinkiller.fr';
	}
コード例 #22
0
 /**
  * Chapter Title Element
  * @param $num
  * @param $label
  * @param $option_show_duration
  * @param $chapter_duration
  */
 function ChapterTitle($num, $label, $option_show_duration, $chapter_duration)
 {
     $this->SetFont('Arial', 'B', 12);
     $this->SetFillColor(192, 192, 192);
     if ($option_show_duration == '1' && $chapter_duration > 0) {
         $this->Cell(95, 6, "{$num} {$label}", 0, 0, 'L', 1);
         $this->Cell(95, 6, utf8_decode(plugin_lang_get('editor_work_package_duration')) . ': ' . $chapter_duration . ' ' . plugin_lang_get('editor_duration_unit'), 0, 0, 'R', 1);
     } else {
         $this->Cell(0, 6, "{$num} {$label}", 0, 0, 'L', 1);
     }
     $this->SetFont('Arial', '', 12);
     $this->Ln(8);
 }
コード例 #23
0
 function menu_main()
 {
     $t_links = array();
     if (plugin_config_get('show_repo_link')) {
         $t_page = plugin_page('index', false, 'Source');
         $t_lang = plugin_lang_get('repositories', 'Source');
         $t_links[] = "<a href=\"{$t_page}\">{$t_lang}</a>";
     }
     if (plugin_config_get('show_search_link')) {
         $t_page = plugin_page('search_page', false, 'Source');
         $t_lang = plugin_lang_get('search', 'Source');
         $t_links[] = "<a href=\"{$t_page}\">{$t_lang}</a>";
     }
     return $t_links;
 }
コード例 #24
0
ファイル: Lightbox.php プロジェクト: santoja/Lightbox
 function register()
 {
     $this->name = plugin_lang_get('title');
     $this->description = plugin_lang_get('description');
     $this->version = '0.2.1';
     $this->page = 'config';
     $this->requires = array('MantisCore' => '>=1.2, <1.4');
     // don't need jQuery in Mantis >= 1.3.0
     if (version_compare(MANTIS_VERSION, '1.3', '<') === true) {
         $this->requires['jQuery'] = '>= 1.11.0';
     }
     $this->author = 'Karim Ratib and Kaue Santoja';
     $this->contact = '*****@*****.**';
     $this->url = 'https://github.com/santoja/Lightbox';
 }
コード例 #25
0
/**
 * @param $print_flag
 */
function calculate_page_content($print_flag)
{
    $specmanagement_database_api = new specmanagement_database_api();
    $specmanagement_print_api = new specmanagement_print_api();
    $specmanagement_editor_api = new specmanagement_editor_api();
    $version_id = $_POST['version_id'];
    $version_spec_bug_ids = $specmanagement_database_api->get_version_spec_bugs(version_get_field($version_id, 'version'));
    if (!is_null($version_spec_bug_ids)) {
        /** get bug and work package data */
        $plugin_version_obj = $specmanagement_database_api->get_plugin_version_row_by_version_id($version_id);
        $p_version_id = $plugin_version_obj[0];
        foreach ($version_spec_bug_ids as $version_spec_bug_id) {
            $p_source_row = $specmanagement_database_api->get_source_row($version_spec_bug_id);
            if (is_null($p_source_row[2])) {
                $specmanagement_database_api->update_source_row($version_spec_bug_id, $p_version_id, '');
            }
        }
        $work_packages = $specmanagement_database_api->get_document_spec_workpackages($p_version_id);
        asort($work_packages);
        $no_work_package_bug_ids = $specmanagement_database_api->get_workpackage_spec_bugs($p_version_id, '');
        /** get type options */
        $type_string = $specmanagement_database_api->get_type_string($specmanagement_database_api->get_type_by_version($version_id));
        $type_id = $specmanagement_database_api->get_type_id($type_string);
        $type_row = $specmanagement_database_api->get_type_row($type_id);
        $type_options = explode(';', $type_row[2]);
        /** generate and print page content */
        $specmanagement_editor_api->print_document_head($type_string, $version_id, $version_spec_bug_ids, $print_flag);
        if ($type_options[2] == '1') {
            $specmanagement_editor_api->print_directory($p_version_id, $work_packages, $no_work_package_bug_ids, $type_options[0], $print_flag);
        }
        $specmanagement_editor_api->print_editor_table_head($print_flag);
        $specmanagement_editor_api->generate_content($p_version_id, $work_packages, $no_work_package_bug_ids, $type_options[0], true, $print_flag);
        echo '</table>';
        if ($type_options[1] == '1') {
            $specmanagement_editor_api->print_expenses_overview($work_packages, $p_version_id, $print_flag, $no_work_package_bug_ids);
        }
    } else {
        echo '<br/>';
        $specmanagement_editor_api->print_editor_table_head($print_flag);
        echo '<tr><td class="center">';
        echo plugin_lang_get('editor_no_issues');
        echo '</td></tr>';
        $specmanagement_print_api->printTableFoot();
    }
}
コード例 #26
0
 /**
  * Builds notification emails for the selected customers about changes made in bugs reports they are linked to
  *
  * @param array $customer_ids the ids of the customer to notify
  * @param string $from the start of the interval
  * @param string $to the end of the interval
  *
  * @return array notified customers
  */
 static function buildNotificationEmails($customer_ids, $from, $to)
 {
     $emails = array();
     lang_push(plugin_config_get('email_notification_language'));
     $fromDate = self::startOfDay(strtotime($from));
     $toDate = self::endOfDay(strtotime($to));
     $changedBugIds = CustomerManagementDao::findAllChangedBugIds($customer_ids, $fromDate, $toDate);
     $dateFormat = config_get('short_date_format');
     foreach ($customer_ids as $customer_id) {
         $changesForCustomer = array();
         foreach ($changedBugIds as $changedBugId) {
             if ($changedBugId['customer_id'] == $customer_id) {
                 $changesForCustomer[] = array('bug' => bug_get($changedBugId['bug_id']));
             }
         }
         if (count($changesForCustomer) > 0) {
             $counter = 0;
             $text = '';
             foreach ($changesForCustomer as $changeForCustomer) {
                 $counter++;
                 $bugId = $changeForCustomer['bug']->id;
                 $text .= $counter . '. ';
                 $text .= sprintf(plugin_lang_get('email_notification_bug_header'), $changeForCustomer['bug']->id, $changeForCustomer['bug']->summary, date($dateFormat, $changeForCustomer['bug']->date_submitted), get_enum_element('status', $changeForCustomer['bug']->status));
                 $text .= "\n";
                 $reporterName = user_get_name($changeForCustomer['bug']->reporter_id);
                 $reporterEmail = user_get_email($changeForCustomer['bug']->reporter_id);
                 $text .= sprintf(plugin_lang_get('email_notification_bug_reported_by'), $reporterName, $reporterEmail);
                 $text .= "\n";
                 $text .= sprintf(plugin_lang_get('email_notification_bug_description'), $changeForCustomer['bug']->description);
                 $text .= "\n\n";
             }
             $customer = CustomerManagementDao::getCustomer($customer_id);
             $email = new EmailData();
             $email->email = $customer['email'];
             $email->subject = sprintf(plugin_lang_get('email_notification_title'), $customer['name'], $from, $to);
             $email->body = $text;
             $email->metadata['priority'] = config_get('mail_priority');
             $email->metadata['charset'] = 'utf-8';
             array_push($emails, $email);
         }
     }
     lang_pop();
     return $emails;
 }
コード例 #27
0
ファイル: worklog.php プロジェクト: pinke/worklog
 function worklogmenu()
 {
     if (ON == plugin_config_get('promote_text')) {
         $bugid = gpc_get_int('id');
         if (access_has_bug_level(plugin_config_get('promote_threshold'), $bugid)) {
             $t_bug_p = bug_get($bugid, true);
             if (OFF == plugin_config_get('project_text')) {
                 $proj_id = 0;
             } else {
                 $proj_id = $t_bug_p->project_id;
             }
             $subject = urlencode($t_bug_p->description);
             $subject .= " ";
             $subject .= urlencode($t_bug_p->additional_information);
             $content = category_full_name($t_bug_p->category_id);
             $content .= " -> ";
             $content .= urlencode($t_bug_p->summary);
             if (ON == plugin_config_get('worklog_view_check')) {
                 $import_page = 'worklog_add_page2.php';
             } else {
                 $import_page = 'worklog_add.php';
             }
             $import_page .= '&log_type=0&';
             $import_page .= '&ref_log_ids=';
             $import_page .= '&ref_issue_ids=';
             $import_page .= '&log_begin=';
             $import_page .= '&log_end=';
             $import_page .= '&content=';
             $import_page .= $content;
             $import_page .= '&subject=';
             $import_page .= $subject;
             $import_page .= '&project_id=';
             $import_page .= $proj_id;
             if (ON == plugin_config_get('worklog_view_check')) {
                 return array(plugin_lang_get('import_worklog') => plugin_page($import_page) . '" target=_new>');
             } else {
                 return array(plugin_lang_get('import_worklog') => plugin_page($import_page));
             }
         }
     }
 }
/**
 * @param $print_flag
 */
function calculate_page_content($print_flag)
{
    $specmanagement_print_api = new specmanagement_print_api();
    html_page_top1(plugin_lang_get('menu_versgraph'));
    echo '<link rel="stylesheet" href="' . SPECMANAGEMENT_PLUGIN_URL . 'files/specmanagement.css">';
    if (!$print_flag) {
        html_page_top2();
        if (plugin_is_installed('WhiteboardMenu') && file_exists(config_get_global('plugin_path') . 'WhiteboardMenu')) {
            require_once WHITEBOARDMENU_CORE_URI . 'whiteboard_print_api.php';
            $whiteboard_print_api = new whiteboard_print_api();
            $whiteboard_print_api->printWhiteboardMenu();
        }
        $specmanagement_print_api->print_plugin_menu();
        echo '<div align="center">';
        echo '<hr size="1" width="100%" />';
    }
    print_table($print_flag);
    if (!$print_flag) {
        html_page_bottom1();
    }
}
function calculate_page_content()
{
    $specmanagement_database_api = new specmanagement_database_api();
    $specmanagement_print_api = new specmanagement_print_api();
    $types = array();
    $types_rows = $specmanagement_database_api->get_full_types();
    foreach ($types_rows as $types_row) {
        $types[] = $types_row[1];
    }
    html_page_top1(plugin_lang_get('select_doc_title'));
    echo '<link rel="stylesheet" href="' . SPECMANAGEMENT_PLUGIN_URL . 'files/specmanagement.css">';
    html_page_top2();
    //   if ( plugin_is_installed( 'WhiteboardMenu' ) && file_exists ( config_get_global ( 'plugin_path' ) . 'WhiteboardMenu' ) )
    //   {
    //      require_once WHITEBOARDMENU_CORE_URI . 'whiteboard_print_api.php';
    //      $whiteboard_print_api = new whiteboard_print_api();
    //      $whiteboard_print_api->printWhiteboardMenu();
    //   }
    if (project_includes_user(helper_get_current_project(), auth_get_current_user_id()) || helper_get_current_project() == 0 || user_is_administrator(auth_get_current_user_id())) {
        echo '<div align="center">';
        echo '<hr size="1" width="50%" />';
        $specmanagement_print_api->printTableTop('50');
        $specmanagement_print_api->printFormTitle(2, 'menu_title');
        $specmanagement_print_api->printCategoryField(1, 1, 'select_type');
        echo '<td>';
        echo '<form method="post" name="form_set_source" action="' . plugin_page('editor') . '">';
        print_document_selection($types);
        $specmanagement_print_api->printRow();
        echo '<td class="center" colspan="2">';
        echo '<input type="submit" name="formSubmit" class="button" value="' . plugin_lang_get('select_confirm') . '"/>';
        echo '</td>';
        echo '</tr>';
        echo '</form>';
        echo '</td>';
        $specmanagement_print_api->printTableFoot();
    } else {
        echo '<table class="width60"><tr><td class="center">' . lang_get('access_denied') . '</td></tr></table>';
    }
    html_page_bottom1();
}
コード例 #30
0
 function menu()
 {
     if (plugin_config_get('show_menu')) {
         require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'wmApi.php';
         $projectId = helper_get_current_project();
         $userId = auth_get_current_user_id();
         $userAccessLevel = user_get_access_level($userId, $projectId);
         $whiteboardPlugins = wmApi::getWhiteboardPlugins();
         $showMenu = false;
         foreach ($whiteboardPlugins as $whiteboardPlugin) {
             $pluginAccessLevel = $whiteboardPlugin[2];
             if (user_is_administrator($userId) || $userAccessLevel >= $pluginAccessLevel) {
                 $showMenu = true;
                 break;
             }
         }
         if ($showMenu) {
             return '<a href="' . plugin_page('whiteboard_menu') . '">' . plugin_lang_get('menu_title') . '</a>';
         }
     }
     return null;
 }