function processPost($formvalues) { // trim spaces from the name field if (isArrayKeyAnEmptyString('companyid', $formvalues)) { $formvalues['companyid'] = getCompanyID(); } if (isArrayKeyAnEmptyString('hours', $formvalues)) { unset($formvalues['hours']); } if (isArrayKeyAnEmptyString('starttime', $formvalues)) { unset($formvalues['starttime']); } else { $formvalues['starttime'] = date("H:i:s", strtotime($formvalues['starttime'])); } if (isArrayKeyAnEmptyString('endtime', $formvalues)) { unset($formvalues['endtime']); } else { $formvalues['endtime'] = date("H:i:s", strtotime($formvalues['endtime'])); } if (isArrayKeyAnEmptyString('overduestarttime', $formvalues)) { unset($formvalues['overduestarttime']); } else { $formvalues['overduestarttime'] = date("H:i:s", strtotime($formvalues['overduestarttime'])); } if (isArrayKeyAnEmptyString('breakhrs', $formvalues)) { unset($formvalues['breakhrs']); } // debugMessage($formvalues); exit(); parent::processPost($formvalues); }
function processPost($formvalues) { // trim spaces from the name field if (isArrayKeyAnEmptyString('type', $formvalues)) { unset($formvalues['type']); } if (isArrayKeyAnEmptyString('benefitid', $formvalues)) { unset($formvalues['benefitid']); } if (isArrayKeyAnEmptyString('amount', $formvalues)) { unset($formvalues['amount']); } if (isArrayKeyAnEmptyString('benefitfrequency', $formvalues)) { unset($formvalues['benefitfrequency']); } if (isArrayKeyAnEmptyString('leavetypeid', $formvalues)) { unset($formvalues['leavetypeid']); } if (isArrayKeyAnEmptyString('accrualtype', $formvalues)) { unset($formvalues['accrualtype']); } if (isArrayKeyAnEmptyString('accrualfrequency', $formvalues)) { unset($formvalues['accrualfrequency']); } if (isArrayKeyAnEmptyString('accrualvalue', $formvalues)) { unset($formvalues['accrualvalue']); } // debugMessage($formvalues); exit(); parent::processPost($formvalues); }
function processPost($formvalues) { # force setting of default none string column values. enum, int and date if (isArrayKeyAnEmptyString('isread', $formvalues)) { $formvalues['isread'] = '0'; } parent::processPost($formvalues); }
/** * Clean up the post array before populating the values of the object: * - Remove the blank values for the executedby field which will cause a foreign key error * * @param Array $post_array The post array * * @see BaseRecord::processPost */ public function processPost($formvalues) { // remove the executedby field if it is empty if (isArrayKeyAnEmptyString('isupdate', $formvalues)) { unset($formvalues['isupdate']); } if (isArrayKeyAnEmptyString('userid', $formvalues)) { unset($formvalues['userid']); } parent::processPost($formvalues); }
/** * Pre process model data */ function processPost($formvalues) { # force setting of default none string column values. enum, int and date if (isArrayKeyAnEmptyString('parentid', $formvalues)) { unset($formvalues['parentid']); } if (isArrayKeyAnEmptyString('type', $formvalues)) { unset($formvalues['type']); } if (isArrayKeyAnEmptyString('refid', $formvalues)) { unset($formvalues['refid']); } parent::processPost($formvalues); }
/** * Preprocess model data */ function processPost($formvalues) { // set default values for integers, dates, decimals if (isArrayKeyAnEmptyString('userid', $formvalues)) { unset($formvalues['userid']); } if (isArrayKeyAnEmptyString('personid', $formvalues)) { unset($formvalues['personid']); } if (isArrayKeyAnEmptyString('namesection', $formvalues)) { unset($formvalues['namesection']); } if (isArrayKeyAnEmptyString('familysection', $formvalues)) { unset($formvalues['familysection']); } if (isArrayKeyAnEmptyString('clansection', $formvalues)) { unset($formvalues['clansection']); } if (isArrayKeyAnEmptyString('personalsection', $formvalues)) { unset($formvalues['personalsection']); } if (isArrayKeyAnEmptyString('emailaddresssection', $formvalues)) { unset($formvalues['emailaddresssection']); } if (isArrayKeyAnEmptyString('phonesection', $formvalues)) { unset($formvalues['phonesection']); } if (isArrayKeyAnEmptyString('physicaladdresssection', $formvalues)) { unset($formvalues['physicaladdresssection']); } if (isArrayKeyAnEmptyString('webaddresssection', $formvalues)) { unset($formvalues['webaddresssection']); } if (isArrayKeyAnEmptyString('birthsection', $formvalues)) { unset($formvalues['birthsection']); } if (isArrayKeyAnEmptyString('birthrule', $formvalues)) { unset($formvalues['birthrule']); } if (isArrayKeyAnEmptyString('defaultprivacy', $formvalues)) { unset($formvalues['defaultprivacy']); } parent::processPost($formvalues); }
function processPost($formvalues) { // trim spaces from the name field if (isArrayKeyAnEmptyString('status', $formvalues)) { unset($formvalues['status']); } if (isArrayKeyAnEmptyString('starttime', $formvalues)) { $formvalues['starttime'] = NULL; } else { $formvalues['starttime'] = date("H:i:s", strtotime($formvalues['starttime'])); } if (isArrayKeyAnEmptyString('endtime', $formvalues)) { $formvalues['endtime'] = NULL; } else { $formvalues['endtime'] = date("H:i:s", strtotime($formvalues['endtime'])); } if (isArrayKeyAnEmptyString('startdate', $formvalues)) { if (!isArrayKeyAnEmptyString('startdate_old', $formvalues)) { $formvalues['startdate'] = NULL; } else { unset($formvalues['startdate']); } } else { $formvalues['startdate'] = date('Y-m-d', strtotime($formvalues['startdate'])); } if (isArrayKeyAnEmptyString('enddate', $formvalues)) { if (!isArrayKeyAnEmptyString('enddate_old', $formvalues)) { $formvalues['enddate'] = NULL; } else { unset($formvalues['enddate']); } } else { $formvalues['enddate'] = date('Y-m-d', strtotime($formvalues['enddate'])); } if (!isArrayKeyAnEmptyString('workingdaysids', $formvalues)) { $formvalues['workingdays'] = implode(',', $formvalues['workingdaysids']); } else { if (!isArrayKeyAnEmptyString('workingdays_old', $formvalues)) { if (isArrayKeyAnEmptyString('workingdaysids', $formvalues)) { $formvalues['workingdays'] = NULL; } } else { unset($formvalues['workingdays']); } } // debugMessage($formvalues); exit(); parent::processPost($formvalues); }
function processPost($formvalues) { # force setting of default none string column values. enum, int and date if (isArrayKeyAnEmptyString('empstatus', $formvalues)) { unset($formvalues['empstatus']); } if (isArrayKeyAnEmptyString('rate', $formvalues)) { unset($formvalues['rate']); } if (isArrayKeyAnEmptyString('ratetype', $formvalues)) { unset($formvalues['ratetype']); } if (isArrayKeyAnEmptyString('istimesheetuser', $formvalues)) { unset($formvalues['istimesheetuser']); } if (isArrayKeyAnEmptyString('payrolltype', $formvalues)) { unset($formvalues['payrolltype']); } if (isArrayKeyAnEmptyString('isignored', $formvalues)) { unset($formvalues['isignored']); } if (isArrayKeyAnEmptyString('daysworked', $formvalues)) { unset($formvalues['daysworked']); } if (isArrayKeyAnEmptyString('hourspending', $formvalues)) { unset($formvalues['hourspending']); } if (isArrayKeyAnEmptyString('halfhoursworked', $formvalues)) { unset($formvalues['halfhoursworked']); } if (isArrayKeyAnEmptyString('fullhoursworked', $formvalues)) { unset($formvalues['fullhoursworked']); } if (isArrayKeyAnEmptyString('leavehrs', $formvalues)) { unset($formvalues['leavehrs']); } if (isArrayKeyAnEmptyString('sickhrs', $formvalues)) { unset($formvalues['sickhrs']); } if (isArrayKeyAnEmptyString('midgross', $formvalues)) { unset($formvalues['midgross']); } if (isArrayKeyAnEmptyString('endgross', $formvalues)) { unset($formvalues['endgross']); } if (isArrayKeyAnEmptyString('nssf', $formvalues)) { unset($formvalues['nssf']); } if (isArrayKeyAnEmptyString('paye', $formvalues)) { unset($formvalues['paye']); } if (isArrayKeyAnEmptyString('otherdebit', $formvalues)) { unset($formvalues['otherdebit']); } if (isArrayKeyAnEmptyString('netearning', $formvalues)) { unset($formvalues['netearning']); } if (isArrayKeyAnEmptyString('transport', $formvalues)) { unset($formvalues['transport']); } if (isArrayKeyAnEmptyString('othercredit', $formvalues)) { unset($formvalues['othercredit']); } if (isArrayKeyAnEmptyString('netpay', $formvalues)) { unset($formvalues['netpay']); } if (isArrayKeyAnEmptyString('totaltaxable', $formvalues)) { unset($formvalues['totaltaxable']); } if (isArrayKeyAnEmptyString('totalbenefits', $formvalues)) { unset($formvalues['totalbenefits']); } parent::processPost($formvalues); }