$f_action_workflow = strtoupper($f_action_workflow); if (in_array($f_action_workflow, array('Y', 'M', 'S', 'N'))) { $access = false; // A publisher can change the status in any way he sees fit. // Someone who can change an article can submit/unsubmit articles. // A user who owns the article may submit it. if ($g_user->hasPermission('Publish') || $g_user->hasPermission('ChangeArticle') && $f_action_workflow != 'Y' || $articleObj->userCanModify($g_user) && $f_action_workflow == 'S') { $access = true; } // If the article is set to New, remove all the autopublish events if ($f_action_workflow == 'N') { $articleEvents = ArticlePublish::GetArticleEvents($f_article_number, $f_language_selected, TRUE); foreach ($articleEvents as $event) { $eventId = $event->getArticlePublishId(); $articlePublishObj = new ArticlePublish($eventId); if ($articlePublishObj->exists()) { $articlePublishObj->delete(); } } } if (!$access) { camp_html_add_msg($translator->trans("You do not have the right to change this article status. Once submitted an article can only be changed by authorized users.", array(), 'articles')); camp_html_goto_page(camp_html_article_url($articleObj, $f_language_id, "edit.php")); } // If the article is not yet categorized, force it to be before publication. if (($f_action_workflow == "Y" || $f_action_workflow == 'M') && ($articleObj->getPublicationId() == 0 || $articleObj->getIssueNumber() == 0 || $articleObj->getSectionNumber() == 0)) { $args = $_REQUEST; $argsStr = camp_implode_keys_and_values($_REQUEST, "=", "&"); $argsStr .= "&f_article_code[]=" . $f_article_number . "_" . $f_language_selected; $argsStr .= "&f_mode=single&f_action=publish"; camp_html_goto_page("/{$ADMIN}/articles/duplicate.php?" . $argsStr);