Esempio n. 1
0
                 $udt_obj->setEnableCalcException(TRUE);
                 $udt_obj->Save();
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(array('refresh' => TRUE), '../CloseWindow.php'));
     break;
 case 'submit':
     Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
     //Debug::setVerbosity(11);
     //Limit it to 31 days.
     if ($udt_data['repeat'] > 31) {
         $udt_data['repeat'] = 31;
     }
     Debug::Text('Repeating Punch For: ' . $udt_data['repeat'] . ' Days', __FILE__, __LINE__, __METHOD__, 10);
     $udtf->StartTransaction();
     $fail_transaction = FALSE;
     for ($i = 0; $i <= (int) $udt_data['repeat']; $i++) {
         Debug::Text('Absence Repeat: ' . $i, __FILE__, __LINE__, __METHOD__, 10);
         if ($i == 0) {
             $date_stamp = $udt_data['date_stamp'];
         } else {
             $date_stamp = $udt_data['date_stamp'] + 86400 * $i;
         }
         Debug::Text('Date Stamp: ' . TTDate::getDate('DATE+TIME', $date_stamp), __FILE__, __LINE__, __METHOD__, 10);
         if ($i == 0 and $udt_data['id'] != '') {
             //Because if a user modifies the type of absence, the accrual balances
             //may come out of sync. Instead of just editing the entry directly, lets
             //delete the old one, and insert it as new.
             if ($udt_data['absence_policy_id'] == $udt_data['old_absence_policy_id']) {
                 Debug::Text('Editing absence, absence policy DID NOT change', __FILE__, __LINE__, __METHOD__, 10);