public function _start() { $this->setLayout('validateTimeSheetFormLayout'); $this->setName('validateTimeSheet'); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button radius success expand'); $this->addField($submit); }
public function _start() { //$this->setLayout(''); $this->setName('printActiveTimeSheet')->setAction($this->link(array('reports', 'inactive'))); $account = new Staple_Form_FoundationSelectElement('account', 'Select an account'); $account->setRequired()->addOption('', 'Select an account')->addOptionsArray($this->accounts())->addValidator(new Staple_Form_Validate_InArray($this->accounts(1))); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($account, $submit); }
public function _start() { $this->setLayout('accountFormLayout'); $this->setName('auth')->setAction($this->link(array('account', 'index'))); $pin = new Staple_Form_FoundationPasswordElement('pin', 'User PIN'); $pin->setRequired()->addAttrib("readonly", "true")->addValidator(new Staple_Form_Validate_Length(1, 4))->addValidator(new Staple_Form_Validate_Numeric()); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand hide'); $this->addField($pin, $submit); }
public function _start() { $this->setLayout('editMessageFormLayout'); $this->setName('editPrivateMessageForm'); $message = new Staple_Form_FoundationTextareaElement('message', 'Message'); $message->setRequired()->addAttrib("placeholder", "1000 character limit")->addValidator(new Staple_Form_Validate_Length(1, 1000))->addAttrib("style", "height:200px;"); $expireDate = new Staple_Form_FoundationTextElement('expireDate', 'Expiration Date'); $expireDate->setRequired()->addValidator(new Staple_Form_Validate_Date())->addAttrib('placeholder', 'mm/dd/yyyy'); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($expireDate, $message, $submit); }
public function _start() { $this->setLayout('weeklyReportFormLayout'); $this->setName('weeklyReportForm')->setAction($this->link(array('reports', 'weekly'))); $account = new Staple_Form_FoundationSelectElement('account', 'Account'); $account->setRequired()->addOption('', 'Select an account')->addOptionsArray($this->accounts())->addValidator(new Staple_Form_Validate_InArray($this->accounts(1))); $year = new Staple_Form_FoundationTextElement('year', 'Year'); $year->setRequired()->setValue(date('Y'))->addValidator(new Staple_Form_Validate_Length(4, 4))->addValidator(new Staple_Form_Validate_Numeric()); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($account, $year, $submit); }
public function _start() { //$this->setLayout('accountFormLayout'); $this->setName('adminAuth')->setAction($this->link(array('account', 'admin'))); $user = new Staple_Form_FoundationTextElement('username', 'Account'); $user->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 50)); $password = new Staple_Form_FoundationPasswordElement('password', 'Password'); $password->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 50)); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand'); $this->addField($user, $password, $submit); }
public function _start() { //$this->setLayout(''); $this->setName('changeYearForm')->setAction($this->link(array('timesheet', 'changeyear'))); $year = new Staple_Form_FoundationSelectElement('year', 'Year'); $year->setRequired()->addOptionsArray($this->getYears())->addValidator(new Staple_Form_Validate_InArray($this->getYears())); if (count($this->getYears()) == 0) { $year->addOption(date('Y'), date('Y')); } $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($year, $submit); }
public function _start() { $this->setLayout('newMessageFormLayout'); $this->setName('newMessageForm')->setAction($this->link(array('messages', 'index'))); $message = new Staple_Form_FoundationTextareaElement('message', 'Message'); $message->setRequired()->addAttrib("placeholder", "1000 character limit")->addValidator(new Staple_Form_Validate_Length(1, 1000))->addAttrib("style", "height:200px;"); $account = new Staple_Form_FoundationSelectElement('account', 'Send To'); $account->setRequired()->addOption('', 'Select an account')->addOptionsArray($this->accounts())->addValidator(new Staple_Form_Validate_InArray($this->accounts(1))); $expireDate = new Staple_Form_FoundationTextElement('expireDate', 'Expiration Date'); $expireDate->setRequired()->addValidator(new Staple_Form_Validate_Date())->addAttrib('placeholder', 'mm/dd/yyyy'); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($account, $expireDate, $message, $submit); }
public function _start() { $this->setLayout('editFormLayout'); $this->setName('editTimeForm'); $date = new Staple_Form_FoundationTextElement('date', 'Date'); $date->setRequired()->addValidator(new Staple_Form_Validate_Length('1', '10'))->addValidator(new Staple_Form_Validate_Date())->addAttrib('placeholder', 'mm/dd/yyyy'); $inTime = new Staple_Form_FoundationTextElement('inTime', 'Time In'); $inTime->setRequired()->addFilter(new Staple_Form_Filter_Trim())->addValidator(new Staple_Form_Validate_Length('1', '8'))->addValidator(new Staple_Form_Validate_Regex('/^(0|[0-9]|1[012]):[0-5][0-9] ?((a|p)m|(A|P)M)$/', 'Invalid time format. Expected format: h:mm am/pm.'))->addAttrib('placeholder', 'h:mm am/pm'); $outTime = new Staple_Form_FoundationTextElement('outTime', 'Time Out'); $outTime->setRequired()->addFilter(new Staple_Form_Filter_Trim())->addValidator(new Staple_Form_Validate_Length('1', '8'))->addValidator(new Staple_Form_Validate_Regex('/^(0|[0-9]|1[012]):[0-5][0-9] ?((a|p)m|(A|P)M)$/', 'Invalid time format. Expected format: h:mm am/pm.'))->addAttrib('placeholder', 'h:mm am/pm'); $lessTime = new Staple_Form_FoundationSelectElement('lessTime', 'Less Time'); $lessTime->setRequired()->addOptionsArray(array("0" => "None", "60" => "1 Hour", "30" => "30 Minutes"))->addValidator(new Staple_Form_Validate_InArray(array('0', '60', '30'))); $timeCodes = new codeModel(); $code = new Staple_Form_FoundationSelectElement('code', 'Code'); $code->setRequired()->addOptionsArray($timeCodes->allCodes()); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Update'); $submit->addClass('button success expand radius'); $this->addField($date, $inTime, $outTime, $lessTime, $code, $submit); }
public function _start() { $this->setLayout('editAccountFormLayout'); $this->setName('editAccount'); $firstName = new Staple_Form_FoundationTextElement('firstName', 'First Name'); $firstName->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 40)); $lastName = new Staple_Form_FoundationTextElement('lastName', 'Last Name'); $lastName->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 40)); $userName = new Staple_Form_FoundationTextElement('username', 'User Name'); $userName->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 40)); $supervisor = new Staple_Form_FoundationSelectElement('supervisor', 'Supervisor'); $supervisor->setRequired()->addOption("0", "Select an account")->addOptionsArray($this->accounts())->addValidator(new Staple_Form_Validate_InArray($this->accounts(1))); $type = new Staple_Form_FoundationSelectElement('type', 'Account Type'); $type->setRequired()->addOption("", "Select an account")->addOptionsArray(array("part" => "Part Time", "full" => "Full Time"))->addValidator(new Staple_Form_Validate_InArray(array("part", "full"))); $level = new Staple_Form_FoundationSelectElement('level', 'Account Level'); $level->setRequired()->addOption("", "Select a level")->addOptionsArray(array("100" => "Standard User", "500" => "Supervisor", "900" => "Administrator"))->addValidator(new Staple_Form_Validate_InArray(array("100", "500", "900"))); $status = new Staple_Form_FoundationSelectElement('status', 'Account Status'); $status->setRequired()->addOption("", "Select a status")->addOptionsArray(array("1" => "Enabled", "0" => "Disabled"))->addValidator(new Staple_Form_Validate_InArray(array("1", "0"))); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Save'); $submit->addClass('button radius expand'); $this->addField($firstName, $lastName, $userName, $supervisor, $type, $level, $status, $submit); }
public function _start() { $this->setLayout('newAccountFormLayout'); $this->setName('newAccount')->setAction($this->link(array('accounts', 'index'))); $pin = new Staple_Form_FoundationPasswordElement('pin', 'User PIN'); $pin->setRequired()->addAttrib("readonly", "true")->addValidator(new Staple_Form_Validate_Length(1, 4))->addValidator(new Staple_Form_Validate_Numeric()); $firstName = new Staple_Form_FoundationTextElement('firstName', 'First Name'); $firstName->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 40)); $lastName = new Staple_Form_FoundationTextElement('lastName', 'Last Name'); $lastName->setRequired()->addValidator(new Staple_Form_Validate_Length(1, 40)); $supervisor = new Staple_Form_FoundationSelectElement('supervisor', 'Select a Supervisor'); $supervisor->setRequired()->addOption("0", "Select an account")->addOptionsArray($this->accounts())->addValidator(new Staple_Form_Validate_InArray($this->accounts(1))); $type = new Staple_Form_FoundationSelectElement('type', 'Set Account Type'); $type->setRequired()->addOption("", "Select an account")->addOptionsArray(array("part" => "Part Time", "full" => "Full Time"))->addValidator(new Staple_Form_Validate_InArray(array("part", "full"))); $level = new Staple_Form_FoundationSelectElement('level', 'Set Account Level'); $level->setRequired()->addOption("", "Select a level")->addOptionsArray(array("100" => "Standard User", "500" => "Supervisor", "900" => "Administrator"))->addValidator(new Staple_Form_Validate_InArray(array("100", "500", "900"))); $pin = new Staple_Form_FoundationTextElement('pinNum', '4 Digit PIN'); $pin->setRequired()->addValidator(new Staple_Form_Validate_Length(4, 4))->addValidator(new Staple_Form_Validate_Numeric())->addAttrib("maxlength", "4"); $pin2 = new Staple_Form_FoundationTextElement('pinNum2', 'Confirm 4 Digit PIN'); $pin2->setRequired()->addValidator(new Staple_Form_Validate_Length(4, 4))->addValidator(new Staple_Form_Validate_Numeric())->addAttrib("maxlength", "4"); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($firstName, $lastName, $supervisor, $type, $level, $pin, $pin2, $submit); }
public function _start() { $auth = Staple_Auth::get(); $user = new userModel(); $user->userInfo($auth->getAuthId()); $this->accountLevel = $user->getAuthLevel(); $this->setLayout('insertFormLayout'); $this->setName('insertTimeForm')->setAction($this->link(array('timesheet'))); $date = new Staple_Form_FoundationTextElement('date', 'Date'); $date->setRequired()->addValidator(new Staple_Form_Validate_Date())->addAttrib('placeholder', 'mm/dd/yyyy'); $inTime = new Staple_Form_FoundationTextElement('inTime', 'Time In'); $inTime->setRequired()->addFilter(new Staple_Form_Filter_Trim())->addValidator(new Staple_Form_Validate_Regex('/^(0|[0-9]|1[012]):[0-5][0-9] ?((a|p)m|(A|P)M)$/', 'Invalid time format. Expected format: h:mm am/pm.'))->addAttrib('placeholder', 'h:mm am/pm'); $outTime = new Staple_Form_FoundationTextElement('outTime', 'Time Out'); $outTime->setRequired()->addFilter(new Staple_Form_Filter_Trim())->addValidator(new Staple_Form_Validate_Regex('/^(0|[0-9]|1[012]):[0-5][0-9] ?((a|p)m|(A|P)M)$/', 'Invalid time format. Expected format: h:mm am/pm.'))->addAttrib('placeholder', 'h:mm am/pm'); $lessTime = new Staple_Form_FoundationSelectElement('lessTime', 'Less Time'); $lessTime->setRequired()->addOptionsArray(array("0" => "None", "60" => "1 Hour", "30" => "30 Minutes"))->addValidator(new Staple_Form_Validate_InArray(array('0', '60', '30'))); $timeCodes = new codeModel(); $code = new Staple_Form_FoundationSelectElement('code', 'Code'); $code->setRequired()->addOption("x", "Select an option")->addOptionsArray($timeCodes->allCodes())->addValidator(new Staple_Form_Validate_InArray(array_keys($timeCodes->allCodes()))); $code->setValue($timeCodes->getIdFor('Normal')['id']); $submit = new Staple_Form_FoundationSubmitElement('submit', 'Submit'); $submit->addClass('button expand radius'); $this->addField($date, $inTime, $outTime, $lessTime, $code, $submit); }