コード例 #1
0
ファイル: install_step4.php プロジェクト: fg-ok/codev
function displayPage()
{
    // relative path ("./" or "../")
    // absolute path is preferable for IE/W3C compatibility
    $rootWebSite = is_null(Constants::$codevURL) ? '../' : Constants::$codevURL;
    if ('/' !== substr($rootWebSite, -1)) {
        $rootWebSite .= '/';
    }
    $rootMantisURL = is_null(Constants::$mantisURL) ? '../../mantis/' : Constants::$mantisURL;
    if ('/' !== substr($rootMantisURL, -1)) {
        $rootMantisURL .= '/';
    }
    echo "<h1 class='center'>Manual steps</h1>";
    echo "<div style='margin-top:6em;'>";
    // check global configuration
    $cerrList = ConsistencyCheck2::checkMantisDefaultProjectWorkflow();
    if (count($cerrList) > 0) {
        echo "<h2>" . T_("Create a default project workflow in Mantis") . "</h2>";
        echo "<span class='help_font'>" . T_("The Mantis default workflow is not load in the database unless you change it with the Mantis administration GUI.") . "</span>";
        echo '<ul>';
        echo '<li>' . T_("Login to Mantis as 'Administrator'.") . '</li>';
        echo '<li>' . T_("Select project 'All projects'") . '</li>';
        echo '<li>' . T_("Go to") . " <a href=' " . $rootMantisURL . "manage_config_workflow_page.php' target='_blank't>" . T_("manage workflow transitions") . '</a></li>';
        echo '<li>' . T_("Change the workflow (change one of the 'next status' checkboxes)") . '</li>';
        echo '<li>' . T_("Click the 'Update Configuration' button") . '</li>';
        echo '<li>' . T_("Rollback the workflow to the initial state") . '</li>';
        echo '<li>' . T_("Click the 'Update Configuration' button again") . '</li>';
        echo '</ul>';
        echo '<br>';
    }
    echo "<h2>" . T_("Check Mantis Plugins") . "</h2>";
    echo '<ul>';
    echo '<li>' . T_("Login to Mantis as 'Administrator'.") . '</li>';
    echo '<li>' . T_("Go to") . " <a href=' " . $rootMantisURL . "manage_plugin_page.php' target='_blank't>" . T_("manage plugins") . '</a></li>';
    echo '<li>' . T_('Check that the <b>CodevTT</b> plugin is installed and activated.') . '</li>';
    echo '<li>' . T_('Check that the <b>FilterBugList</b> plugin is installed and activated') . '</li>';
    echo '</ul>';
    echo '<br>';
    echo "<h2>" . T_("Install Firefox Greasemonkey addon") . "</h2>";
    echo "<span class='help_font'>" . T_("Note: This step is optional") . "</span>";
    echo "<ul>\n         <li>" . T_("Install addon:") . " <a href='https://addons.mozilla.org/fr/firefox/addon/greasemonkey/' target='_blank't>greasemonkey</a></li>\n         <li>" . T_("Load script:") . " <a href='" . $rootWebSite . "mantis_monkey.user.js' target='_blank't>mantis_monkey.user.js</a></li>\n         </ul>";
    echo "</div>";
    echo "<div  style='text-align: center;'>\n";
    echo "<input type=button style='font-size:150%' value='" . T_("Done !") . "' onClick=\"location.href='install_step5.php'\">\n";
    echo "</div>\n";
}
コード例 #2
0
ファイル: index.php プロジェクト: fg-ok/codev
 protected function display()
 {
     // Drifted tasks
     if (Tools::isConnectedUser()) {
         $isAdmin = $this->session_user->isTeamMember(Config::getInstance()->getValue(Config::id_adminTeamId));
         $isManager = $this->session_user->isTeamManager($this->teamid);
         // check codevtt version
         if (1 == Constants::$isCheckLatestVersion) {
             try {
                 if ($isAdmin || $isManager && date('d') < 4) {
                     $latestVersionInfo = Tools::getLatestVersionInfo(3);
                     if (FALSE !== $latestVersionInfo) {
                         if (Config::codevVersion != $latestVersionInfo['version']) {
                             $this->smartyHelper->assign('latestVersionInfo', $latestVersionInfo);
                         }
                     }
                 }
             } catch (Exception $e) {
                 // version check should never break CodevTT usage...
                 // (no log, even logs could raise errors)
             }
         }
         // if CodevTT installed since at least 6 month,
         // then display FairPlay message every 3 month (mar, jun, sep, dec) during 3 days.
         if (($isManager || $isAdmin) && 0 == date('m') % 3 && date('d') > 27 && time() - Constants::$codevInstall_timestamp > 60 * 60 * 24 * 180) {
             $this->smartyHelper->assign('displayFairPlay', true);
             $this->smartyHelper->assign('codevInstall_date', date('Y-m-d', Constants::$codevInstall_timestamp));
         }
         if ($isAdmin) {
             // check global configuration
             $cerrList = ConsistencyCheck2::checkMantisDefaultProjectWorkflow();
             // add more checks here
             if (count($cerrList) > 0) {
                 $systemConsistencyErrors = array();
                 foreach ($cerrList as $cerr) {
                     $systemConsistencyErrors[] = array('severity' => $cerr->getLiteralSeverity(), 'desc' => $cerr->desc);
                 }
                 $this->smartyHelper->assign('systemConsistencyErrors', $systemConsistencyErrors);
             }
         }
         // updateBacklog DialogBox
         if (isset($_POST['bugid'])) {
             $bugid = Tools::getSecurePOSTStringValue('bugid');
             $backlog = Tools::getSecurePOSTStringValue('backlog', '');
             $issue = IssueCache::getInstance()->getIssue($bugid);
             $issue->setBacklog($backlog);
         }
         $driftedTasks = $this->getIssuesInDrift();
         if (isset($driftedTasks)) {
             $this->smartyHelper->assign('driftedTasks', $driftedTasks);
         }
         // Consistency errors
         $consistencyErrors = $this->getConsistencyErrors();
         // no specific Mgr errors right now
         #$consistencyErrorsMgr = $this->getConsistencyErrorsMgr($this->session_user);
         #$consistencyErrors = array_merge($consistencyErrors, $consistencyErrorsMgr);
         if (count($consistencyErrors) > 0) {
             $this->smartyHelper->assign('consistencyErrorsTitle', count($consistencyErrors) . ' ' . T_("Errors in your Tasks"));
             $this->smartyHelper->assign('consistencyErrors', $consistencyErrors);
         }
     }
 }