Added linework export with progress bar
This commit is contained in:
67
scripts/start_workflow_export.php
Executable file
67
scripts/start_workflow_export.php
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
|
||||
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||
|
||||
$me = new User(1);
|
||||
mfValuecache::singleton()->set("me", $me);
|
||||
|
||||
$request=array();
|
||||
|
||||
// Put commandline arguments into $request
|
||||
if(count($argv)) {
|
||||
$args=$argv;
|
||||
array_shift($args); // shift scriptname off of args array
|
||||
|
||||
foreach($args as $i => $arg) {
|
||||
if(preg_match('/^--([^ ]+)/',$arg,$m)) {
|
||||
if(!preg_match('/^--/',$args[$i+1])) {
|
||||
$request[$m[1]]=$args[$i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($request);exit;
|
||||
|
||||
|
||||
if(array_key_exists("uid", $request)) {
|
||||
if($request['uid']) {
|
||||
$uid = $request['uid'];
|
||||
unset($request['uid']);
|
||||
}
|
||||
} else {
|
||||
die("uid missing\n");
|
||||
}
|
||||
|
||||
|
||||
$filter = [];
|
||||
|
||||
foreach($request as $key => $value) {
|
||||
if(strlen($value)) {
|
||||
$filter[$key] = $value;
|
||||
} else {
|
||||
if($key == "status_id" || $key == "network_id" || $key == "networksection_id") {
|
||||
$filter[$key] = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$params = ['export_progress' => 1, 'uid' => $uid, 'filter' => $filter];
|
||||
|
||||
//var_dump($uid, $filter);exit;
|
||||
|
||||
$Layout=Layout::singleton();
|
||||
|
||||
$lc = new LineworkController();
|
||||
$lc->startExport($params);
|
||||
|
||||
$Layout->display();
|
||||
Reference in New Issue
Block a user