addtolist action module Called from PIE edit screen, moves item to different lists action routine Input: CGI data from UIG (which contains itemid and list ids *) Output: Prints http location to return user to edit page List ids are parameters in the CGI data with keys of the form listid.[id] (or newlist.[pageid] for a new list) and value "on" if item is intended to be in this list PDL Foreach parameter If parameter has key of form listid.[id] and value is "on" Push into array of lists_to_put_item_in If parameter has key of form newlist.[pageid] If value is not "Enter new list name" Store value in newlists hash with key pageid Get information about item from item table Call onerror unless item defined Get information about pages that can be edited by user from item, groups, userdata and editgroups tables Foreach editable page Get information about lists on this page from item table Foreach list Delete items which match title of selected item and are children of list from item, viewitem, readgroups and editgroups tables Foreach list_to_put_item_in If list = list_to_put_item_in Call put_item_on routine(list,item) If defined newlists{page} Call createlist routine to add new list to page Call put_item_on routine(newlist,item) Want to ignore response and go directly to edit page (because want to rerun edit action to configure edit forms) Print http location command with appropriate URL Exit 0 put_item_on routine Makes item a child of list Input: listid, item (structured variable containing details of item) Output: itemid of newly added item PDL Call get_new_itemid to get itemid for item Call get_posno to get position in list Insert item details into item table Insert item details into readgroups,editgroups tables Return itemid