Ejemplo n.º 1
0
        } else {
            $obj = new SystemSettingListFactory();
        }
        $obj->setName('anonymous_update_notify');
        if (isset($data['anonymous_update_notify']) and $data['anonymous_update_notify'] == 1) {
            $obj->setValue(1);
        } elseif (getTTProductEdition() == TT_PRODUCT_PROFESSIONAL) {
            $obj->setValue(0);
        } else {
            $obj->setValue(0);
        }
        if ($obj->isValid()) {
            $obj->Save();
        }
        $ttsc = new TimeTrexSoapClient();
        $ttsc->saveRegistrationKey();
        $handle = fopen('http://www.timetrex.com/' . URLBuilder::getURL(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'system_setting', 'update_notify' => (int) $data['update_notify'], 'anonymous_update_notify' => (int) $data['anonymous_update_notify']), 'pre_install.php'), "r");
        fclose($handle);
        Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer), 'Company.php'));
        break;
    default:
        Debug::Text('Request URI: ' . $_SERVER['REQUEST_URI'], __FILE__, __LINE__, __METHOD__, 10);
        $data = array('host_name' => $_SERVER['HTTP_HOST'], 'base_url' => str_replace('/install', '', dirname($_SERVER['REQUEST_URI'])), 'log_dir' => $config_vars['path']['log'], 'storage_dir' => $config_vars['path']['storage'], 'cache_dir' => $config_vars['cache']['dir']);
        $smarty->assign_by_ref('data', $data);
        break;
}
$handle = @fopen('http://www.timetrex.com/' . URLBuilder::getURL(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'system_setting'), 'pre_install.php'), "r");
@fclose($handle);
$smarty->assign_by_ref('install_obj', $install_obj);
$smarty->assign_by_ref('external_installer', $external_installer);
$smarty->display('install/SystemSettings.tpl');
Ejemplo n.º 2
0
             $pgf->setMealPolicy(array());
         }
         if (isset($data['break_policy_ids'])) {
             $pgf->setBreakPolicy($data['break_policy_ids']);
         } else {
             $pgf->setBreakPolicy(array());
         }
         if (isset($data['holiday_policy_ids'])) {
             $pgf->setHolidayPolicy($data['holiday_policy_ids']);
         } else {
             $pgf->setHolidayPolicy(array());
         }
         if ($pgf->isValid()) {
             $pgf->Save();
             $pgf->CommitTransaction();
             Redirect::Page(URLBuilder::getURL(NULL, 'PolicyGroupList.php'));
             break;
         }
     }
     $pgf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $pglf = new PolicyGroupListFactory();
         $pglf->getByIdAndCompanyID($id, $current_company->getID());
         foreach ($pglf as $pg_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $pg_obj->getId(), 'name' => $pg_obj->getName(), 'meal_policy_ids' => $pg_obj->getMealPolicy(), 'break_policy_ids' => $pg_obj->getBreakPolicy(), 'holiday_policy_ids' => $pg_obj->getHolidayPolicy(), 'exception_policy_control_id' => $pg_obj->getExceptionPolicyControlID(), 'user_ids' => $pg_obj->getUser(), 'over_time_policy_ids' => $pg_obj->getOverTimePolicy(), 'premium_policy_ids' => $pg_obj->getPremiumPolicy(), 'round_interval_policy_ids' => $pg_obj->getRoundIntervalPolicy(), 'accrual_policy_ids' => $pg_obj->getAccrualPolicy(), 'created_date' => $pg_obj->getCreatedDate(), 'created_by' => $pg_obj->getCreatedBy(), 'updated_date' => $pg_obj->getUpdatedDate(), 'updated_by' => $pg_obj->getUpdatedBy(), 'deleted_date' => $pg_obj->getDeletedDate(), 'deleted_by' => $pg_obj->getDeletedBy());
         }
     }
     $none_array_option = array('0' => TTi18n::gettext('-- None --'));
Ejemplo n.º 3
0
            $cj_obj = $cjlf->getCurrent();
            if (PRODUCTION == TRUE and DEMO_MODE == FALSE and $cj_obj->getLastRunDate() < time() - 172800 and $cj_obj->getCreatedDate() < time() - 172800) {
                $cron_out_of_date = 1;
            } else {
                $cron_out_of_date = 0;
            }
        }
        unset($cjlf, $cj_obj);
    } else {
        Debug::text('User NOT! Authenticated', __FILE__, __LINE__, __METHOD__, 10);
        if (isset($enable_wap) and $enable_wap == TRUE) {
            Redirect::Page(URLBuilder::getURL(NULL, Environment::GetBaseURL() . 'wap/wap_login.php'));
        } elseif (isset($enable_iphone) and $enable_iphone == TRUE) {
            Redirect::Page(URLBuilder::getURL(NULL, Environment::GetBaseURL() . 'iphone/login/login.php'));
        } else {
            Redirect::Page(URLBuilder::getURL(NULL, Environment::GetBaseURL() . 'Login.php'));
        }
        //exit;
    }
}
require_once Environment::getBasePath() . 'classes' . DIRECTORY_SEPARATOR . 'smarty' . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR . 'Smarty.class.php';
$smarty = new Smarty();
$smarty->compile_check = TRUE;
$smarty->template_dir = Environment::getTemplateDir();
$smarty->compile_dir = Environment::getTemplateCompileDir();
$smarty->assign('css_file', 'global.css.php');
$smarty->assign('IMAGES_URL', Environment::getImagesURL());
$smarty->assign('BASE_PATH', Environment::getBasePath());
$smarty->assign('APPLICATION_NAME', APPLICATION_NAME);
$smarty->assign('APPLICATION_VERSION', APPLICATION_VERSION);
$smarty->assign('DEPLOYMENT_ON_DEMAND', DEPLOYMENT_ON_DEMAND);
Ejemplo n.º 4
0
require_once Environment::getBasePath() . 'classes' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'Exception.class.php';
require_once Environment::getBasePath() . 'classes' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'Debug.class.php';
if (isset($_SERVER['REQUEST_URI'])) {
    Debug::Text('URI: ' . $_SERVER['REQUEST_URI'], __FILE__, __LINE__, __METHOD__, 10);
}
Debug::Text('Version: ' . APPLICATION_VERSION . ' Edition: ' . getTTProductEdition() . ' Production: ' . (int) PRODUCTION . ' Demo Mode: ' . (int) DEMO_MODE, __FILE__, __LINE__, __METHOD__, 10);
$profiler = new Profiler(true);
if (function_exists('bcscale')) {
    bcscale(10);
}
Debug::setEnable((bool) $config_vars['debug']['enable']);
Debug::setEnableTidy(FALSE);
Debug::setEnableDisplay((bool) $config_vars['debug']['enable_display']);
Debug::setBufferOutput((bool) $config_vars['debug']['buffer_output']);
Debug::setEnableLog((bool) $config_vars['debug']['enable_log']);
Debug::setVerbosity((int) $config_vars['debug']['verbosity']);
if (Debug::getEnable() == TRUE and Debug::getEnableDisplay() == TRUE) {
    ini_set('display_errors', 1);
} else {
    ini_set('display_errors', 0);
}
//Make sure we are using SSL if required.
if ($config_vars['other']['force_ssl'] == 1 and !isset($_SERVER['HTTPS']) and isset($_SERVER['HTTP_HOST']) and isset($_SERVER['REQUEST_URI']) and !isset($disable_https) and !isset($enable_wap) and php_sapi_name() != 'cli') {
    Redirect::Page('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    exit;
}
if (isset($enable_wap) and $enable_wap == TRUE) {
    header('Content-type: text/vnd.wap.wml', TRUE);
}
require_once 'Cache.inc.php';
require_once 'Database.inc.php';
Ejemplo n.º 5
0
     if (strtolower($action) == 'delete') {
         $delete = TRUE;
     } else {
         $delete = FALSE;
     }
     $pplf = TTnew('PremiumPolicyListFactory');
     foreach ($ids as $id) {
         $pplf->getByIdAndCompanyId($id, $current_company->getId());
         foreach ($pplf as $pp_obj) {
             $pp_obj->setDeleted($delete);
             if ($pp_obj->isValid()) {
                 $pp_obj->Save();
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'PremiumPolicyList.php'));
     break;
 default:
     BreadCrumb::setCrumb($title);
     $pplf = TTnew('PremiumPolicyListFactory');
     $pplf->getByCompanyId($current_company->getId());
     $pager = new Pager($pplf);
     $type_options = $pplf->getOptions('type');
     $show_no_policy_group_notice = FALSE;
     foreach ($pplf as $pp_obj) {
         if ((int) $pp_obj->getColumn('assigned_policy_groups') == 0) {
             $show_no_policy_group_notice = TRUE;
         }
         $policies[] = array('id' => $pp_obj->getId(), 'name' => $pp_obj->getName(), 'type_id' => $pp_obj->getType(), 'type' => $type_options[$pp_obj->getType()], 'assigned_policy_groups' => (int) $pp_obj->getColumn('assigned_policy_groups'), 'deleted' => $pp_obj->getDeleted());
     }
     $smarty->assign_by_ref('policies', $policies);
Ejemplo n.º 6
0
     }
     $ppf->setStartDate($data['start_date']);
     $ppf->setEndDate($data['end_date'] + 59);
     $ppf->setTransactionDate($data['transaction_date'] + 59);
     if (isset($data['advance_end_date'])) {
         $ppf->setAdvanceEndDate($data['advance_end_date']);
     }
     if (isset($data['advance_transaction_date'])) {
         $ppf->setAdvanceTransactionDate($data['advance_transaction_date']);
     }
     $ppf->setEnableImportData(TRUE);
     //Import punches when creating new pay periods.
     if ($ppf->isValid()) {
         $ppf->Save();
         $ppf->CommitTransaction();
         Redirect::Page(URLBuilder::getURL(array('id' => $data['pay_period_schedule_id']), 'PayPeriodList.php'));
         break;
     }
     $ppf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $pplf = TTnew('PayPeriodListFactory');
         $pplf->getByIdAndCompanyId($id, $current_company->getId());
         foreach ($pplf as $pp_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $pp_obj->getId(), 'company_id' => $pp_obj->getCompany(), 'pay_period_schedule_id' => $pp_obj->getPayPeriodSchedule(), 'pay_period_schedule_type_id' => $pp_obj->getPayPeriodScheduleObject()->getType(), 'start_date' => $pp_obj->getStartDate(), 'end_date' => $pp_obj->getEndDate(), 'transaction_date' => $pp_obj->getTransactionDate(), 'advance_end_date' => $pp_obj->getAdvanceEndDate(), 'advance_transaction_date' => $pp_obj->getAdvanceTransactionDate(), 'deleted' => $pp_obj->getDeleted(), 'created_date' => $pp_obj->getCreatedDate(), 'created_by' => $pp_obj->getCreatedBy(), 'updated_date' => $pp_obj->getUpdatedDate(), 'updated_by' => $pp_obj->getUpdatedBy(), 'deleted_date' => $pp_obj->getDeletedDate(), 'deleted_by' => $pp_obj->getDeletedBy());
         }
     } else {
         if (isset($pay_period_schedule_id) and $pay_period_schedule_id != '') {
             $ppslf = TTnew('PayPeriodScheduleListFactory');
Ejemplo n.º 7
0
$action = Misc::findSubmitButton();
switch ($action) {
    case 'phpinfo':
        phpinfo();
        exit;
        break;
    case 'back':
        Debug::Text('Back', __FILE__, __LINE__, __METHOD__, 10);
        Redirect::Page(URLBuilder::getURL(NULL, 'install.php'));
        break;
    case 'next':
        Debug::Text('Next', __FILE__, __LINE__, __METHOD__, 10);
        if ($external_installer == 1) {
            Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer), 'DatabaseSchema.php'));
        } else {
            Redirect::Page(URLBuilder::getURL(NULL, 'DatabaseConfig.php'));
        }
        break;
    default:
        break;
}
$handle = @fopen('http://www.timetrex.com/' . URLBuilder::getURL(array_merge(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'require'), $install_obj->getFailedRequirements()), 'pre_install.php'), "r");
@fclose($handle);
$check_all_requirements = $install_obj->checkAllRequirements();
if ($external_installer == 1 and $check_all_requirements == 0 and $install_obj->checkTimeTrexVersion() == 0) {
    //Using external installer and there is no missing requirements, automatically send to next page.
    Redirect::Page(URLBuilder::getURL(array('external_installer' => $external_installer, 'action:next' => 'next'), $_SERVER['SCRIPT_NAME']));
}
$smarty->assign_by_ref('install_obj', $install_obj);
$smarty->assign_by_ref('external_installer', $external_installer);
$smarty->display('install/Requirements.tpl');
Ejemplo n.º 8
0
 function Redirect($result)
 {
     if ($result !== TRUE) {
         Redirect::Page(URLBuilder::getURL(NULL, Environment::getBaseURL() . '/permission/PermissionDenied.php'));
     }
     return TRUE;
 }
Ejemplo n.º 9
0
     if (isset($department_data['other_id3'])) {
         $df->setOtherID3($department_data['other_id3']);
     }
     if (isset($department_data['other_id4'])) {
         $df->setOtherID4($department_data['other_id4']);
     }
     if (isset($department_data['other_id5'])) {
         $df->setOtherID5($department_data['other_id5']);
     }
     if ($df->isValid()) {
         $df->Save(FALSE);
         if (isset($department_data['branch_list'])) {
             $df->setBranch($department_data['branch_list']);
             $df->Save(TRUE);
         }
         Redirect::Page(URLBuilder::getURL(NULL, 'DepartmentList.php'));
         break;
     }
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $dlf = TTnew('DepartmentListFactory');
         $dlf->GetByIdAndCompanyId($id, $current_company->getId());
         foreach ($dlf as $department) {
             Debug::Arr($department, 'Department', __FILE__, __LINE__, __METHOD__, 10);
             $department_data = array('id' => $department->getId(), 'company_name' => $current_company->getName(), 'status' => $department->getStatus(), 'name' => $department->getName(), 'manual_id' => $department->getManualID(), 'branch_list' => $department->getBranch(), 'other_id1' => $department->getOtherID1(), 'other_id2' => $department->getOtherID2(), 'other_id3' => $department->getOtherID3(), 'other_id4' => $department->getOtherID4(), 'other_id5' => $department->getOtherID5(), 'created_date' => $department->getCreatedDate(), 'created_by' => $department->getCreatedBy(), 'updated_date' => $department->getUpdatedDate(), 'updated_by' => $department->getUpdatedBy(), 'deleted_date' => $department->getDeletedDate(), 'deleted_by' => $department->getDeletedBy());
         }
     } elseif ($action != 'submit') {
         $next_available_manual_id = DepartmentListFactory::getNextAvailableManualId($current_company->getId());
         $department_data = array('next_available_manual_id' => $next_available_manual_id);
     }
Ejemplo n.º 10
0
     if (isset($data['force_over_time_policy'])) {
         $hpf->setForceOverTimePolicy(TRUE);
     } else {
         $hpf->setForceOverTimePolicy(FALSE);
     }
     $hpf->setMinimumTime($data['minimum_time']);
     $hpf->setMaximumTime($data['maximum_time']);
     $hpf->setAbsencePolicyID($data['absence_policy_id']);
     $hpf->setRoundIntervalPolicyID($data['round_interval_policy_id']);
     if ($hpf->isValid()) {
         $hpf->Save(FALSE);
         $hpf->setRecurringHoliday($data['recurring_holiday_ids']);
         if ($hpf->isValid()) {
             $hpf->Save();
             $hpf->CommitTransaction();
             Redirect::Page(URLBuilder::getURL(NULL, 'HolidayPolicyList.php'));
             break;
         }
     }
     $hpf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $hplf = TTnew('HolidayPolicyListFactory');
         $hplf->getByIdAndCompanyID($id, $current_company->getID());
         foreach ($hplf as $hp_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $hp_obj->getId(), 'name' => $hp_obj->getName(), 'type_id' => $hp_obj->getType(), 'default_schedule_status_id' => $hp_obj->getDefaultScheduleStatus(), 'minimum_employed_days' => $hp_obj->getMinimumEmployedDays(), 'minimum_worked_period_days' => $hp_obj->getMinimumWorkedPeriodDays(), 'minimum_worked_days' => $hp_obj->getMinimumWorkedDays(), 'worked_scheduled_days' => $hp_obj->getWorkedScheduledDays(), 'minimum_worked_after_period_days' => $hp_obj->getMinimumWorkedAfterPeriodDays(), 'minimum_worked_after_days' => $hp_obj->getMinimumWorkedAfterDays(), 'worked_after_scheduled_days' => $hp_obj->getWorkedAfterScheduledDays(), 'average_time_days' => $hp_obj->getAverageTimeDays(), 'average_days' => $hp_obj->getAverageDays(), 'average_time_worked_days' => $hp_obj->getAverageTimeWorkedDays(), 'force_over_time_policy' => $hp_obj->getForceOverTimePolicy(), 'include_over_time' => $hp_obj->getIncludeOverTime(), 'include_paid_absence_time' => $hp_obj->getIncludePaidAbsenceTime(), 'minimum_time' => $hp_obj->getMinimumTime(), 'maximum_time' => $hp_obj->getMaximumTime(), 'round_interval_policy_id' => $hp_obj->getRoundIntervalPolicyID(), 'absence_policy_id' => $hp_obj->getAbsencePolicyID(), 'recurring_holiday_ids' => $hp_obj->getRecurringHoliday(), 'created_date' => $hp_obj->getCreatedDate(), 'created_by' => $hp_obj->getCreatedBy(), 'updated_date' => $hp_obj->getUpdatedDate(), 'updated_by' => $hp_obj->getUpdatedBy(), 'deleted_date' => $hp_obj->getDeletedDate(), 'deleted_by' => $hp_obj->getDeletedBy());
         }
     } elseif ($action != 'submit') {
         //Defaults
Ejemplo n.º 11
0
         //Redirect
     }
     if (isset($object_type_id) and isset($object_id)) {
         if (!isset($parent_id)) {
             $parent_id = 0;
         }
         $mf->setObjectType($object_type_id);
         $mf->setObject($object_id);
         $mf->setParent($parent_id);
         $mf->setPriority();
         $mf->setStatus('UNREAD');
         $mf->setSubject($message_data['subject']);
         $mf->setBody($message_data['body']);
         if ($mf->isValid()) {
             $mf->Save();
             Redirect::Page(URLBuilder::getURL(array('template' => $template, 'close' => 1, 'object_type_id' => $object_type_id, 'object_id' => $object_id), 'EmbeddedMessageList.php'));
             break;
         }
     }
 default:
     if (isset($object_type_id) and isset($object_id)) {
         $mlf = new MessageListFactory();
         $mlf->getByObjectTypeAndObject($object_type_id, $object_id);
         $i = 0;
         foreach ($mlf as $message) {
             //Get user info
             $ulf = new UserListFactory();
             $messages[] = array('id' => $message->getId(), 'parent_id' => $message->getParent(), 'object_type' => $message->getObjectType(), 'object_id' => $message->getObject(), 'priority' => $message->getPriority(), 'status' => $message->getStatus(), 'subject' => $message->getSubject(), 'body' => $message->getBody(), 'created_date' => $message->getCreatedDate(), 'created_by' => $message->getCreatedBy(), 'created_by_full_name' => $ulf->getById($message->getCreatedBy())->getCurrent()->getFullName(), 'updated_date' => $message->getUpdatedDate(), 'updated_by' => $message->getUpdatedBy(), 'deleted_date' => $message->getDeletedDate(), 'deleted_by' => $message->getDeletedBy());
             //Mark own messages as read.
             if ($message->getCreatedBy() != $current_user->getId()) {
                 $mlf_b = new MessageListFactory();
Ejemplo n.º 12
0
             } else {
                 //Delete level
                 if ($hierarchy_level_id > 0) {
                     $hlf->setID($hierarchy_level_id);
                     $hlf->setDeleted(TRUE);
                     $hlf->Save();
                 } else {
                     unset($hierarchy_level_data[$hierarchy_level_id]);
                 }
             }
         }
     }
     if ($redirect == 0 and $hcf->isValid()) {
         $hcf->Save(TRUE, TRUE);
         $hcf->CommitTransaction();
         Redirect::Page(URLBuilder::getURL(array(), 'HierarchyControlList.php'));
         break;
     }
     $hcf->FailTransaction();
 case 'delete_level':
     if (count($ids) > 0) {
         foreach ($ids as $hl_id) {
             if ($hl_id > 0) {
                 Debug::Text('Deleting level Row ID: ' . $hl_id, __FILE__, __LINE__, __METHOD__, 10);
                 $hllf = TTnew('HierarchyLevelListFactory');
                 $hllf->getById($hl_id);
                 if ($hllf->getRecordCount() == 1) {
                     foreach ($hllf as $hl_obj) {
                         $hl_obj->setDeleted(TRUE);
                         if ($hl_obj->isValid()) {
                             $hl_obj->Save();
Ejemplo n.º 13
0
         $plf->getByCompanyIdAndId($current_company->getID(), $ids);
         if ($plf->getRecordCount() > 0) {
             foreach ($plf as $p_obj) {
                 $p_obj->setDeleted(TRUE);
                 $p_obj->setEnableCalcTotalTime(TRUE);
                 $p_obj->setEnableCalcSystemTotalTime(TRUE);
                 $p_obj->setEnableCalcWeeklySystemTotalTime(TRUE);
                 $p_obj->setEnableCalcUserDateTotal(TRUE);
                 $p_obj->setEnableCalcException(TRUE);
                 $p_obj->Save();
             }
         }
         //$plf->FailTransaction();
         $plf->CommitTransaction();
     }
     Redirect::Page(URLBuilder::getURL(array('saved_search_id' => $saved_search_id, 'sort_column' => $sort_column, 'sort_order' => $sort_order, 'page' => $page), 'PunchList.php'));
     break;
 case 'search_form_delete':
 case 'search_form_update':
 case 'search_form_save':
 case 'search_form_clear':
 case 'search_form_search':
     Debug::Text('Action: ' . $action, __FILE__, __LINE__, __METHOD__, 10);
     $saved_search_id = UserGenericDataFactory::searchFormDataHandler($action, $filter_data, URLBuilder::getURL(NULL, 'PunchList.php'));
 default:
     BreadCrumb::setCrumb($title);
     extract(UserGenericDataFactory::getSearchFormData($saved_search_id, $sort_column));
     Debug::Text('Sort Column: ' . $sort_column, __FILE__, __LINE__, __METHOD__, 10);
     Debug::Text('Saved Search ID: ' . $saved_search_id, __FILE__, __LINE__, __METHOD__, 10);
     $sort_array = NULL;
     if ($sort_column != '') {
Ejemplo n.º 14
0
$off = TTnew('OtherFieldFactory');
$action = Misc::findSubmitButton();
switch ($action) {
    case 'submit':
        Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
        $off->setId($data['id']);
        $off->setCompany($current_company->getId());
        $off->setType($data['type_id']);
        $off->setOtherID1($data['other_id1']);
        $off->setOtherID2($data['other_id2']);
        $off->setOtherID3($data['other_id3']);
        $off->setOtherID4($data['other_id4']);
        $off->setOtherID5($data['other_id5']);
        if ($off->isValid()) {
            $off->Save();
            Redirect::Page(URLBuilder::getURL(array('type_id' => $data['type_id']), 'OtherFieldList.php'));
            break;
        }
    default:
        if (isset($id)) {
            BreadCrumb::setCrumb($title);
            $oflf = TTnew('OtherFieldListFactory');
            //$uwlf->GetByUserIdAndCompanyId($current_user->getId(), $current_company->getId() );
            $oflf->getById($id);
            foreach ($oflf as $obj) {
                $data = array('id' => $obj->getId(), 'company_id' => $obj->getCompany(), 'type_id' => $obj->getType(), 'other_id1' => $obj->getOtherID1(), 'other_id2' => $obj->getOtherID2(), 'other_id3' => $obj->getOtherID3(), 'other_id4' => $obj->getOtherID4(), 'other_id5' => $obj->getOtherID5(), 'created_date' => $obj->getCreatedDate(), 'created_by' => $obj->getCreatedBy(), 'updated_date' => $obj->getUpdatedDate(), 'updated_by' => $obj->getUpdatedBy(), 'deleted_date' => $obj->getDeletedDate(), 'deleted_by' => $obj->getDeletedBy());
            }
        }
        //Select box options;
        //$jif = TTnew( 'JobItemFactory' );
        $data['type_options'] = $off->getOptions('type');
Ejemplo n.º 15
0
     if (strtolower($action) == 'delete') {
         $delete = TRUE;
     } else {
         $delete = FALSE;
     }
     $otplf = TTnew('OverTimePolicyListFactory');
     foreach ($ids as $id) {
         $otplf->getByIdAndCompanyId($id, $current_company->getId());
         foreach ($otplf as $otp_obj) {
             $otp_obj->setDeleted($delete);
             if ($otp_obj->isValid()) {
                 $otp_obj->Save();
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'OverTimePolicyList.php'));
     break;
 default:
     $otplf = TTnew('OverTimePolicyListFactory');
     $otplf->getByCompanyId($current_company->getId());
     $pager = new Pager($otplf);
     $type_options = $otplf->getOptions('type');
     $show_no_policy_group_notice = FALSE;
     foreach ($otplf as $otp_obj) {
         if ((int) $otp_obj->getColumn('assigned_policy_groups') == 0) {
             $show_no_policy_group_notice = TRUE;
         }
         $policies[] = array('id' => $otp_obj->getId(), 'name' => $otp_obj->getName(), 'type_id' => $otp_obj->getType(), 'type' => $type_options[$otp_obj->getType()], 'trigger_time' => $otp_obj->getTriggerTime(), 'assigned_policy_groups' => (int) $otp_obj->getColumn('assigned_policy_groups'), 'deleted' => $otp_obj->getDeleted());
     }
     $smarty->assign_by_ref('policies', $policies);
     $smarty->assign_by_ref('show_no_policy_group_notice', $show_no_policy_group_notice);
Ejemplo n.º 16
0
 case 'submit':
     Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
     $hf->setId($help_data['id']);
     $hf->setStatus($help_data['status']);
     $hf->setType($help_data['type']);
     if (isset($help_data['private'])) {
         $hf->setPrivate(TRUE);
     } else {
         $hf->setPrivate(FALSE);
     }
     $hf->setHeading($help_data['heading']);
     $hf->setBody($help_data['body']);
     $hf->setKeywords($help_data['keywords']);
     if ($hf->isValid()) {
         $hf->Save();
         Redirect::Page(URLBuilder::getURL(NULL, 'HelpList.php'));
         break;
     }
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $hlf = TTnew('HelpListFactory');
         $hlf->getById($id);
         foreach ($hlf as $help_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $help_data = array('id' => $help_obj->GetId(), 'type' => $help_obj->getType(), 'status' => $help_obj->getStatus(), 'heading' => $help_obj->getHeading(), 'body' => $help_obj->getBody(), 'keywords' => $help_obj->getKeywords(), 'private' => $help_obj->getPrivate(), 'created_date' => $help_obj->getCreatedDate(), 'created_by' => $help_obj->getCreatedBy(), 'updated_date' => $help_obj->getUpdatedDate(), 'updated_by' => $help_obj->getUpdatedBy(), 'deleted_date' => $help_obj->getDeletedDate(), 'deleted_by' => $help_obj->getDeletedBy(), 'deleted' => $help_obj->getDeleted());
         }
     }
     //Select box options;
     $help_data['status_options'] = $hf->getOptions('status');
     $help_data['type_options'] = $hf->getOptions('type');
Ejemplo n.º 17
0
     } else {
         $utf->setSocialSecurityExempt(FALSE);
     }
     if (isset($tax_data['ui_exempt'])) {
         $utf->setUIExempt($tax_data['ui_exempt']);
     } else {
         $utf->setUIExempt(FALSE);
     }
     if (isset($tax_data['medicare_exempt'])) {
         $utf->setMedicareExempt($tax_data['medicare_exempt']);
     } else {
         $utf->setMedicareExempt(FALSE);
     }
     if ($utf->isValid()) {
         $utf->Save();
         Redirect::Page(URLBuilder::getURL(array('user_id' => $tax_data['user_id'], 'data_saved' => TRUE), 'EditUserTax.php'));
         //Redirect::Page( URLBuilder::getURL( NULL , 'UserList.php') );
         break;
     }
 default:
     if (isset($user_id) and $action != 'submit') {
         unset($tax_data);
         BreadCrumb::setCrumb($title);
         Debug::Text('User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
         $ulf = new UserListFactory();
         $ulf->getByIdAndCompanyId($user_id, $current_company->getId());
         if ($ulf->getRecordCount() > 0) {
             $user_obj = $ulf->getCurrent();
         }
         $utlf = new UserTaxListFactory();
         //$uwlf->GetByUserIdAndCompanyId($current_user->getId(), $current_company->getId() );
Ejemplo n.º 18
0
        if (strtolower($action) == 'delete') {
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $aplf = new AbsencePolicyListFactory();
        foreach ($ids as $id) {
            $aplf->getByIdAndCompanyId($id, $current_company->getId());
            foreach ($aplf as $ap_obj) {
                $ap_obj->setDeleted($delete);
                if ($ap_obj->isValid()) {
                    $ap_obj->Save();
                }
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'AbsencePolicyList.php'));
        break;
    default:
        $aplf = new AbsencePolicyListFactory();
        $aplf->getByCompanyId($current_company->getId());
        $pager = new Pager($aplf);
        $type_options = $aplf->getOptions('type');
        foreach ($aplf as $ap_obj) {
            $policies[] = array('id' => $ap_obj->getId(), 'name' => $ap_obj->getName(), 'type_id' => $ap_obj->getType(), 'type' => $type_options[$ap_obj->getType()], 'deleted' => $ap_obj->getDeleted());
        }
        $smarty->assign_by_ref('policies', $policies);
        $smarty->assign_by_ref('sort_column', $sort_column);
        $smarty->assign_by_ref('sort_order', $sort_order);
        $smarty->assign_by_ref('paging_data', $pager->getPageVariables());
        break;
}
Ejemplo n.º 19
0
     } else {
         $delete = FALSE;
     }
     $aplf = TTnew('AccrualPolicyListFactory');
     foreach ($ids as $id) {
         $aplf->getByIdAndCompanyId($id, $current_company->getId());
         $aplf->StartTransaction();
         foreach ($aplf as $ap_obj) {
             $ap_obj->setDeleted($delete);
             if ($ap_obj->isValid()) {
                 $ap_obj->Save();
             }
         }
         $aplf->CommitTransaction();
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'AccrualPolicyList.php'));
     break;
 default:
     $aplf = TTnew('AccrualPolicyListFactory');
     $aplf->getByCompanyId($current_company->getId());
     $pager = new Pager($aplf);
     $type_options = $aplf->getOptions('type');
     $show_no_policy_group_notice = FALSE;
     foreach ($aplf as $ap_obj) {
         if ((int) $ap_obj->getColumn('assigned_policy_groups') == 0) {
             $show_no_policy_group_notice = TRUE;
         }
         $policies[] = array('id' => $ap_obj->getId(), 'name' => $ap_obj->getName(), 'type_id' => $ap_obj->getType(), 'type' => $type_options[$ap_obj->getType()], 'assigned_policy_groups' => (int) $ap_obj->getColumn('assigned_policy_groups'), 'deleted' => $ap_obj->getDeleted());
     }
     $smarty->assign_by_ref('policies', $policies);
     $smarty->assign_by_ref('show_no_policy_group_notice', $show_no_policy_group_notice);
                 $epf->setEmailNotification($exception_data['email_notification_id']);
                 if (isset($exception_data['demerit']) and $exception_data['demerit'] != '') {
                     $epf->setDemerit($exception_data['demerit']);
                 }
                 if (isset($exception_data['grace']) and $exception_data['grace'] != '') {
                     $epf->setGrace($exception_data['grace']);
                 }
                 if (isset($exception_data['watch_window']) and $exception_data['watch_window'] != '') {
                     $epf->setWatchWindow($exception_data['watch_window']);
                 }
                 if ($epf->isValid()) {
                     $epf->Save();
                 }
             }
         }
         Redirect::Page(URLBuilder::getURL(NULL, 'ExceptionPolicyControlList.php'));
         break;
     }
 default:
     $type_options = $epf->getTypeOptions($current_company->getProductEdition());
     if (isset($id) and $id != '') {
         BreadCrumb::setCrumb($title);
         $epclf = new ExceptionPolicyControlListFactory();
         $epclf->getByIdAndCompanyID($id, $current_company->getID());
         foreach ($epclf as $epc_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $eplf = new ExceptionPolicyListFactory();
             $eplf->getByExceptionPolicyControlID($id);
             if ($eplf->getRecordCount() > 0) {
                 foreach ($eplf as $ep_obj) {
                     if (isset($type_options[$ep_obj->getType()])) {
Ejemplo n.º 21
0
     }
     if ($ppsf->isValid()) {
         //Pay Period schedule has to be saved before users can be assigned to it, so
         //do it this way.
         $ppsf->Save(FALSE);
         $ppsf->setEnableInitialPayPeriods(FALSE);
         if (isset($pay_period_schedule_data['user_ids'])) {
             $ppsf->setUser($pay_period_schedule_data['user_ids']);
         } else {
             $ppsf->setUser(array());
         }
         if ($ppsf->isValid()) {
             $ppsf->Save(TRUE);
             //$ppsf->FailTransaction();
             $ppsf->CommitTransaction();
             Redirect::Page(URLBuilder::getURL(NULL, 'PayPeriodScheduleList.php'));
             break;
         }
     }
     $ppsf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $ppslf = TTnew('PayPeriodScheduleListFactory');
         $ppslf->GetByIdAndCompanyId($id, $current_company->getId());
         foreach ($ppslf as $pay_period_schedule) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $pay_period_schedule_data = array('id' => $pay_period_schedule->getId(), 'company_id' => $pay_period_schedule->getCompany(), 'name' => $pay_period_schedule->getName(), 'description' => $pay_period_schedule->getDescription(), 'type' => $pay_period_schedule->getType(), 'start_week_day_id' => $pay_period_schedule->getStartWeekDay(), 'start_day_of_week' => $pay_period_schedule->getStartDayOfWeek(), 'transaction_date' => $pay_period_schedule->getTransactionDate(), 'primary_day_of_month' => $pay_period_schedule->getPrimaryDayOfMonth(), 'secondary_day_of_month' => $pay_period_schedule->getSecondaryDayOfMonth(), 'primary_transaction_day_of_month' => $pay_period_schedule->getPrimaryTransactionDayOfMonth(), 'secondary_transaction_day_of_month' => $pay_period_schedule->getSecondaryTransactionDayOfMonth(), 'transaction_date_bd' => $pay_period_schedule->getTransactionDateBusinessDay(), 'anchor_date' => $pay_period_schedule->getAnchorDate(), 'annual_pay_periods' => $pay_period_schedule->getAnnualPayPeriods(), 'day_start_time' => $pay_period_schedule->getDayStartTime(), 'time_zone' => $pay_period_schedule->getTimeZone(), 'new_day_trigger_time' => $pay_period_schedule->getNewDayTriggerTime(), 'maximum_shift_time' => $pay_period_schedule->getMaximumShiftTime(), 'shift_assigned_day_id' => $pay_period_schedule->getShiftAssignedDay(), 'timesheet_verify_type_id' => $pay_period_schedule->getTimeSheetVerifyType(), 'timesheet_verify_before_end_date' => $pay_period_schedule->getTimeSheetVerifyBeforeEndDate(), 'timesheet_verify_before_transaction_date' => $pay_period_schedule->getTimeSheetVerifyBeforeTransactionDate(), 'timesheet_verify_notice_before_transaction_date' => $pay_period_schedule->getTimeSheetVerifyNoticeBeforeTransactionDate(), 'timesheet_verify_notice_email' => $pay_period_schedule->getTimeSheetVerifyNoticeEmail(), 'user_ids' => $pay_period_schedule->getUser(), 'deleted' => $pay_period_schedule->getDeleted(), 'created_date' => $pay_period_schedule->getCreatedDate(), 'created_by' => $pay_period_schedule->getCreatedBy(), 'updated_date' => $pay_period_schedule->getUpdatedDate(), 'updated_by' => $pay_period_schedule->getUpdatedBy(), 'deleted_date' => $pay_period_schedule->getDeletedDate(), 'deleted_by' => $pay_period_schedule->getDeletedBy());
         }
     } elseif ($action != 'submit') {
         $pay_period_schedule_data = array('anchor_date' => TTDate::getBeginMonthEpoch(time()), 'day_start_time' => 0, 'new_day_trigger_time' => 3600 * 4, 'maximum_shift_time' => 3600 * 16, 'time_zone' => $current_user_prefs->getTimeZone(), 'type' => 20, 'timesheet_verify_type_id' => 10, 'timesheet_verify_before_end_date' => 0, 'timesheet_verify_before_transaction_date' => 0, 'annual_pay_periods' => 0);
Ejemplo n.º 22
0
                 $m_obj->setDeleted($delete);
                 $m_obj->Save();
             }
         } else {
             //Sent
             $mslf = TTnew('MessageSenderListFactory');
             $mslf->getByCompanyIdAndUserIdAndId($current_company->getId(), $current_user->getId(), $ids);
             foreach ($mslf as $m_obj) {
                 $m_obj->setDeleted($delete);
                 $m_obj->Save();
             }
         }
         //$mcf->FailTransaction();
         $mcf->CommitTransaction();
     }
     Redirect::Page(URLBuilder::getURL(array('filter_folder_id' => $filter_folder_id), 'UserMessageList.php'));
     break;
 default:
     $mclf = TTnew('MessageControlListFactory');
     $folder_options = $mclf->getOptions('folder');
     Debug::text('Filter Folder ID: ' . $filter_folder_id, __FILE__, __LINE__, __METHOD__, 9);
     if (!isset($filter_folder_id) or !in_array($filter_folder_id, array_keys($folder_options))) {
         Debug::text('Invalid Folder, using default ', __FILE__, __LINE__, __METHOD__, 9);
         $filter_folder_id = 10;
     }
     //Make sure folder and sort columns stays as we switch pages.
     URLBuilder::setURL(NULL, array('filter_folder_id' => $filter_folder_id, 'sort_column' => $sort_column, 'sort_order' => $sort_order));
     $mclf->getByCompanyIdAndUserIdAndFolder($current_user->getCompany(), $current_user->getId(), $filter_folder_id, $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $pager = new Pager($mclf);
     if ($mclf->getRecordCount() > 0) {
         $object_name_options = $mclf->getOptions('object_name');
Ejemplo n.º 23
0
             $cdf->setIncludePayStubEntryAccount(array());
         }
         if (isset($data['exclude_pay_stub_entry_account_ids'])) {
             $cdf->setExcludePayStubEntryAccount($data['exclude_pay_stub_entry_account_ids']);
         } else {
             $cdf->setExcludePayStubEntryAccount(array());
         }
         if (isset($data['user_ids'])) {
             $cdf->setUser($data['user_ids']);
         } else {
             $cdf->setUser(array());
         }
         if ($cdf->isValid()) {
             $cdf->Save(TRUE);
             $cdf->CommitTransaction();
             Redirect::Page(URLBuilder::getURL(NULL, 'CompanyDeductionList.php'));
             break;
         }
     }
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $cdlf = TTnew('CompanyDeductionListFactory');
         $cdlf->getByCompanyIdAndId($current_company->getId(), $id);
         foreach ($cdlf as $cd_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $cd_obj->getId(), 'company_id' => $cd_obj->getCompany(), 'status_id' => $cd_obj->getStatus(), 'type_id' => $cd_obj->getType(), 'name' => $cd_obj->getName(), 'start_date' => $cd_obj->getStartDate(), 'end_date' => $cd_obj->getEndDate(), 'minimum_length_of_service' => $cd_obj->getMinimumLengthOfService(), 'minimum_length_of_service_unit_id' => $cd_obj->getMinimumLengthOfServiceUnit(), 'maximum_length_of_service' => $cd_obj->getMaximumLengthOfService(), 'maximum_length_of_service_unit_id' => $cd_obj->getMaximumLengthOfServiceUnit(), 'minimum_user_age' => $cd_obj->getMinimumUserAge(), 'maximum_user_age' => $cd_obj->getMaximumUserAge(), 'calculation_id' => $cd_obj->getCalculation(), 'calculation_order' => $cd_obj->getCalculationOrder(), 'country' => $cd_obj->getCountry(), 'province' => $cd_obj->getProvince(), 'district' => $cd_obj->getDistrict(), 'company_value1' => $cd_obj->getCompanyValue1(), 'company_value2' => $cd_obj->getCompanyValue2(), 'user_value1' => $cd_obj->getUserValue1(), 'user_value2' => $cd_obj->getUserValue2(), 'user_value3' => $cd_obj->getUserValue3(), 'user_value4' => $cd_obj->getUserValue4(), 'user_value5' => $cd_obj->getUserValue5(), 'user_value6' => $cd_obj->getUserValue6(), 'user_value7' => $cd_obj->getUserValue7(), 'user_value8' => $cd_obj->getUserValue8(), 'user_value9' => $cd_obj->getUserValue9(), 'user_value10' => $cd_obj->getUserValue10(), 'lock_user_value1' => $cd_obj->getLockUserValue1(), 'lock_user_value2' => $cd_obj->getLockUserValue2(), 'lock_user_value3' => $cd_obj->getLockUserValue3(), 'lock_user_value4' => $cd_obj->getLockUserValue4(), 'lock_user_value5' => $cd_obj->getLockUserValue5(), 'lock_user_value6' => $cd_obj->getLockUserValue6(), 'lock_user_value7' => $cd_obj->getLockUserValue7(), 'lock_user_value8' => $cd_obj->getLockUserValue8(), 'lock_user_value9' => $cd_obj->getLockUserValue9(), 'lock_user_value10' => $cd_obj->getLockUserValue10(), 'pay_stub_entry_account_id' => $cd_obj->getPayStubEntryAccount(), 'include_pay_stub_entry_account_ids' => $cd_obj->getIncludePayStubEntryAccount(), 'exclude_pay_stub_entry_account_ids' => $cd_obj->getExcludePayStubEntryAccount(), 'include_account_amount_type_id' => $cd_obj->getIncludeAccountAmountType(), 'exclude_account_amount_type_id' => $cd_obj->getExcludeAccountAmountType(), 'user_ids' => $cd_obj->getUser(), 'created_date' => $cd_obj->getCreatedDate(), 'created_by' => $cd_obj->getCreatedBy(), 'updated_date' => $cd_obj->getUpdatedDate(), 'updated_by' => $cd_obj->getUpdatedBy(), 'deleted_date' => $cd_obj->getDeletedDate(), 'deleted_by' => $cd_obj->getDeletedBy());
         }
     } elseif ($action != 'submit') {
         $data = array('country' => 0, 'province' => 0, 'district' => 0, 'user_value1' => 0, 'user_value2' => 0, 'user_value3' => 0, 'user_value4' => 0, 'user_value5' => 0, 'user_value6' => 0, 'user_value7' => 0, 'user_value8' => 0, 'user_value9' => 0, 'user_value10' => 0, 'minimum_length_of_service' => 0, 'maximum_length_of_service' => 0, 'minimum_user_age' => 0, 'maximum_user_age' => 0, 'calculation_order' => 100);
     }
Ejemplo n.º 24
0
     } else {
         $delete = FALSE;
     }
     $clf = new CurrencyListFactory();
     if (isset($ids) and is_array($ids)) {
         foreach ($ids as $id) {
             $clf->getByIdAndCompanyId($id, $current_company->getId());
             foreach ($clf as $c_obj) {
                 $c_obj->setDeleted($delete);
                 if ($c_obj->isValid()) {
                     $c_obj->Save();
                 }
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'CurrencyList.php'));
     break;
 default:
     BreadCrumb::setCrumb($title);
     $clf = new CurrencyListFactory();
     $clf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $pager = new Pager($clf);
     $iso_code_options = $clf->getISOCodesArray();
     $base_currency = FALSE;
     foreach ($clf as $c_obj) {
         if ($c_obj->getBase() === TRUE) {
             $base_currency = TRUE;
         }
         $rows[] = array('id' => $c_obj->GetId(), 'status_id' => $c_obj->getStatus(), 'name' => $c_obj->getName(), 'iso_code' => $c_obj->getISOCode(), 'currency_name' => Option::getByKey($c_obj->getISOCode(), $iso_code_options), 'conversion_rate' => $c_obj->getConversionRate(), 'auto_update' => $c_obj->getAutoUpdate(), 'is_base' => $c_obj->getBase(), 'is_default' => $c_obj->getDefault(), 'deleted' => $c_obj->getDeleted());
     }
     $smarty->assign_by_ref('currencies', $rows);
Ejemplo n.º 25
0
 case 'submit':
     //Debug::setVerbosity(11);
     Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
     $fail_transaction = FALSE;
     if (TTDate::getDayDifference($data['start_date_stamp'], $data['end_date_stamp']) > 31) {
         Debug::Text('Date Range Exceeds 31 days, truncating', __FILE__, __LINE__, __METHOD__, 10);
         $sf->Validator->isTrue('date_stamp', FALSE, TTi18n::getText('Date range exceeds the maximum of 31 days'));
     }
     if (!(isset($filter_user_id) and is_array($filter_user_id) and count($filter_user_id) > 0)) {
         $sf->Validator->isTrue('user_id', FALSE, TTi18n::getText('Please select at least one employee'));
     }
     if (!($data['start_full_time_stamp'] != '' and $data['end_full_time_stamp'] != '' and $data['start_full_time_stamp'] >= time() - 86400 * 365 and $data['end_full_time_stamp'] <= time() + 86400 * 365)) {
         $sf->Validator->isTrue('date_stamp', FALSE, TTi18n::getText('Start or End dates are invalid'));
     }
     if ($sf->Validator->isValid()) {
         Redirect::Page(URLBuilder::getURL(array('action' => 'add_mass_schedule', 'filter_user_id' => $filter_user_id, 'data' => $data), '../progress_bar/ProgressBarControl.php'));
     }
 default:
     if ($action != 'submit' and !is_array($data)) {
         Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         $user_id = NULL;
         $user_date_id = NULL;
         $user_full_name = NULL;
         $user_default_branch = NULL;
         $user_default_department = NULL;
         $pay_period_is_locked = FALSE;
         $time_stamp = $start_date_stamp = $end_date_stamp = TTDate::getBeginDayEpoch(TTDate::getTime()) + 3600 * 12;
         //Noon
         $data = array('start_date_stamp' => $start_date_stamp, 'end_date_stamp' => $end_date_stamp, 'start_time' => strtotime('08:00 AM'), 'parsed_start_time' => strtotime('08:00 AM'), 'end_time' => strtotime('05:00 PM'), 'parsed_end_time' => strtotime('05:00 PM'), 'total_time' => 3600 * 9, 'branch_id' => $user_default_branch, 'department_id' => $user_default_department, 'dow' => array(1 => TRUE, 2 => TRUE, 3 => TRUE, 4 => TRUE, 5 => TRUE));
     }
     //var_dump($data);
Ejemplo n.º 26
0
     } else {
         $delete = FALSE;
     }
     $udlf = new UserDeductionListFactory();
     if (isset($ids) and is_array($ids)) {
         foreach ($ids as $id) {
             $udlf->getByCompanyIdAndId($current_company->getId(), $id, $current_company->getId());
             foreach ($udlf as $ud_obj) {
                 $ud_obj->setDeleted($delete);
                 if ($ud_obj->isValid()) {
                     $ud_obj->Save();
                 }
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(array('user_id' => $user_id), 'UserDeductionList.php'));
     break;
 default:
     BreadCrumb::setCrumb($title);
     //Get Permission Hierarchy Children first, as this can be used for viewing, or editing.
     $hlf = new HierarchyListFactory();
     $permission_children_ids = $hlf->getHierarchyChildrenByCompanyIdAndUserIdAndObjectTypeID($current_company->getId(), $current_user->getId());
     $udlf = new UserDeductionListFactory();
     $udlf->getByCompanyIdAndUserId($current_company->getId(), $user_id);
     $pager = new Pager($udlf);
     $ulf->getByIdAndCompanyId($user_id, $current_company->getId());
     if ($ulf->getRecordCount() > 0) {
         $user_obj = $ulf->getCurrent();
         if (is_object($user_obj)) {
             $is_owner = $permission->isOwner($user_obj->getCreatedBy(), $user_obj->getID());
             $is_child = $permission->isChild($user_obj->getId(), $permission_children_ids);
Ejemplo n.º 27
0
     }
     if ($cf->isNew() == TRUE) {
         $cf->setEnableAddCurrency(TRUE);
         $cf->setEnableAddPermissionGroupPreset(TRUE);
         $cf->setEnableAddStation(TRUE);
         $cf->setEnableAddPayStubEntryAccountPreset(TRUE);
         $cf->setEnableAddRecurringHolidayPreset(TRUE);
     }
     if ($cf->isValid()) {
         $cf->Save();
         //$cf->FailTransaction();
         $cf->CommitTransaction();
         if ($permission->Check('company', 'edit')) {
             Redirect::Page(URLBuilder::getURL(NULL, 'CompanyList.php'));
         } else {
             Redirect::Page(URLBuilder::getURL(NULL, '../index.php'));
         }
         break;
     }
     $cf->FailTransaction();
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $clf = new CompanyListFactory();
         if ($permission->Check('company', 'edit')) {
             $clf->GetByID($id);
         } else {
             $id = $current_company->getId();
             $clf->GetByID($id);
         }
         foreach ($clf as $company) {
                 } else {
                     //Delete week
                     if ($week_row_id > 0) {
                         $rstf->setID($week_row_id);
                         $rstf->setDeleted(TRUE);
                         $rstf->Save();
                     } else {
                         unset($week_row[$week_row_id]);
                     }
                 }
             }
         }
         if ($redirect == 0) {
             $rstcf->CommitTransaction();
             //$rstcf->FailTransaction();
             Redirect::Page(URLBuilder::getURL(NULL, 'RecurringScheduleTemplateControlList.php'));
             break;
         }
     }
     $rstcf->FailTransaction();
 case 'delete':
     if (count($ids) > 0) {
         foreach ($ids as $rst_id) {
             if ($rst_id > 0) {
                 Debug::Text('Deleting Week Row ID: ' . $rst_id, __FILE__, __LINE__, __METHOD__, 10);
                 $rstlf = TTnew('RecurringScheduleTemplateListFactory');
                 $rstlf->getById($rst_id);
                 if ($rstlf->getRecordCount() == 1) {
                     foreach ($rstlf as $rst_obj) {
                         $rst_obj->setDeleted(TRUE);
                         if ($rst_obj->isValid()) {
Ejemplo n.º 29
0
     $rf->setId($data['id']);
     $rf->setUserDate($data['user_id'], $data['date_stamp']);
     $rf->setType($data['type_id']);
     $rf->setStatus(30);
     if ($rf->isNew()) {
         Debug::Text('Object is NEW!', __FILE__, __LINE__, __METHOD__, 10);
         $rf->setMessage($data['message']);
     } else {
         Debug::Text('Object is NOT new!', __FILE__, __LINE__, __METHOD__, 10);
     }
     if ($rf->isValid()) {
         $request_id = $rf->Save();
         $rf->CommitTransaction();
         //$rf->FailTransaction();
         //Redirect::Page( URLBuilder::getURL( array('refresh' => FALSE ), '../CloseWindow.php') );
         Redirect::Page(URLBuilder::getURL(array('refresh' => TRUE), '../CloseWindow.php'));
     }
     $rf->FailTransaction();
 default:
     if ((int) $id > 0) {
         Debug::Text(' ID was passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         $rlf = new RequestListFactory();
         $rlf->getByIDAndCompanyID($id, $current_company->getId());
         foreach ($rlf as $r_obj) {
             //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $r_obj->getId(), 'user_date_id' => $r_obj->getId(), 'user_id' => $r_obj->getUserDateObject()->getUser(), 'user_full_name' => $r_obj->getUserDateObject()->getUserObject()->getFullName(), 'date_stamp' => $r_obj->getUserDateObject()->getDateStamp(), 'type_id' => $r_obj->getType(), 'status_id' => $r_obj->getStatus(), 'created_date' => $r_obj->getCreatedDate(), 'created_by' => $r_obj->getCreatedBy(), 'updated_date' => $r_obj->getUpdatedDate(), 'updated_by' => $r_obj->getUpdatedBy(), 'deleted_date' => $r_obj->getDeletedDate(), 'deleted_by' => $r_obj->getDeletedBy());
         }
     } elseif ($action != 'submit') {
         Debug::Text(' ID was NOT passed: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
         //UserID has to be set at minimum
         $data = array('user_id' => $current_user->getId(), 'user_full_name' => $current_user->getFullName(), 'date_stamp' => TTDate::getTime());
Ejemplo n.º 30
0
        Redirect::Page(URLBuilder::getURL(NULL, 'EditUserGroup.php', FALSE));
        break;
    case 'delete' or 'undelete':
        if (strtolower($action) == 'delete') {
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $uglf = TTnew('UserGroupListFactory');
        foreach ($ids as $id) {
            $uglf->getById($id);
            foreach ($uglf as $obj) {
                $obj->setDeleted($delete);
                $obj->Save();
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'UserGroupList.php'));
        break;
    default:
        $uglf = TTnew('UserGroupListFactory');
        $nodes = FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'HTML');
        //For some reason smarty prints out a blank row if nodes is false.
        if ($nodes !== FALSE) {
            $smarty->assign_by_ref('rows', $nodes);
        }
        $smarty->assign_by_ref('sort_column', $sort_column);
        $smarty->assign_by_ref('sort_order', $sort_order);
        //$smarty->assign_by_ref('paging_data', $pager->getPageVariables() );
        break;
}
$smarty->display('users/UserGroupList.tpl');