foreach ($ids as $id) {
         //$dsclf->GetByIdAndUserId($id, $current_user->getId() );
         $hclf->GetById($id);
         foreach ($hclf as $hierarchy_control) {
             $hierarchy_control->setDeleted($delete);
             $hierarchy_control->Save();
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'HierarchyControlList.php'));
     break;
 default:
     $hclf = new HierarchyControlListFactory();
     $hclf->GetByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $pager = new Pager($hclf);
     $hotf = new HierarchyObjectTypeFactory();
     $object_type_options = $hotf->getOptions('object_type');
     foreach ($hclf as $hierarchy_control) {
         $object_type_ids = $hierarchy_control->getObjectType();
         $object_types = array();
         foreach ($object_type_ids as $object_type_id) {
             if (isset($object_type_options[$object_type_id])) {
                 $object_types[] = $object_type_options[$object_type_id];
             }
         }
         $hierarchy_controls[] = array('id' => $hierarchy_control->getId(), 'name' => $hierarchy_control->getName(), 'description' => $hierarchy_control->getDescription(), 'object_types' => $object_types, 'deleted' => $hierarchy_control->getDeleted());
         unset($object_types);
     }
     $smarty->assign_by_ref('hierarchy_controls', $hierarchy_controls);
     $smarty->assign_by_ref('sort_column', $sort_column);
     $smarty->assign_by_ref('sort_order', $sort_order);
     $smarty->assign_by_ref('paging_data', $pager->getPageVariables());
Example #2
0
     }
     if (!isset($user_data['hire_date']) or $user_data['hire_date'] == '') {
         $user_data['hire_date'] = time();
     }
 }
 //var_dump($user_data);
 //Select box options;
 $blf = new BranchListFactory();
 $branch_options = $blf->getByCompanyIdArray($company_id);
 $dlf = new DepartmentListFactory();
 $department_options = $dlf->getByCompanyIdArray($company_id);
 $culf = new CurrencyListFactory();
 $culf->getByCompanyId($company_id);
 $currency_options = $culf->getArrayByListFactory($culf, FALSE, TRUE);
 $hotf = new HierarchyObjectTypeFactory();
 $hierarchy_object_type_options = $hotf->getOptions('object_type');
 $hclf = new HierarchyControlListFactory();
 $hclf->getObjectTypeAppendedListByCompanyID($company_id);
 $hierarchy_control_options = $hclf->getArrayByListFactory($hclf, TRUE, TRUE);
 //Select box options;
 $user_data['branch_options'] = $branch_options;
 $user_data['department_options'] = $department_options;
 $user_data['currency_options'] = $currency_options;
 $user_data['sex_options'] = $uf->getOptions('sex');
 $user_data['status_options'] = $uf->getOptions('status');
 $clf = new CompanyListFactory();
 $user_data['country_options'] = $clf->getOptions('country');
 $user_data['province_options'] = $clf->getOptions('province', $user_data['country']);
 $utlf = new UserTitleListFactory();
 $user_titles = $utlf->getByCompanyIdArray($company_id);
 $user_data['title_options'] = $user_titles;