provide type for upload
This commit is contained in:
parent
c172acfa7b
commit
824d3df9f9
|
@ -447,14 +447,14 @@ function getAvailablePDFFields($typeId) {
|
|||
* <br> boolean: required // true, if user must set a value for this column
|
||||
* <br> )
|
||||
*
|
||||
* @param string $scope account type
|
||||
* @param ConfiguredType $type account type
|
||||
* @param array $selectedModules selected account modules
|
||||
* @return array column list
|
||||
*/
|
||||
function getUploadColumns($scope, $selectedModules) {
|
||||
function getUploadColumns(&$type, $selectedModules) {
|
||||
$return = array();
|
||||
for ($i = 0; $i < sizeof($selectedModules); $i++) {
|
||||
$module = moduleCache::getModule($selectedModules[$i], $scope);
|
||||
$module = moduleCache::getModule($selectedModules[$i], $type->getScope());
|
||||
$return[$selectedModules[$i]] = $module->get_uploadColumns($selectedModules);
|
||||
}
|
||||
return $return;
|
||||
|
|
|
@ -122,7 +122,7 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
|
|||
$data = array(); // input values without first row
|
||||
$ids = array(); // <column name> => <column number for $data>
|
||||
// get input fields from modules
|
||||
$columns = getUploadColumns($type->getScope(), $selectedModules);
|
||||
$columns = getUploadColumns($type, $selectedModules);
|
||||
// read input file
|
||||
$handle = fopen ($_FILES['inputfile']['tmp_name'], "r");
|
||||
if (($head = fgetcsv($handle, 2000)) !== false ) { // head row
|
||||
|
|
|
@ -260,7 +260,7 @@ function showMainPage($type, $selectedModules) {
|
|||
$scope = $type->getScope();
|
||||
echo '<div class="' . $scope . '-bright smallPaddingContent">';
|
||||
// get input fields from modules
|
||||
$columns = getUploadColumns($scope, $selectedModules);
|
||||
$columns = getUploadColumns($type, $selectedModules);
|
||||
$modules = array_keys($columns);
|
||||
|
||||
echo "<form enctype=\"multipart/form-data\" action=\"massBuildAccounts.php\" method=\"post\">\n";
|
||||
|
|
Loading…
Reference in New Issue