} array_push($departments_array, $avail_department); } $avail_categories = Category::getAllCategories($pdo); $cats_array = array(); foreach ($avail_categories as $avail_category) { array_push($cats_array, $avail_category); } //////Populate department perm list///////////////// $dept_perms_array = array(); foreach ($departments_array as $dept) { $avail_dept_perms['name'] = $dept['name']; $avail_dept_perms['id'] = $dept['id']; array_push($dept_perms_array, $avail_dept_perms); } $allDepartments = Department::getAllDepartments($pdo); $GLOBALS['smarty']->assign('allDepartments', $allDepartments); $GLOBALS['smarty']->assign('current_user_dept', $current_user_dept); $GLOBALS['smarty']->assign('t_name', $t_name); $GLOBALS['smarty']->assign('is_admin', $user_obj->isAdmin()); $GLOBALS['smarty']->assign('avail_users', $users_array); $GLOBALS['smarty']->assign('avail_depts', $departments_array); $GLOBALS['smarty']->assign('cats_array', $cats_array); $GLOBALS['smarty']->assign('dept_perms_array', $dept_perms_array); $GLOBALS['smarty']->assign('user_id', $_SESSION['uid']); $GLOBALS['smarty']->assign('db_prefix', $GLOBALS['CONFIG']['db_prefix']); display_smarty_template('add.tpl'); udf_add_file_form(); // Call the plugin API callPluginMethod('onBeforeAdd'); display_smarty_template('_add_footer.tpl');
//CHM $query = "SELECT table_name FROM {$GLOBALS['CONFIG']['db_prefix']}udf WHERE field_type = '4'"; $result = mysql_query($query) or die("Error in query163: {$query}. " . mysql_error()); $num_rows = mysql_num_rows($result); $t_name = array(); $i = 0; while ($data = mysql_fetch_array($result)) { $explode_v = explode('_', $data['table_name']); $t_name = $explode_v[2]; $i++; } // For the User dropdown $avail_users = $user_perms_obj->user_obj->getAllUsers(); // We need to set a form value for the current department so that // it can be pre-selected on the form $avail_departments = Department::getAllDepartments(); $avail_categories = Category::getAllCategories(); $cats_array = array(); foreach ($avail_categories as $avail_category) { array_push($cats_array, $avail_category); } //////Populate department perm list///////////////// $dept_perms_array = array(); foreach ($avail_departments as $dept) { $avail_dept_perms['name'] = $dept['name']; $avail_dept_perms['id'] = $dept['id']; $avail_dept_perms['rights'] = $filedata->getDeptRights($dept['id']); array_push($dept_perms_array, $avail_dept_perms); } //////Populate users perm list///////////////// $user_perms_array = array();
$table_name_stmt = $pdo->prepare($table_name_query); $table_name_stmt->execute(); $result = $table_name_stmt->fetchAll(); $num_rows = $table_name_stmt->rowCount(); $t_name = array(); $i = 0; foreach ($result as $data) { $explode_v = explode('_', $data['table_name']); $t_name = $explode_v[2]; $i++; } // For the User dropdown $avail_users = $user_perms_obj->user_obj->getAllUsers($pdo); // We need to set a form value for the current department so that // it can be pre-selected on the form $avail_departments = Department::getAllDepartments($pdo); $avail_categories = Category::getAllCategories($pdo); $cats_array = array(); foreach ($avail_categories as $avail_category) { array_push($cats_array, $avail_category); } //////Populate department perm list///////////////// $dept_perms_array = array(); foreach ($avail_departments as $dept) { $avail_dept_perms['name'] = $dept['name']; $avail_dept_perms['id'] = $dept['id']; $avail_dept_perms['rights'] = $filedata->getDeptRights($dept['id']); array_push($dept_perms_array, $avail_dept_perms); } //////Populate users perm list///////////////// $user_perms_array = array();
} array_push($depts_array, $avail_department); } $avail_categories = Category::getAllCategories(); $cats_array = array(); foreach ($avail_categories as $avail_category) { array_push($cats_array, $avail_category); } //////Populate department perm list///////////////// $dept_perms_array = array(); foreach ($depts_array as $dept) { $avail_dept_perms['name'] = $dept['name']; $avail_dept_perms['id'] = $dept['id']; array_push($dept_perms_array, $avail_dept_perms); } $allDepartments = Department::getAllDepartments(); $GLOBALS['smarty']->assign('allDepartments', $allDepartments); $GLOBALS['smarty']->assign('current_user_dept', $current_user_dept); $GLOBALS['smarty']->assign('t_name', $t_name); $GLOBALS['smarty']->assign('is_admin', $user_obj->isAdmin()); $GLOBALS['smarty']->assign('avail_users', $users_array); $GLOBALS['smarty']->assign('avail_depts', $depts_array); $GLOBALS['smarty']->assign('cats_array', $cats_array); $GLOBALS['smarty']->assign('dept_perms_array', $dept_perms_array); $GLOBALS['smarty']->assign('user_id', $_SESSION['uid']); $GLOBALS['smarty']->assign('db_prefix', $GLOBALS['CONFIG']['db_prefix']); display_smarty_template('add.tpl'); // Call the plugin API callPluginMethod('onBeforeAdd'); udf_add_file_form(); display_smarty_template('_add_footer.tpl');