The save method can be defined such that where m_sc is a reference to the standardController which is passed to your extension in it's constructor:
public Pagereference doSaveAndNew()
{
SObject so = m_sc.getRecord();
upsert so;
string s = '/' + ('' + so.get('Id')).subString(0, 3) + '/e?';
ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.Info, s));
return new Pagereference(s);
}
Now since you want to your controller as an extension, you can modify it's constructor to take a StandardController reference as an argument:
public class TimeSheetExtension
{
ApexPages.standardController m_sc = null;
public TimeSheetExtension(ApexPages.standardController sc)
{
m_sc = sc;
}
Now, you need to modify your <apex:page> tag in your page in order to reference it as an extension:
<apex:page standardController="Timesheet__c" extensions="TimeSheetExtension">
<apex:form >
<apex:pageMessages />
{!Timesheet__c.Name}
<apex:commandButton action="{!doCancel}" value="Cancel"/>
<apex:commandButton action="{!doSaveAndNew}" value="Save & New"/>
</apex:form>
</apex:page>
Check out this Salesforce course to enhance your career!