Vt timeslip 4 submit buttons

From PikaDocs

The default Time Slip in Pika 3.05 has 3 submit buttons: Save, Add Another, Save and Close, and Cancel. In the parlance of Pika these are save buttons although obviously the cancel button doesn't save.

We made a slight variation on this here in Vermont at the request of users. The Save, Add Another buttons retains information on the next time slip, like funding code, date, user, and case number. Sometimes this is useful, but often you just want a new timesheet without any of that info carried over.

A screenshot of our custom screen follows. The cancel button and save and close button are they same, although we put the cancel button in gray color since it doesn't actually save.

The "Save, Repeat" button is the same as what was previously called "Save, Add Another". We've also added a new button called "Save, new blank slip" which will take you to a new time slip but doesn't carry over all the information mentioned above.

 Screenshot of Vermont custom time slip

Here's how we did it.

Modify activity.php around line 163 to look like this:

$a['form_action'] = "dataops.php";
$a['action_name'] = 'add_activity';
$a['submit_button'] = "<input type=submit name='next_act' value='Save, repeat' tabindex=1 class=save>  
<input type=submit name='next_act_nosave' value='Save, new blank slip' tabindex=1 class=save>
<br/><input type=submit name='close_act' value='Save and Close' tabindex=1 class=save>  
<input type=submit name='cancel' value='Cancel' tabindex=1>";

I modified the line with next_act to call it Save, repeat to maintain user habits from our old CMS. I added a new line - the one with next_act_nosave. Also, you can set whether or not the cancel button has class=save. I set it to not have that css statement, so it does not look like a yellow save button. After all, it doesn't save.

Also you need to modify dataops.php around line 74. Find this section:

	// decide where to go from here
	if ($_REQUEST['close_act'])
	{
		header("Location: {$_REQUEST['act_url']}");
	}
	   
	else
	{
		$act_url = urlencode($_REQUEST['act_url']);
		$act_date_tmp = pl_date_mogrify($_REQUEST['act_date']);
		header("Location: activity.php?screen=compose&user_id={$_REQUEST['user_id']}&pba_id={$_REQUEST['pba_id']}&case_id={$_REQUEST['case_id']}&funding={$_REQUEST['funding']}&act_date=$act_date_tmp&completed={$_REQUEST['completed']}&act_url=$act_url&act_type={$_REQUEST['act_type']}");
	}

In between the } the else, add this new code block:

    // Andrew Cameron 2006/6/8 
    // adding a new condition here
    elseif ($_REQUEST['next_act_nosave'])
	{
		$act_url = urlencode($_REQUEST['act_url']);
		//$act_date_tmp = pl_date_mogrify($_REQUEST['act_date']);
		header("Location: activity.php?screen=compose&completed={$_REQUEST['completed']}&act_url=$act_url&act_type={$_REQUEST['act_type']}");
	}



Updated 6/13. Previously edited subtemplate/activityT.html. Turns out that creates the 4 buttons also on the activity edit screen. Instead put subtemplate/activityT.html back to normal and instead edit activity.php