From a3f705c35843ab794e413f170a46e6686bf6305d Mon Sep 17 00:00:00 2001 From: alpeb Date: Mon, 17 Jan 2005 19:22:36 +0000 Subject: [PATCH] Do not create empty files if called from ProcessManager::new_process_version because they have already been copied (and recompiled with new path for shared code) --- .../src/ProcessManager/ActivityManager.php | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/phpgwapi/inc/galaxia_workflow/src/ProcessManager/ActivityManager.php b/phpgwapi/inc/galaxia_workflow/src/ProcessManager/ActivityManager.php index 62c74ead3e..b27380a220 100644 --- a/phpgwapi/inc/galaxia_workflow/src/ProcessManager/ActivityManager.php +++ b/phpgwapi/inc/galaxia_workflow/src/ProcessManager/ActivityManager.php @@ -505,7 +505,7 @@ class ActivityManager extends BaseManager { $pId is the processId $activityId is the activityId */ - function replace_activity($pId, $activityId, $vars) + function replace_activity($pId, $activityId, $vars, $create_files=true) { $TABLE_NAME = GALAXIA_TABLE_PREFIX."activities"; $now = date("U"); @@ -590,20 +590,22 @@ class ActivityManager extends BaseManager { die; } // Should create the code file - $wf_procname = $proc_info["wf_normalized_name"]; - $fw = fopen(GALAXIA_PROCESSES."/$wf_procname/code/activities/".$vars['wf_normalized_name'].'.php','w'); - fwrite($fw,'<'.'?'.'php'."\n".'?'.'>'); - fclose($fw); - - if($vars['wf_is_interactive']=='y') { - $fw = fopen(GALAXIA_PROCESSES."/$wf_procname/code/templates/".$vars['wf_normalized_name'].'.tpl','w'); - if (defined('GALAXIA_TEMPLATE_HEADER') && GALAXIA_TEMPLATE_HEADER) { - fwrite($fw,GALAXIA_TEMPLATE_HEADER . "\n"); - } - fclose($fw); - } + if ($create_files) { + $wf_procname = $proc_info["wf_normalized_name"]; + $fw = fopen(GALAXIA_PROCESSES."/$wf_procname/code/activities/".$vars['wf_normalized_name'].'.php','w'); + fwrite($fw,'<'.'?'.'php'."\n".'?'.'>'); + fclose($fw); + + if($vars['wf_is_interactive']=='y') { + $fw = fopen(GALAXIA_PROCESSES."/$wf_procname/code/templates/".$vars['wf_normalized_name'].'.tpl','w'); + if (defined('GALAXIA_TEMPLATE_HEADER') && GALAXIA_TEMPLATE_HEADER) { + fwrite($fw,GALAXIA_TEMPLATE_HEADER . "\n"); + } + fclose($fw); + } + } - $this->compile_activity($pId,$activityId); + $this->compile_activity($pId,$activityId); } // Get the id