<commit_before><?php
class generic_ActivateAction extends f_action_BaseAction
{
	/**
	 * @param Context $context
	 * @param Request $request
	 */
	public function _execute($context, $request)
	{
		$docIds = $this->getDocumentIdArrayFromRequest($request);

		$success = true;

		foreach ($docIds as $docId)
		{
		    $ds = $this->getDocumentServiceByDocId($docId);

		    try
			{
			    $ds->activate($docId);
			    $this->logAction(DocumentHelper::getDocumentInstance($docId));
			}
			catch (IllegalTransitionException $e)
			{
			    $request->setAttribute('message', $e->getMessage());
			    $success = false;
			}
		}

		if ($success)
		{
		    return self::getSuccessView();
		}

		return self::getErrorView();
	}
	
	/**
	 * @return Boolean
	 */
	protected function suffixSecureActionByDocument()
	{
		return true;
	}
}<commit_msg>[FIX #15994] Problème de droits dans Agenda<commit_after><?php
class generic_ActivateAction extends f_action_BaseAction
{
	/**
	 * @param Context $context
	 * @param Request $request
	 */
	public function _execute($context, $request)
	{
		$docIds = $this->getDocumentIdArrayFromRequest($request);

		$success = true;

		foreach ($docIds as $docId)
		{
		    $ds = $this->getDocumentServiceByDocId($docId);

		    try
			{
			    $ds->activate($docId);
			    $this->logAction(DocumentHelper::getDocumentInstance($docId));
			}
			catch (IllegalTransitionException $e)
			{
			    $request->setAttribute('message', $e->getMessage());
			    $success = false;
			}
		}

		if ($success)
		{
		    return self::getSuccessView();
		}

		return self::getErrorView();
	}
	
	/**
	 * @see f_action_BaseAction::getSecureNodeIds()
	 *
	 * @return unknown
	 */
	protected function getSecureNodeIds()
	{
		$id = $this->getDocumentIdFromRequest($this->getContext()->getRequest());
		$doc = DocumentHelper::getByCorrectionId($id);
		return array($doc->getId());
	}

	
	/**
	 * @return Boolean
	 */
	protected function suffixSecureActionByDocument()
	{
		return true;
	}
}
{'fraction_non_alphanumeric': 0.14837092731829574, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 3.6203703703703702, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2624562', 'n_tokens_mistral': 741, 'n_tokens_neox': 634, 'n_words': 115}