insert_projects = $GLOBALS['phpgw']->db; $this->insert_partic = $GLOBALS['phpgw']->db; $this->insert_admin = $GLOBALS['phpgw']->db; //Insere o projeto guardando seu ID $proj_id = $this->insert_projects->query('INSERT INTO phpgw_agile_projects(proj_name,proj_description,proj_owner) VALUES(\''.$name.'\',\''.$description.'\',\''.$_SESSION['phpgw_info']['expresso']['user']['userid'].'\') RETURNING proj_id',__LINE__,__FILE__); $proj_id=substr($proj_id, 7); //Insere os usuarios participantes e posteriormente os administradores for($i=0;$i<$numPartic;$i++){ $this->insert_partic->query('INSERT INTO phpgw_agile_users_projects(uprojects_id_user, uprojects_id_project,uprojects_user_admin,uprojects_active) VALUES(\''.$particArray[$i].'\',\''.$proj_id.'\',FALSE,FALSE)',__LINE__,__FILE__); } for($i=0;$i<$numAdmin;$i++){ $this->insert_admin->query('INSERT INTO phpgw_agile_users_projects(uprojects_id_user, uprojects_id_project,uprojects_user_admin,uprojects_active) VALUES(\''.$adminArray[$i].'\',\''.$proj_id.'\',TRUE,FALSE)',__LINE__,__FILE__); } } public function soinsertSprint($name,$dt_start,$dt_end,$goal){ include_once('../phpgwapi/inc/class.db.inc.php'); $this->insert_sprint = $GLOBALS['phpgw']->db; //Insere o sprint $sprint_insert = $this->insert_sprint->query('INSERT INTO phpgw_agile_sprints(sprints_id_proj, sprints_name, sprints_dt_start, sprints_dt_end, sprints_goal) VALUES(\''.$_SESSION['phpgw_info']['expresso']['agileProjects']['active'].'\',\''.$name.'\',\''.$dt_start.'\',\''.$dt_end.'\', \''.$goal.'\')',__LINE__,__FILE__); } public function soinsertTask($sprint,$priority,$responsable,$title,$description,$estimate){ //system("echo $sprint >/tmp/control.txt"); include_once('../phpgwapi/inc/class.db.inc.php'); if($priority != 'true'){ $priority = 'f'; } else{ $priority = 't'; } $this->insert_task = $GLOBALS['phpgw']->db; //Insere a tarefa $task_insert = $this->insert_task->query('INSERT INTO phpgw_agile_tasks(tasks_id_sprints,tasks_priority, tasks_id_proj, tasks_id_owner, tasks_title, tasks_description, tasks_status, tasks_estimate) VALUES('.$sprint.',\''.$priority.'\','.$_SESSION['phpgw_info']['expresso']['agileProjects']['active'].','.$responsable.',\''.$title.'\',\''.$description.'\',\'sprintBacklog\','.$estimate.');',__LINE__,__FILE__); } } ?>