Ejemplo n.º 1
0
            }
        }
        $blf = new BranchListFactory();
        $branch_options = $blf->getByCompanyIdArray($current_company->getId());
        $dlf = new DepartmentListFactory();
        $department_options = $dlf->getByCompanyIdArray($current_company->getId());
        if ($current_company->getProductEdition() == 20) {
            $jlf = new JobListFactory();
            $jlf->getByCompanyIdAndUserIdAndStatus($current_company->getId(), $pc_data['user_id'], array(10, 20, 30, 40));
            $pc_data['job_options'] = $jlf->getArrayByListFactory($jlf, TRUE, TRUE);
            $pc_data['job_manual_id_options'] = $jlf->getManualIDArrayByListFactory($jlf, TRUE);
            $jilf = new JobItemListFactory();
            $jilf->getByCompanyId($current_company->getId());
            $pc_data['job_item_options'] = $jilf->getArrayByListFactory($jilf, TRUE, TRUE);
            $pc_data['job_item_manual_id_options'] = $jilf->getManualIdArrayByListFactory($jilf, TRUE);
        }
        //Select box options;
        $pc_data['status_options'] = $pf->getOptions('status');
        $pc_data['type_options'] = $pf->getOptions('type');
        $pc_data['branch_options'] = $branch_options;
        $pc_data['department_options'] = $department_options;
        //Get other field names
        $oflf = new OtherFieldListFactory();
        $pc_data['other_field_names'] = $oflf->getByCompanyIdAndTypeIdArray($current_company->getId(), 15);
        //Debug::Text('pc_data[date_stamp]: '. TTDate::getDate('DATE+TIME', $pc_data['date_stamp']), __FILE__, __LINE__, __METHOD__,10);
        $smarty->assign_by_ref('pc_data', $pc_data);
        break;
}
$smarty->assign_by_ref('pcf', $pcf);
$smarty->assign_by_ref('pf', $pf);
$smarty->display('punch/EditPunch.tpl');
 function getOtherFields($station_id)
 {
     Debug::Text('Getting Other Fields Map for Station ID: ' . $station_id, __FILE__, __LINE__, __METHOD__, 10);
     if ($station_id == '') {
         return FALSE;
     }
     $slf = new StationListFactory();
     $slf->getByStationID($station_id);
     if ($slf->getRecordCount() > 0) {
         $s_obj = $slf->getCurrent();
         $company_id = $s_obj->getCompany();
         Debug::Text('Company ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10);
         if ($company_id != FALSE) {
             $oflf = new OtherFieldListFactory();
             $retval = $oflf->getByCompanyIdAndTypeIdArray($company_id, 15);
             return $retval;
         }
     }
     Debug::Text('Returning FALSE!', __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }
 function getByCompanyIdAndTypeIDArray($id, $type_id, $limit = NULL, $page = NULL, $where = NULL, $order = NULL)
 {
     $oflf = new OtherFieldListFactory();
     $oflf->getByCompanyIdAndTypeID($id, $type_id, $limit = NULL, $page = NULL, $where = NULL, $order = NULL);
     if ($oflf->getRecordCount() > 0) {
         foreach ($oflf as $obj) {
             if ($obj->getOtherID1() != '') {
                 $retarr['other_id1'] = $obj->getOtherID1();
             }
             if ($obj->getOtherID2() != '') {
                 $retarr['other_id2'] = $obj->getOtherID2();
             }
             if ($obj->getOtherID3() != '') {
                 $retarr['other_id3'] = $obj->getOtherID3();
             }
             if ($obj->getOtherID4() != '') {
                 $retarr['other_id4'] = $obj->getOtherID4();
             }
             if ($obj->getOtherID5() != '') {
                 $retarr['other_id5'] = $obj->getOtherID5();
             }
             if ($obj->getOtherID6() != '') {
                 $retarr['other_id6'] = $obj->getOtherID6();
             }
             if ($obj->getOtherID7() != '') {
                 $retarr['other_id7'] = $obj->getOtherID7();
             }
             if ($obj->getOtherID8() != '') {
                 $retarr['other_id8'] = $obj->getOtherID8();
             }
             if ($obj->getOtherID9() != '') {
                 $retarr['other_id9'] = $obj->getOtherID9();
             }
             if ($obj->getOtherID10() != '') {
                 $retarr['other_id10'] = $obj->getOtherID10();
             }
         }
         if (isset($retarr)) {
             return $retarr;
         }
     }
     return FALSE;
 }
Ejemplo n.º 4
0
if (!$permission->Check('report', 'enabled') or !$permission->Check('report', 'view_user_information')) {
    $permission->Redirect(FALSE);
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Employee Information Report'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'generic_data', 'filter_data')));
//Debug::Arr($action, 'Action', __FILE__, __LINE__, __METHOD__,10);
//Debug::Arr($filter_data, 'Filter Data', __FILE__, __LINE__, __METHOD__,10);
URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('filter_data' => $filter_data));
$columns = array('-1010-employee_number' => TTi18n::gettext('Employee #'), '-1020-status' => TTi18n::gettext('Status'), '-1030-user_name' => TTi18n::gettext('User Name'), '-1040-phone_id' => TTi18n::gettext('Phone ID'), '-1050-ibutton_id' => TTi18n::gettext('iButton'), '-1060-first_name' => TTi18n::gettext('First Name'), '-1070-middle_name' => TTi18n::gettext('Middle Name'), '-1080-last_name' => TTi18n::gettext('Last Name'), '-1085-full_name' => TTi18n::gettext('Full Name'), '-1090-title' => TTi18n::gettext('Title'), '-1099-group' => TTi18n::gettext('Group'), '-1100-default_branch' => TTi18n::gettext('Branch'), '-1110-default_department' => TTi18n::gettext('Department'), '-1112-permission_control' => TTi18n::gettext('Permission Group'), '-1115-policy_group' => TTi18n::gettext('Policy Group'), '-1118-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1120-sex' => TTi18n::gettext('Sex'), '-1130-address1' => TTi18n::gettext('Address 1'), '-1140-address2' => TTi18n::gettext('Address 2'), '-1150-city' => TTi18n::gettext('City'), '-1160-province' => TTi18n::gettext('Province/State'), '-1170-country' => TTi18n::gettext('Country'), '-1180-postal_code' => TTi18n::gettext('Postal Code'), '-1190-work_phone' => TTi18n::gettext('Work Phone'), '-1200-home_phone' => TTi18n::gettext('Home Phone'), '-1210-mobile_phone' => TTi18n::gettext('Mobile Phone'), '-1220-fax_phone' => TTi18n::gettext('Fax Phone'), '-1230-home_email' => TTi18n::gettext('Home Email'), '-1240-work_email' => TTi18n::gettext('Work Email'), '-1250-birth_date' => TTi18n::gettext('Birth Date'), '-1260-hire_date' => TTi18n::gettext('Hire Date'), '-1270-termination_date' => TTi18n::gettext('Termination Date'), '-1280-sin' => TTi18n::gettext('SIN/SSN'), '-1289-note' => TTi18n::gettext('Note'), '-1290-institution' => TTi18n::gettext('Bank Institution'), '-1300-transit' => TTi18n::gettext('Bank Transit/Routing'), '-1310-account' => TTi18n::gettext('Bank Account'), '-1319-currency' => TTi18n::gettext('Currency'), '-1320-wage_type' => TTi18n::gettext('Wage Type'), '-1330-wage' => TTi18n::gettext('Wage'), '-1340-effective_date' => TTi18n::gettext('Wage Effective Date'), '-1500-language' => 'Language', '-1510-date_format' => 'Date Format', '-1520-time_format' => 'Time Format', '-1530-time_unit' => 'Time Units', '-1540-time_zone' => 'Time Zone', '-1550-items_per_page' => 'Rows Per page');
//Get custom user fields
$oflf = new OtherFieldListFactory();
$other_field_names = $oflf->getByCompanyIdAndTypeIdArray($current_company->getId(), 10);
if (is_array($other_field_names)) {
    $columns = Misc::prependArray($columns, $other_field_names);
}
if (!isset($filter_data['include_user_ids'])) {
    $filter_data['include_user_ids'] = array();
}
if (!isset($filter_data['exclude_user_ids'])) {
    $filter_data['exclude_user_ids'] = array();
}
if (!isset($filter_data['user_status_ids'])) {
    $filter_data['user_status_ids'] = array();
}
if (!isset($filter_data['group_ids'])) {
    $filter_data['group_ids'] = array();
Ejemplo n.º 5
0
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $oflf = new OtherFieldListFactory();
        foreach ($ids as $id) {
            $oflf->getByIdAndCompanyId($id, $current_company->getId());
            foreach ($oflf as $of_obj) {
                $of_obj->setDeleted($delete);
                $of_obj->Save();
            }
        }
        Redirect::Page(URLBuilder::getURL(array('type_id' => $type_id), 'OtherFieldList.php'));
        break;
    default:
        $oflf = new OtherFieldListFactory();
        $oflf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
        $pager = new Pager($oflf);
        //Get types
        $off = new OtherFieldFactory();
        $type_options = $off->getOptions('type');
        foreach ($oflf as $obj) {
            $rows[] = array('id' => $obj->getId(), 'type_id' => $obj->getType(), 'type' => $type_options[$obj->getType()], 'other_id1' => $obj->getOtherID1(), 'other_id2' => $obj->getOtherID2(), 'other_id3' => $obj->getOtherID3(), 'other_id4' => $obj->getOtherID4(), 'other_id5' => $obj->getOtherID5(), 'deleted' => $obj->getDeleted());
        }
        $smarty->assign_by_ref('rows', $rows);
        $smarty->assign_by_ref('type_id', $type_id);
        $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.º 6
0
 $user_data['title_options'] = $user_titles;
 //Get Permission Groups
 $pclf = new PermissionControlListFactory();
 $pclf->getByCompanyId($company_id);
 $user_data['permission_control_options'] = $pclf->getArrayByListFactory($pclf, FALSE);
 //Get pay period schedules
 $ppslf = new PayPeriodScheduleListFactory();
 $pay_period_schedules = $ppslf->getByCompanyIDArray($company_id);
 $user_data['pay_period_schedule_options'] = $pay_period_schedules;
 $pglf = new PolicyGroupListFactory();
 $policy_groups = $pglf->getByCompanyIDArray($company_id);
 $user_data['policy_group_options'] = $policy_groups;
 $uglf = new UserGroupListFactory();
 $user_data['group_options'] = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($company_id), 'TEXT', TRUE));
 //Get other field names
 $oflf = new OtherFieldListFactory();
 $user_data['other_field_names'] = $oflf->getByCompanyIdAndTypeIdArray($company_id, 10);
 $user_data['hierarchy_object_type_options'] = $hierarchy_object_type_options;
 $user_data['hierarchy_control_options'] = $hierarchy_control_options;
 //Company list.
 if ($permission->Check('company', 'view')) {
     $user_data['company_options'] = CompanyListFactory::getAllArray();
 } else {
     $user_data['company_options'] = array($company_id => $current_company->getName());
 }
 $filter_data = NULL;
 extract(UserGenericDataFactory::getSearchFormData($saved_search_id, NULL));
 if ($permission->Check('user', 'edit') == FALSE) {
     $filter_data['permission_children_ids'] = $permission_children_ids;
 }
 $ulf->getSearchByCompanyIdAndArrayCriteria($company_id, $filter_data);
Ejemplo n.º 7
0
        $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 = new 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 = new JobItemFactory();
        $data['type_options'] = $off->getOptions('type');
        $smarty->assign_by_ref('data', $data);
        break;
}
$smarty->assign_by_ref('off', $off);
$smarty->display('company/EditOtherField.tpl');