getAll(); $current_user = $cu_model = Users_Record_Model::getCurrentUserModel(); $sql = "SELECT * FROM vtiger_wf_types WHERE module = 'Workflow2'"; $result = $adb->query($sql); while($row = $adb->fetchByAssoc($result)) { $path = '/var/www/tasks/'.$row['type'].'/'; mkdir($path, true); $fp = fopen($path.'task.xml','w'); $string = ''."\n"; $string .= ''."\n"; $string .= ' '.$row['type'].''."\n"; $string .= ' '.$row['handlerclass'].''."\n"; $string .= ' '."\n"; $string .= ' '.$row['category'].''."\n"; $outputs = json_decode(html_entity_decode($row['output']), true); if(count($outputs) > 0) $string .= ''."\n"; foreach($outputs as $out) { $string .= ''.html_entity_decode($out[1]).''."\n"; } if(count($outputs) > 0) $string .= ''."\n"; if(strlen($row['singlemodule']) > 3) { $string .= ''."\n"; $module = json_decode(html_entity_decode($row['singlemodule']), true); foreach($module as $mod) { $string .= ''.$mod.''."\n"; } $string .= ''."\n"; } $string .= ' '.$row['helpurl'].''."\n"; if(strlen($row['persons']) > 3) { $outputs = json_decode(html_entity_decode($row['persons']), true); if(count($outputs) > 0) $string .= ''."\n"; foreach($outputs as $out) { $string .= ''.$out[1].''."\n"; } if(count($outputs) > 0) $string .= ''."\n"; } $string .= ' Stefan Warnat '; fwrite($fp, $string); fclose($fp); copy(dirname(__FILE__).'/../icons/'.$row['background'].'.png', $path.'icon.png'); } exit(); } public function validateRequest(Vtiger_Request $request) { $request->validateReadAccess(); } } ?>