2 require_once 'Pman/Roo.php';
4 class Pman_Xtuple_Kingdee extends Pman_Roo
8 if(HTML_FlexyFramework::get()->cli) {
11 return parent::getAuth();
14 function fetchSchema($type)
20 require_once 'File/Convert.php';
22 $fc = new File_Convert("Pman/Xtuple/Kingdee/Schema/{$type}_Header.csv", 'text/csv');
23 $content = $fc->convert('text/csv');
25 $fh = fopen($content, 'r');
28 $this->jerr("invalid {$type}_Header file");
32 while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
37 $headers['Page' . $count][] = array(
39 'dataIndex' => preg_replace(array('/\s/','/\&|\.|\/|\-|\(|\)/'), array('_', ''), strtolower(trim($k))),
51 $fc = new File_Convert("Pman/Xtuple/Kingdee/Schema/{$type}_Schema.csv", 'text/csv');
52 $content = $fc->convert('text/csv');
54 $fh = fopen($content, 'r');
57 $this->jerr("invalid {$type}_Schema file");
63 while(false !== ($n = fgetcsv($fh,10000, ',', '"'))) {
64 if (!strlen(implode('', $n))) {
72 $headers['t_Schema'][] = array(
74 'dataIndex' => trim($k),
79 $headers['t_Schema'][] = array(
81 'dataIndex' => trim($k),
82 'dataFormat' => 'string',
93 foreach($cols as $i=>$k) {
105 foreach ($headers as $k => $v){
112 return array('SHEETS' => $sheets, 'SCHEMA' => $rows);