views:

435

answers:

1

Hi all, I have a workflow setup on the site. The following is what happened:

  1. I go site actions -> Manage content and structure
  2. and then go to the pages list; and then check all the check boxes on the pending pages;
  3. Click the actions in the menu bar;

in the drop down list, approve option is greyed out. Only check in option is available. Even after checking it in, the approve option is still greyed out. However, in each individual item, I can approve it.

My questions are:

  1. Is it bulk approval is not available if there is workflow?
  2. Is there any way that you can recommend to make this work?
A: 

The problem is , is that publishing requires you to specify who is the approver in the _layouts/IniWrkflIP.aspx form. There is no way fpr that page to work for more than 1 item (it works on 1 specific item to be approved / published). Hence there is no button to bulk publish / approve.

What is possible though is to create a customaction in the actions panel of a list (i.e. in the pages list of your site) that does the bulk process for that specific list. Because in code you can traverse all items in the list, check if it is a ScheduledItem and then Schedule the publishing:

 if (PublishingPage.IsPublishingPage(item))
 {
   PublishingPage.GetPublishingPage(item).CheckIn("Checked in during import");
 }
 else
   if (ScheduledItem.IsScheduledItem(item))
   {
     try
     {
       ScheduledItem thisScheduled = ScheduledItem.GetScheduledItem(item);
       thisScheduled.Schedule("Page was automatically approved by the system");
     }
     catch (Exception)
     {
       //LOG ERROR
     }
   }
Colin