Fix errors found in FT. Command 'migrate-list-unassigned'. User Id in APP_DELAY.
This commit is contained in:
@@ -1038,7 +1038,7 @@ function migrate_new_cases_lists($command, $args, $opts)
|
||||
foreach ($workspaces as $workspace) {
|
||||
print_r("Upgrading database in " . pakeColor::colorize($workspace->name, "INFO") . "\n");
|
||||
try {
|
||||
$workspace->migrateList($workspace->name, true, $lang);
|
||||
$workspace->migrateList(true, $lang);
|
||||
echo "> List tables are done\n";
|
||||
} catch (Exception $e) {
|
||||
G::outRes("> Error: " . CLI::error($e->getMessage()) . "\n");
|
||||
@@ -1063,17 +1063,15 @@ function migrate_counters($command, $args)
|
||||
}
|
||||
}
|
||||
|
||||
function migrate_list_unassigned($command, $args, $opts)
|
||||
function migrate_list_unassigned($command, $args)
|
||||
{
|
||||
$filter = new InputFilter();
|
||||
$opts = $filter->xssFilterHard($opts);
|
||||
$args = $filter->xssFilterHard($args);
|
||||
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
foreach ($workspaces as $workspace) {
|
||||
print_r("Upgrading Unassigned List in" . pakeColor::colorize($workspace->name, "INFO") . "\n");
|
||||
try {
|
||||
$workspace->regenerateListUnassigned();
|
||||
$workspace->runRegenerateListUnassigned();
|
||||
echo "> Unassigned List is done\n";
|
||||
} catch (Exception $e) {
|
||||
G::outRes("> Error: " . CLI::error($e->getMessage()) . "\n");
|
||||
|
||||
@@ -2923,6 +2923,29 @@ class WorkspaceTools
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-populate only the unassigned list
|
||||
*/
|
||||
public function runRegenerateListUnassigned()
|
||||
{
|
||||
// Init Propel
|
||||
$this->initPropel(true);
|
||||
|
||||
// Initialize Propel objects
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
|
||||
// Clean table
|
||||
$stmt->executeQuery('TRUNCATE ' . $this->dbName . '.LIST_UNASSIGNED;');
|
||||
|
||||
// Populate table
|
||||
$stmt->executeQuery($this->regenerateListUnassigned());
|
||||
|
||||
// Update some fields
|
||||
$stmt->executeQuery($this->updateListProId('LIST_UNASSIGNED'));
|
||||
$stmt->executeQuery($this->updateListTasId('LIST_UNASSIGNED'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return query to update PRO_ID in list table
|
||||
*
|
||||
|
||||
@@ -199,6 +199,8 @@ class AppDelay extends BaseAppDelay
|
||||
if (empty($usrUid)) {
|
||||
global $RBAC;
|
||||
$usrUid = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
||||
}
|
||||
if (empty($usrId)) {
|
||||
$u = new Users();
|
||||
$usrId = $u->load($usrUid)['USR_ID'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user