Edit a project. Handles both the form and processing.
168869
public function edit($projectId)
    {
        $this->requireAdmin();

        $method = $this->request->getMethod();
        $project = $this->projectStore->getById($projectId);

        if (empty($project)) {
            throw new NotFoundException(Lang::get('project_x_not_found', $projectId));
        }

        $this->layout->title = $project->getTitle();
        $this->layout->subtitle = Lang::get('edit_project');

        $values = $project->getDataArray();
        $values['key'] = $values['ssh_private_key'];
        $values['pubkey'] = $values['ssh_public_key'];

        if ($values['type'] == "gitlab") {
            $accessInfo = $project->getAccessInformation();
            $reference = $accessInfo["user"].'@'.$accessInfo["domain"].':' . $project->getReference().".git";
            $values['reference'] = $reference;
        }

        if ($method == 'POST') {
            $values = $this->getParams();
        }

        $form = $this->projectForm($values, 'edit/' . $projectId);

        if ($method != 'POST' || ($method == 'POST' && !$form->validate())) {
            $view           = new b8\View('ProjectForm');
            $view->type     = 'edit';
            $view->project  = $project;
            $view->form     = $form;
            $view->key      = $values['pubkey'];

            return $view->render();
        }

        $title = $this->getParam('title', Lang::get('new_project'));
        $reference = $this->getParam('reference', null);
        $type = $this->getParam('type', null);

        $options = array(
            'ssh_private_key' => $this->getParam('key', null),
            'ssh_public_key' => $this->getParam('pubkey', null),
            'build_config' => $this->getParam('build_config', null),
            'allow_public_status' => $this->getParam('allow_public_status', 0),
            'archived' => $this->getParam('archived', 0),
            'branch' => $this->getParam('branch', null),
            'group' => $this->getParam('group_id', null),
        );

        $project = $this->projectService->updateProject($project, $title, $type, $reference, $options);

        $response = new b8\Http\Response\RedirectResponse();
        $response->setHeader('Location', PHPCI_URL.'project/view/' . $project->getId());
        return $response;
    }
1317663
public function editTemplate()
    {
        $this->defaultData();

        $clazz = $this->getCurrentClass();
        $delivery = $this->getCurrentInstance();

        $formContainer = new DeliveryForm($clazz, $delivery);
        $myForm = $formContainer->getForm();

        $myForm->evaluate();

        if ($myForm->isSubmited()) {
            if ($myForm->isValid()) {
                $propertyValues = $myForm->getValues();

                // then save the property values as usual
                $binder = new tao_models_classes_dataBinding_GenerisFormDataBinder($delivery);
                $delivery = $binder->bind($propertyValues);

                // edit process label:
                $this->getClassService()->onChangeLabel($delivery);

                $this->setData("selectNode", tao_helpers_Uri::encode($delivery->getUri()));
                $this->setData('message', __('Delivery saved'));
                $this->setData('reload', true);
            }
        }

        $this->setData('contentForm', $this->getContentForm());

        $this->setData('uri', tao_helpers_Uri::encode($delivery->getUri()));
        $this->setData('classUri', tao_helpers_Uri::encode($clazz->getUri()));

        $this->setData('hasContent', !is_null($this->getClassService()->getContent($delivery)));

        $this->setData('formTitle', __('Delivery properties'));
        $this->setData('myForm', $myForm->render());

        if ($this->getServiceLocator()->get(\common_ext_ExtensionsManager::SERVICE_ID)->isEnabled('taoCampaign')) {
            $this->setData('campaign', \taoCampaign_helpers_Campaign::renderCampaignTree($delivery));
        }
        $this->setView('DeliveryTemplate/editDelivery.tpl');
    }
903831
def post(self, request, *args, **kwargs):
        
        queryset = self.get_selected(request)

        if request.POST.get('modify'):
            response = self.process_action(request, queryset)
            if not response:
                url = self.get_done_url()
                return self.render(request, redirect_url=url)
            else:
                return response
        else:
            return self.render(request, redirect_url=request.build_absolute_uri())
1238172
public function process()
	{
		$view = $this->getView();

		// only start if there's something to do
		if( ( $option = $view->param( 'cs-option-terms', null ) ) === null ) {
			return;
		}

		if( ( $option = $view->param( 'cs-option-terms-value', 0 ) ) != 1 )
		{
			$view->standardStepActive = 'summary';
			$view->termsError = true;

			$error = array( $view->translate( 'client/html', 'Please accept the terms and conditions' ) );
			$view->standardErrorList = $error + $view->get( 'standardErrorList', array() );
		}

		parent::process();
	}
39372
public function process()
    {
        parent::process();

        if ($this->show_check_all) {
            $this->check_all->process();
        }

        // this is part of the old selection API
        $item_name = $this->getCheckboxRendererId();
        if (isset($_POST[$item_name]) && is_array($_POST[$item_name])) {
            $this->items = $_POST[$item_name];
        }
    }
1127820
def process(cls, post, render=True):
        
        post["slug"] = cls.create_slug(post["title"])
        post["editable"] = cls.is_author(post, current_user)
        post["url"] = cls.construct_url(post)
        post["priority"] = 0.8
        if render:
            cls.render_text(post)
            post["meta"]["images"] = cls.extract_images(post)
849316
public function editTrackAction()
    {
        if ($this->editTrackSnippets) {
            $params = $this->_processParameters($this->editTrackParameters + $this->createEditParameters);

            $this->addSnippets($this->editTrackSnippets, $params);
        }
    }
322063
public void setProcessForm(boolean processForm) {
		this.processForm = processForm;
		getConfig().setProperty(SPIDER_PROCESS_FORM, Boolean.toString(processForm));
	}
777929
def edit(self, **args):
        
        if self.model.exists(args["index"]):
            values = dict(zip(
                ['parent', 'name', 'priority', 'comment', 'done'],
                self.model.get(args["index"])
            ))
            kwargs = self.getKwargs(args, values)
            if kwargs:
                self.model.edit(args["index"], **kwargs)
514536
public function updateEditForm(Form $form)
    {
        Requirements::javascript('symbiote/silverstripe-advancedworkflow:client/dist/js/advancedworkflow.js');
        /** @var WorkflowService $service */
        $service = singleton(WorkflowService::class);
        /** @var DataObject|WorkflowApplicable $record */
        $record = $form->getRecord();
        $active = $service->getWorkflowFor($record);

        if ($active) {
            $fields = $form->Fields();
            $current = $active->CurrentAction();
            $wfFields = $active->getWorkflowFields();

            $allowed = array_keys($wfFields->saveableFields());
            $data = [];
            foreach ($allowed as $fieldName) {
                $data[$fieldName] = $current->$fieldName;
            }

            $fields->findOrMakeTab(
                'Root.WorkflowActions',
                _t('Workflow.WorkflowActionsTabTitle', 'Workflow Actions')
            );
            $fields->addFieldsToTab('Root.WorkflowActions', $wfFields);

            $form->loadDataFrom($data);

            // Set the form to readonly if the current user doesn't have permission to edit the record, and/or it
            // is in a state that requires review
            if (!$record->canEditWorkflow() && !$fields->isReadonly()) {
                $fields->makeReadonly();
            }

            $this->owner->extend('updateWorkflowEditForm', $form);
        }
    }
455046
def update_project_actions(self):
        """"""
        if self.recent_projects:
            self.clear_recent_projects_action.setEnabled(True)
        else:
            self.clear_recent_projects_action.setEnabled(False)

        active = bool(self.get_active_project_path())
        self.close_project_action.setEnabled(active)
        self.delete_project_action.setEnabled(active)
        self.edit_project_preferences_action.setEnabled(active)
664082
public void doProcess(BasicServlet servlet, HttpServletRequest req, HttpServletResponse res, PrintWriter out) 
        throws ServletException, IOException
    {
        // Override this
    }
255597
protected void postProcessing()
   {
      //
      // Update the internal structure. We'll take this opportunity to
      // generate outline numbers for the tasks as they don't appear to
      // be present in the MPP file.
      //
      ProjectConfig config = m_project.getProjectConfig();
      config.setAutoWBS(m_autoWBS);
      config.setAutoOutlineNumber(true);
      m_project.updateStructure();
      config.setAutoOutlineNumber(false);

      //
      // Perform post-processing to set the summary flag
      //
      for (Task task : m_project.getTasks())
      {
         task.setSummary(task.hasChildTasks());
      }

      //
      // Ensure that the unique ID counters are correct
      //
      config.updateUniqueCounters();
   }
152146
public function doProcess()
	{

		// double request errors
		$this->checkDouble();

		// process type errors
		$rc = $this->doProcessType();
		if ($rc !== '00') {
			$this->payment->status = Status::ERROR;
			$this->payment->save();

			return;
		}

		$this->payment->saveByType();

	}
1122465
public function process()
    {
        $this->form->handleRequest($this->request);
        $this->model = $this->form->getData();

        return $this->form->isSubmitted() && $this->form->isValid() && $this->processForm($this->model);
    }
465534
public function process_submission() {
        global $DB;
        // Delete all records, then add back the ones that should be allowed.
        $DB->delete_records($this->tablename);
        foreach ($this->roles as $fromroleid => $notused) {
            foreach ($this->roles as $targetroleid => $alsonotused) {
                if (optional_param('s_' . $fromroleid . '_' . $targetroleid, false, PARAM_BOOL)) {
                    $this->set_allow($fromroleid, $targetroleid);
                }
            }
        }
    }
589971
def do_edit(self, args):
        """"""
        if 'EDITOR' not in os.environ:
            print('*** $EDITOR not set')
        else:
            path = os.path.join(utils.CONFIG_DIR, 'sql')
            cmd = os.environ['EDITOR']
            try:
                os.system(cmd + ' ' + path)
                if os.path.exists(path):
                    with open(path, 'r') as f:
                        sql = f.read()
                        if sql:
                            self.default(sql)
            finally:
                if os.path.exists(path):
                    os.remove(path)