<?php
global $config;
if($config->edition != 'open' && $config->vision == 'rnd')
{
    if(helper::hasFeature('devops') || (defined('IN_UPGRADE') && IN_UPGRADE))
    {
        if(isset($lang->resource->artifactrepo)) $lang->resource->artifactrepo->view = 'view';

        if(isset($lang->resource->repo))
        {
            $lang->resource->repo->createBranch = 'createBranch';
            $lang->resource->repo->deleteBranch = 'deleteBranch';
            $lang->resource->repo->createTag    = 'createTag';
            $lang->resource->repo->deleteTag    = 'deleteTag';
            $lang->resource->repo->setCMrule    = 'setCMrule';
            $lang->resource->repo->setPRrule    = 'setPRrule';
            $lang->resource->repo->setSafeRule  = 'setSafeRule';
            $lang->resource->repo->setOwnerRule = 'setOwnerRule';

            $lang->resource->repo->browseWebhooks = 'browseWebhooks';
            $lang->resource->repo->createWebhook  = 'createWebhook';
            $lang->resource->repo->editWebhook    = 'editWebhook';
            $lang->resource->repo->deleteWebhook  = 'deleteWebhook';
            $lang->resource->repo->logWebhook     = 'logWebhook';
            $lang->resource->repo->enableWebhook  = 'enableWebhook';

            $lang->resource->repo->browseRule = 'browseRule';
            $lang->resource->repo->createRule = 'createRule';
            $lang->resource->repo->editRule   = 'editRule';
            $lang->resource->repo->deleteRule = 'deleteRule';
            $lang->resource->repo->enableRule = 'enableRule';

            $lang->resource->repo->browseSystem = 'browseSystem';
        }

        $lang->resource->job->createPipeline = 'createPipeline';
        $lang->resource->job->arrange        = 'arrange';

        if($config->edition != 'biz') $lang->resource->deploy->setting = 'setting';

        $lang->resource->deploy->submit = 'submit';
        $lang->resource->deploy->review = 'review';
        $lang->resource->deploy->recall = 'recall';

        $lang->deploy->methodOrder[100] = 'submit';
        $lang->deploy->methodOrder[105] = 'review';
        $lang->deploy->methodOrder[110] = 'recall';

        $lang->job->methodOrder[10] = 'createPipeline';
        $lang->job->methodOrder[15] = 'arrange';

        $lang->repo->methodOrder[120] = 'createBranch';
        $lang->repo->methodOrder[125] = 'deleteBranch';
        $lang->repo->methodOrder[130] = 'createTag';
        $lang->repo->methodOrder[135] = 'deleteTag';
        $lang->repo->methodOrder[140] = 'setCMrule';
        $lang->repo->methodOrder[145] = 'setPRrule';
        $lang->repo->methodOrder[150] = 'setSafeRule';
        $lang->repo->methodOrder[155] = 'setOwnerRule';

        $lang->repo->methodOrder[160] = 'browseWebhooks';
        $lang->repo->methodOrder[165] = 'createWebhook';
        $lang->repo->methodOrder[170] = 'editWebhook';
        $lang->repo->methodOrder[175] = 'deleteWebhook';
        $lang->repo->methodOrder[180] = 'logWebhook';
        $lang->repo->methodOrder[185] = 'enableWebhook';

        $lang->repo->methodOrder[190] = 'browseRule';
        $lang->repo->methodOrder[195] = 'createRule';
        $lang->repo->methodOrder[200] = 'editRule';
        $lang->repo->methodOrder[205] = 'deleteRule';
        $lang->repo->methodOrder[210] = 'enableRule';

        /* push request. */
        $lang->resource->pullreq = new stdclass();
        $lang->resource->pullreq->browse     = 'browseAction';
        $lang->resource->pullreq->edit       = 'edit';
        $lang->resource->pullreq->delete     = 'delete';
        $lang->resource->pullreq->view       = 'viewAction';
        $lang->resource->pullreq->accept     = 'accept';
        $lang->resource->pullreq->linkStory  = 'linkStory';
        $lang->resource->pullreq->linkBug    = 'linkBug';
        $lang->resource->pullreq->linkTask   = 'linkTask';
        $lang->resource->pullreq->unlink     = 'unlink';
        $lang->resource->pullreq->approval   = 'approval';
        $lang->resource->pullreq->close      = 'close';
        $lang->resource->pullreq->reopen     = 'reopen';

        $lang->pullreq->methodOrder[15]  = 'browse';
        $lang->pullreq->methodOrder[20]  = 'edit';
        $lang->pullreq->methodOrder[25]  = 'delete';
        $lang->pullreq->methodOrder[35]  = 'view';
        $lang->pullreq->methodOrder[45]  = 'accept';
        $lang->pullreq->methodOrder[60]  = 'linkStory';
        $lang->pullreq->methodOrder[65]  = 'linkBug';
        $lang->pullreq->methodOrder[70]  = 'linkTask';
        $lang->pullreq->methodOrder[75]  = 'unlink';
        $lang->pullreq->methodOrder[80]  = 'approval';
        $lang->pullreq->methodOrder[85]  = 'close';
        $lang->pullreq->methodOrder[90]  = 'reopen';
        $lang->pullreq->methodOrder[95]  = 'addReview';

        $lang->resource->publishtemplate = new stdclass();
        $lang->resource->publishtemplate->browse = 'browse';
        $lang->resource->publishtemplate->create = 'create';
        $lang->resource->publishtemplate->edit   = 'edit';
        $lang->resource->publishtemplate->delete = 'delete';

        $lang->resource->env = new stdclass();
        $lang->resource->env->browse = 'browse';
        $lang->resource->env->create = 'create';
        $lang->resource->env->edit   = 'edit';
        $lang->resource->env->delete = 'delete';

        // $lang->resource->cluster = new stdclass();
        // $lang->resource->cluster->browse = 'browse';
        // $lang->resource->cluster->create = 'create';
        // $lang->resource->cluster->edit   = 'edit';
        // $lang->resource->cluster->delete = 'delete';

        $lang->resource->system->view = 'view';

        $lang->resource->space->monitorSetting = 'monitorSetting';

        $lang->resource->codescan = new stdclass();
        $lang->resource->codescan->browse      = 'browse';
        $lang->resource->codescan->view        = 'view';
        $lang->resource->codescan->changeState = 'changeState';

        $lang->resource->codescan->ruleset            = 'ruleset';
        $lang->resource->codescan->createruleset      = 'createRuleset';
        $lang->resource->codescan->editruleset        = 'editRuleset';
        $lang->resource->codescan->deleteruleset      = 'deleteRuleset';
        $lang->resource->codescan->rulesetview        = 'viewRuleset';
        $lang->resource->codescan->changerulesetstate = 'changeState';
        $lang->resource->codescan->unlinkrule         = 'unlinkRule';
        $lang->resource->codescan->batchunlinkrule    = 'batchUnlinkRule';
        $lang->resource->codescan->linkrule           = 'linkRule';

        $lang->resource->codescan->linkset             = 'linkSet';
        $lang->resource->codescan->unlinkset           = 'unlinkSet';
        $lang->resource->codescan->solution            = 'solution';
        $lang->resource->codescan->solutionview        = 'viewSolution';
        $lang->resource->codescan->createsolution      = 'createSolution';
        $lang->resource->codescan->editsolution        = 'editSolution';
        $lang->resource->codescan->deletesolution      = 'deleteSolution';
        $lang->resource->codescan->changesolutionstate = 'changeState';

        $lang->resource->codescan->plan           = 'plan';
        $lang->resource->codescan->planView       = 'planView';
        $lang->resource->codescan->createPlan     = 'createPlan';
        $lang->resource->codescan->editPlan       = 'editPlan';
        $lang->resource->codescan->deletePlan     = 'deletePlan';
        $lang->resource->codescan->unlinkSolution = 'unlinkSolution';
        $lang->resource->codescan->task           = 'task';
        $lang->resource->codescan->exec           = 'exec';
        $lang->resource->codescan->createTrigger  = 'createTrigger';
        $lang->resource->codescan->editTrigger    = 'editTrigger';
        $lang->resource->codescan->deleteTrigger  = 'deleteTrigger';
        $lang->resource->codescan->taskView       = 'taskView';
        $lang->resource->codescan->taskLog        = 'taskLog';
        $lang->resource->codescan->resend         = 'resend';

        $lang->resource->codescan->overview     = 'overview';
        $lang->resource->codescan->issue        = 'issue';
        $lang->resource->codescan->issueView    = 'issueView';
        $lang->resource->codescan->ignoreIssue  = 'ignoreIssue';
        $lang->resource->codescan->confirmIssue = 'confirmIssue';
        $lang->resource->codescan->activeIssue  = 'activeIssue';
    }
}
