Example #1
0
             $conflictingArticles = Article::GetByName($tmpArticle->getTitle(), $f_destination_publication_id, $f_destination_issue_number, $f_destination_section_number, null, true);
             if (count($conflictingArticles) > 0) {
                 $conflictingArticle = array_pop($conflictingArticles);
                 $conflictingArticleLink = camp_html_article_url($conflictingArticle, $conflictingArticle->getLanguageId(), "edit.php");
                 camp_html_add_msg($translator->trans("The article could not be submitted.", array(), 'articles') . " " . $translator->trans("You cannot have two articles in the same section with the same name.  The article name you specified is already in use by the article '\$1'.", array('$1' => "<a href='{$conflictingArticleLink}'>" . $conflictingArticle->getName() . "</a>"), 'articles'));
                 $args = $_REQUEST;
                 unset($args["action_button"]);
                 unset($args["f_article_code"]);
                 $argsStr = camp_implode_keys_and_values($args, "=", "&");
                 foreach ($_REQUEST["f_article_code"] as $code) {
                     $argsStr .= "&f_article_code[]={$code}";
                 }
                 $backLink = "/{$ADMIN}/articles/duplicate.php?{$argsStr}";
                 camp_html_goto_page($backLink);
             } else {
                 $tmpArticle->move($f_destination_publication_id, $f_destination_issue_number, $f_destination_section_number);
                 $tmpArticle->setWorkflowStatus('S');
                 \Zend_Registry::get('container')->getService('dispatcher')->dispatch('article.submit', new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('article' => $tmpArticle)));
                 $tmpArticles[] = $tmpArticle;
             }
         }
     }
     $tmpArticle = camp_array_peek($tmpArticles);
     if ($f_mode == "single") {
         $url = camp_html_article_url($tmpArticle, $tmpArticle->getLanguageId(), "edit.php");
     } else {
         $url = $destArticleIndexUrl;
     }
     ArticleIndex::RunIndexer(3, 10, true);
     camp_html_goto_page($url);
 }