tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(1) |
2
|
3
|
4
|
5
|
6
|
7
(1) |
8
|
9
(3) |
10
(6) |
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
(5) |
23
|
24
|
25
|
26
|
27
|
28
|
|
|
|
|
From: Emmanuel D. <ede...@us...> - 2006-02-22 15:58:03
|
Update of /cvsroot/tutos/tutos/html/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17211/html/help Modified Files: Tag: BRANCH-2-0 projectio_new.html Added Files: Tag: BRANCH-2-0 projectio_synchro_new.html Log Message: - add synchronize to the projectio module --- NEW FILE: projectio_synchro_new.html --- <!--$Id: projectio_synchro_new.html,v 1.1.2.1 2006/02/22 15:57:55 edeweerdt Exp $ --> <div class="help"> <h1><?php echo $lang['ProjectIO'] ?>: Validation de synchronisation</h1> <p>Cet écran vous concerne la soumission à validation de la synchronisation de tâches.<br /> Cette page est accessible depuis l'aperçu projet dans le menu "Modules". </p> <p>Retour à l'<a href="help.php?p=projectio_new">aide du module d'import / export</a></p> <dl> <p>Chaque ligne du tableau correspond à une possibilité d'action sur tâche soumise à validation.<br/> Les colonnes du tableaux sont:</p> <dt>Tâche importée</dt> <dd> Cette colonne contient, dans la mesure du possible, le nom de la tâche dans le fichier.<br/> Elle est vide en cas de suppression.<br/> L'icone <img src="../html/classic/task.png" alt="task" /> permet d'avoir un aperçu du descriptif. </dd> <br/> <dt>Action</dt> <dd> Cette colonne contient l'action à effectuer sur la tâche.<br/> <img src="../html/classic/sync.png" alt="sync" /> pour la mise à jour d'une tâche<br/> <img src="../html/classic/newtask.png" alt="newtask" /> pour la création de la tâche<br/> <img src="../html/classic/remove.png" alt="remove" /> pour la destruction d'une tâche<br/> </dd> <br/> <dt>Tâche locale</dt> <dd> Cette colonne contient, dans la mesure du possible, le nom de la tâche dans le projet Tutos.<br/> Elle est vide en cas de création.<br/> L'icone <img src="../html/classic/task.png" alt="task" /> permet d'avoir un aperçu du descriptif. </dd> <br/> <dt>Evolution(s)</dt> <dd> <p>Cette colonne donne des détails sur les modifications à faire.<br> <img src="../html/classic/work.png" alt="work" /> indique que le temps aloué a changé<br/> <img src="../html/classic/sdate.png" alt="sdate" /> indique que la date de début et ou de fin a changée<br/> <img src="../html/classic/parent.png" alt="parent" /> indique que la parentée n'est plus la même<br/> En passant la souris sur l'une de ces icones, on peut obtenir des précisions sur les valeurs qui changent.</p> <p>Il est possible de voir apparaitre l'icone <img src="../html/classic/warning.png" alt="warning" /> avec un message précisant la nature du problème.<br/> Il s'agit principalement de l'impossibilité de supprimer une tâche sur laquelle des activitées ont été saisies.</p> </dd> <br/> <dt>Validez</dt> <dd> <p>La validation de chaque action se fait dans cette colonne.<br/> Le case peux ne pas être accessible s'il n'y a aucune différence ou si l'action n'est pas autorisée.</p> </dd> </dl> </div> Index: projectio_new.html =================================================================== RCS file: /cvsroot/tutos/tutos/html/help/Attic/projectio_new.html,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- projectio_new.html 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ projectio_new.html 22 Feb 2006 15:57:55 -0000 1.1.2.2 @@ -20,7 +20,7 @@ <p> - Les trois fonctions disponibles sont: <dl> - <dt><a name="import">Fonction d'import</a></dt> + <dt><img src="../html/classic/projectimport.png" alt="projectimport" /><a name="import">Fonction d'import</a></dt> <dd> <p>Cette fonction permet d'importer toutes les tâches du fichier projet dans le projet en cours de sélection.<br/> Si le projet Tutos contient déjà des tâches, les nouvelles seront ajoutées. @@ -34,12 +34,15 @@ </p> </dd> - <dt><a name="export">Fonction d'export</a></dt> + <dt><img src="../html/classic/projectsynchro.png" alt="projectsynchro" /><a name="synchro">Fonction de synchronisation</a></dt> <dd> - <p>A faire</p> + <p>Cette fonctionnalité permet de mettre à jour les tâches d'un projet Tutos depuis le fichier MS Project ou Planner qui a permis de les créer.</p> + <p>La synchronisation se fait sur le nom de la tâche insensible à la case. Il est donc fortement conseillé de ne pas changer les noms de tâche, ni d'avoir de doublon.</p> + <p>Tout changement est soumis à validation avant application (voir <a href="help.php?p=projectio_synchro_new"> page de validation</a>).<br/>Ces actions concernent la création de tâche nouvelle, la suppression de tâche manquante et la mise à jour de tâche.</p> + <p>Pour la mise à jour de tâche, seul le temps prévu, les dates de début et de fin ou la parentée sont prises en compte.</p> </dd> - <dt><a name="synchro">Fonction de synchronisation</a></dt> + <dt><img src="../html/classic/projectexport.png" alt="projectexport" /><a name="export">Fonction d'export</a></dt> <dd> <p>A faire</p> </dd> |
Update of /cvsroot/tutos/tutos/php/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14708/php/projectio Modified Files: Tag: BRANCH-2-0 fr.p3 projectio.pinc projectio_ins.php projectio_new.php Added Files: Tag: BRANCH-2-0 projectio_synchro_ins.php projectio_synchro_new.php Log Message: - add synchronize to the projectio module --- NEW FILE: projectio_synchro_ins.php --- <?php /** * @modulegroup projectio * @module projectio_ins * @package projectio */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; include_once 'product.pinc'; include_once 'task.pinc'; include_once 'address.pinc'; /* Check if user is allowed to use it */ check_user(); loadmodules('projectio','synchro','ins'); loadmodule('projectio'); error_log ("PROJECTIO_SYNCHRO_INS Start"); /* Check Input */ $gotourl = ''; $msg = ''; $new; $del; $sync; $pio = new projectio($dbconn); if ( empty($_REQUEST['gotourl']) ) { $gotourl = "projectio/projectio_synchro_new.php"; } else { $gotourl = $_REQUEST['gotourl']; } /* Verify PRO_ID */ if ( isset($_REQUEST['pro_id']) ) { $p = getObject($dbconn, $_REQUEST['pro_id']); if ($p != -1 && $p->getType() == 'product') { $pio->project = $p; $gotourl = addUrlParameter($gotourl, "pro_id=". $pio->project->id, true); } } if ( !$pio->project ){ $msg .= $lang['Err0048'] . "<br />"; } if ( isset($_REQUEST['new']) ) { $new = $_REQUEST['new']; } if ( isset($_REQUEST['del']) ) { $del = $_REQUEST['del']; } if ( isset($_REQUEST['sync']) ) { $sync = $_REQUEST['sync']; } if ($msg == "") { if (!isset($new) && !isset($del) && !isset($sync) && !count($new) && !count($del) && !count($sync) ) { $msg = $lang['ProjectIONothingToDo']; $gotourl = "product_show.php"; $gotourl = addUrlParameter($gotourl, "id=". $pio->project->id, true); } else { $dbconn->Begin("WORK"); if (isset($new)) { foreach ($new as $key => $val) { $msg .= $pio->synchroDoNew($key); } } if (isset($sync)) { foreach ($sync as $key => $val) { $msg .= $pio->synchroDoUpdate($key); } } if (isset($del)) { foreach ($del as $key => $val) { $msg .= $pio->synchroDoDel($key); } } $dbconn->Commit("WORK"); $gotourl = "task_overview.php"; $gotourl = addUrlParameter($gotourl, "id=". $pio->project->id, true); } $pio->synchroSessionClean(); } $gotourl = addMessage($gotourl,$msg,true); $gotourl = addSessionKey($gotourl,true); Header("Status: 302 Moved Temporarily"); Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); $dbconn->Close(); error_log ("PROJECTIO_SYNCHRO_INS Stop"); /* * CVS Info: $Id: projectio_synchro_ins.php,v 1.1.2.1 2006/02/22 15:52:42 edeweerdt Exp $ * $Author: edeweerdt $ */ ?> --- NEW FILE: projectio_synchro_new.php --- <?php /** * Import, export or synchronize tasks project with Planner or MS-Project file * * @modulegroup projectio * @module projectio_new * @package projectio */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; include_once 'product.pinc'; require_once 'layout/layout.pinc'; /* Check if user is allowed to use it */ check_user(); loadmodules('projectio','synchro','new'); loadmodule('projectio'); /** * import/export access for project */ class projectio_synchro_new extends layout { var $fct; var $obj; var $ref; var $name; var $ftype_sel; var $relations = array(); var $changes = array(); /** * display the form */ Function info() { global $tutos,$lang,$table; $pio_sess = $_SESSION['projectio']; $this->assign('action', "projectio_synchro_ins.php"); $this->assign('name', myentities($this->name)); $this->assign('pro_id', $this->ref->id); $this->assign('fct', PROJECTIO_FCT_SYNCHRO); $this->assign('fcticon', $tutos['projectio_fct_icon'][PROJECTIO_FCT_SYNCHRO]); $this->assign('ref', array('label' => $lang[$this->ref->getType()], 'name' => $this->ref->getFullName(), 'title' => $this->ref->getFullName(), 'link' => $this->ref->getUrl())); $this->assign('ftype', array('label' => $lang['ProjectIOFileType'], 'value' => $lang['ProjectIOFType'][$pio_sess['fileType']])); $this->assign('file', array('label' => $lang['ProjectIOFile'], 'value' => $pio_sess['fileName'])); $this->assign('synchro', array('title' => $lang['ProjectIOSyncList'], 'labels' => array($lang['ProjectIOTaskFile'], ' ', $lang['ProjectIOTaskTutos'], $lang['ProjectIOChanges'], $lang['ProjectIOValidate']), 'changes' => $this->changes ) ); $this->assign('InputOk', $lang['InputOk']); $this->assign('ChangesOk', $lang['ChangesOk']); $this->assign('Enter', $lang['Enter']); $this->assign('Reset', $lang['Reset']); $this->assign('FldsRequired', $lang['FldsRequired']); $this->template('projectio/projectio_synchro_new'); // $this->debug($this->changes); // $this->debug($this->relations); // $this->debug($_SESSION); } /** * navigate */ Function navigate() { global $lang; } /** * prepare */ Function prepare() { global $msg,$lang,$tutos; $this->obj = new projectio($this->dbconn); $this->name = $lang['ProjectIOfct'][PROJECTIO_FCT_SYNCHRO]; if ( isset($_REQUEST['pro_id']) ){ $this->ref = getObject($this->dbconn,$_REQUEST['pro_id']); if ( $this->fct == PROJECTIO_FCT_IMPORT && !$this->ref->see_ok() ) { $msg .= $lang['ProjectIOErr0002']; $this->stop = true; return; } if ( !$this->ref->del_ok() ) { $msg .= $lang['ProjectIOErr0002'] . "<br />"; $this->stop = true; return; } } if ( !$this->obj->synchroSessionCheck()) { $msg .= $lang['ProjectIOErr0004'] . "<br />"; $this->stop = true; return; } $this->obj->synchroGetRelations($this->ref, $this->relations); $this->obj->synchroGetChanges($this->relations, $this->changes); } } $l = new projectio_synchro_new($current_user); $l->display(); $dbconn->Close(); ?> Index: fr.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/projectio/Attic/fr.p3,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- fr.p3 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ fr.p3 22 Feb 2006 15:52:42 -0000 1.1.2.2 @@ -27,6 +27,26 @@ $lang['ProjectIOSelectType'] = "Sélectionnez le type de fichier"; $lang['ProjectIOFile'] = "Fichier"; +$lang['ProjectIOSyncList'] = "Liste des synchronisations de tâches"; +$lang['ProjectIOAction'] = "Action"; +$lang['ProjectIOTaskFile'] = "Tâche importée"; +$lang['ProjectIOTaskTutos'] = "Tâche locale"; +$lang['ProjectIOChanges'] = "Evolution(s)"; + +$lang['ProjectIOChgSDate'] = "Date de début: passe du %s au %s"; +$lang['ProjectIOChgEDate'] = "Date de fin: passe du %s au %s"; +$lang['ProjectIOChgWork'] = "Charge totale: passe de %sh à %sh"; +$lang['ProjectIOChgParent'] = "Changement d'ascendent de %s vers %s"; + +$lang['ProjectIOValidate'] = "Validez"; +$lang['ProjectIONoDelete'] = "Tâche contenant des activitées ou sous-tâches"; +$lang['ProjectIONoChange'] = "Pas de changement"; +$lang['ProjectIONothingToDo'] = "Aucune action de synchronisation faite"; + +$lang['ProjectIOMessCreate'] = "Création de la tâche \"%s\""; +$lang['ProjectIOMessDelete'] = "Suppréssion de la tâche \"%s\""; +$lang['ProjectIOMessUpdate'] = "Mise à jour de la tâche \"%s\""; + $lang['ProjectIOErr0001'] = "Erreur de sélection d'action"; $lang['ProjectIOErr0002'] = "Vous n'avez pas les droits suffisants pour cette action"; $lang['ProjectIOErr0003'] = "Type de fichier non reconnu"; @@ -40,4 +60,4 @@ ### Local Variables: *** ### mode:iso-accents *** ### End: *** -?> +?> \ No newline at end of file Index: projectio.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/projectio/Attic/projectio.pinc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- projectio.pinc 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ projectio.pinc 22 Feb 2006 15:52:42 -0000 1.1.2.2 @@ -48,14 +48,12 @@ global $lang; return ""; - error_log("PROJECTIO::GETADDLINK"); if ( $obj == -1 ) return ""; if (! is_object($obj) ) return ""; if ( $obj->id == -1 ) return ""; if (! $user->feature_ok(useprojectio,PERM_NEW) ) return ""; if (! $obj->use_ok() ) return ""; - error_log("PROJECTIO::GETADDLINK OK"); $x = array('url' => "projectio/projectio_new.php?pro_id=". $obj->id, 'text' => ($text == "" ? $lang['ProjectIOCreate'] : $text), 'image' => 'projectio', @@ -79,17 +77,7 @@ return useprojectio; } - /** - * Import project from file - */ - function importFile($file, $ftype, $msg) { - global $tutos; - - if (!$this->project || $this->project->getType() != 'product') { - $msg .= $lang['Err0048'] . "<br />"; - return; - } - + function readFile($file, $ftype) { $reader; if ($ftype == PROJECTIO_FTYPE_PLANNER) $reader = new plannerReader($file['tmp_name']); @@ -99,18 +87,36 @@ if (!$reader) { error_log("Parsing error for file ". $file['name']); - $msg .= $lang['ProjectIOErr0004'] . "<br />"; return false; } if (!$reader->read()) { error_log("Reading error for file ". $file['name']); - $msg .= $lang['ProjectIOErr0004'] . "<br />"; return false; } $data = $reader->getResult(); unset($reader); + return $data; + } + + /** + * Import project from file + */ + function importFile($file, $ftype, $msg) { + global $tutos; + + if (!$this->project || $this->project->getType() != 'product') { + $msg .= $lang['Err0048'] . "<br />"; + return; + } + + $data = $this->readFile($file, $ftype); + if (!$data) { + $msg .= $lang['ProjectIOErr0004'] . "<br />"; + return false; + } + /* read project roles */ $this->project->readroles(); $hasrole = array('current' => array(), 'new' => array()); @@ -123,7 +129,7 @@ } /* create tasks from file */ foreach ($data['subtasks'] as $stask) { - $this->createSubTasks($stask, $this->project->id, $hasrole); + $this->createSubTasks($stask, $this->project->id, $hasrole, $msg); } /* add new roles for project */ foreach ($hasrole['new'] as $newuser) { @@ -157,7 +163,7 @@ return $result; } - function createSubTasks($taskData, $parentId, &$hasrole) { + function createSubTasks($taskData, $parentId, &$hasrole, &$msg) { global $current_user; $t = null; @@ -216,6 +222,384 @@ } return true; } -} + function name2key($name) { + return base64_encode(strtolower(trim($name))); + } + + function ftaskList(&$taskData, &$listById, &$listByName) { + if ($taskData['id']) { + $listById[$taskData['id']] = $taskData; + $listByName[projectio::name2key($taskData['name'])][] = $taskData; + error_log("key = ".projectio::name2key($taskData['name'])); + } + foreach ($taskData['subtasks'] as $task) { + $task['parentId'] = $taskData['id']; + $this->ftaskList($task, $listById, $listByName); + } + } + + /** + * Read file for synchronize + */ + function synchroLoadFile($file, $ftype, &$msg) { + unset($_SESSION['projectio']); + $_SESSION['projectio'] = array(); + $pio_sess = &$_SESSION['projectio']; + + if (!$this->project || $this->project->getType() != 'product') { + $msg .= $lang['Err0048'] . "<br />"; + return; + } + $this->project->readTasks(); + + /** file tasks */ + $data = $this->readFile($file, $ftype); + if (!$data) { + $msg .= $lang['ProjectIOErr0004'] . "<br />"; + return false; + } + + $pio_sess['fileName'] = basename($file['name']); + $pio_sess['fileType'] = $ftype; + $pio_sess['synchroFile'] = $data; + $pio_sess['ftaskListById'] = array(); + $pio_sess['ftaskListByName'] = array(); + $this->ftaskList($pio_sess['synchroFile'], $pio_sess['ftaskListById'], $pio_sess['ftaskListByName']); + + /** project tasks */ + $pio_sess['ptaskListByName'] = array(); + foreach ($this->project->fulltasklist as $tid => $t){ + $kptask = projectio::name2key($t->name); + $pio_sess['ptaskListByName'][$kptask][] = $tid; + } + + return true; + } + + /** + * Check the validity of the session in this stage + */ + function synchroSessionCheck() { + $pio_sess = $_SESSION['projectio']; + + if (!$pio_sess['fileType'] || !isset($pio_sess['synchroFile']) || !isset($pio_sess['ftaskListById']) || !isset($pio_sess['ftaskListByName']) || !isset($pio_sess['ptaskListByName'])) { + return false; + } + return true; + } + + + /** + * List of task synchronisation + */ + function synchroGetRelations(&$project, &$relations) { + $pio_sess = &$_SESSION['projectio']; + $relations['sync'] = array(); + $relations['new'] = array(); + $relations['del'] = array(); + $sync = &$relations['sync']; + $new = &$relations['new']; + $del = &$relations['del']; + + /** search for sync and new tasks */ + foreach ($pio_sess['ftaskListById'] as $ftid => $ftask) { + $ftkey = projectio::name2key($ftask['name']); + if ( array_key_exists($ftkey, $pio_sess['ptaskListByName']) ) { + $sync[$ftkey] = $pio_sess['ptaskListByName'][$ftkey]; + } else { + $new[$ftkey] = true; + } + } + + /** search for task to delete */ + foreach (array_keys($pio_sess['ptaskListByName']) as $ptkey) { + if ( !array_key_exists($ptkey, $sync) && !array_key_exists($ptkey, $new) ) { + $del[$ptkey] = true; + } + } + } + + /** + * List of change for display + */ + function synchroGetChanges($relations, &$changes) { + global $lang; + + $pio_sess = &$_SESSION['projectio']; + unset($pio_sess['changes']); + + $changes = array('new' => array(), + 'del' => array(), + 'sync' => array() + ); + + foreach (array_keys($relations['new']) as $fkey) { + $list = $pio_sess['ftaskListByName'][$fkey]; + foreach ($list as $ftask) { + $changes['new'][] = array('fname' => $ftask['name'], + 'fid' => $ftask['id'], + 'fdesc' => $ftask['note'], + 'pname' => '', + 'pid' => '', + 'pdesc' => '', + 'authorized' => true + ); + } + } + foreach (array_keys($relations['del']) as $pkey) { + $list = $pio_sess['ptaskListByName'][$pkey]; + foreach ($list as $tid) { + $ptask = getObject($this->dbconn, $tid); + $auth = true; + timetrack::obj_read($ptask); + task::obj_read($ptask); + if (count($ptask->ttlist) > 0) { + $authmsg = $lang['ProjectIONoDelete']; + $auth = false; + } +/* if (count($ptask->tasklist) > 0) { + $authmsg = $lang['ProjectIONoDelete']; + $auth = false; + }*/ + $changes['del'][] = array('fname' => '', + 'fid' => '', + 'fdesc' => '', + 'pname' => $ptask->name, + 'pid' => $ptask->id, + 'pdesc' => $ptask->desc, + 'msg' => $authmsg, + 'authorized' => $auth + ); + } + } + foreach ($relations['sync'] as $fkey => $listTid) { + $list = $pio_sess['ftaskListByName'][$fkey]; + foreach ($list as $ftask) { + foreach ($listTid as $tid) { + $ptask = getObject($this->dbconn, $tid); + + $taskDiff = array(); + $auth = true; + if ( count($ftask['subtasks']) <= 0 || !$ptask->logical) + $taskDiff = projectio::taskDiff($ftask, $ptask); + + if (count($taskDiff) <= 0) { + $auth = false; + $authmsg = $lang['ProjectIONoChange']; + } + + $changes['sync'][] = array('fname' => $ftask['name'], + 'fid' => $ftask['id'], + 'fdesc' => $ftask['note'], + 'pname' => $ptask->name, + 'pid' => $ptask->id, + 'pdesc' => $ptask->desc, + 'diff' => $taskDiff, + 'msg' => $authmsg, + 'authorized' => $auth + ); + } + } + } + $pio_sess['changes'] = $changes; + } + + function taskDiff($ftask, $ptask) { + global $lang; + $pio_sess = &$_SESSION['projectio']; + + $result = array(); + if (count($ftask['subtasks'])<=0 && count($ptask->tasklist)<=0 && $ftask['work'] != $ptask->volume) { + $result[] = array('what' => 'work', + 'title' => addslashes(sprintf($lang['ProjectIOChgWork'], + $ptask->volume, + $ftask['work'])) + ); + } + + if ( strftime("%Y%m%d",$ftask['start']) != $ptask->s_start->getYYYYMMDD() ) { + $result[] = array('what' => 'sdate', + 'title' => addslashes(sprintf($lang['ProjectIOChgSDate'], + $ptask->s_start->getYYYYMMDD(), + strftime("%Y%m%d",$ftask['start']) )) + ); + } + + if ( !$ptask->milestone && strftime("%Y%m%d",$ftask['end']) != $ptask->s_end->getYYYYMMDD() ) { + $result[] = array('what' => 'edate', + 'title' => addslashes(sprintf($lang['ProjectIOChgEDate'], + $ptask->s_end->getYYYYMMDD(), + strftime("%Y%m%d",$ftask['end']) )) + ); + } + + $local_ftask = $pio_sess['ftaskListById'][$ftask['id']]; + $f_parent = null; + $p_parent = null; + if ($local_ftask['parentId']) + $f_parent = $pio_sess['ftaskListById'][$local_ftask['parentId']]; + if ($ptask->parent->getType() == 'task') + $p_parent = $ptask->parent; + + if ( isset($f_parent) && isset($p_parent)) { + if (projectio::name2key($f_parent['name']) != projectio::name2key($p_parent->name)) { + $result[] = array('what' => 'parent', + 'title' => addslashes(sprintf($lang['ProjectIOChgParent'], $p_parent->name, $f_parent['name'])) + ); + } + } else if ( !isset($f_parent) xor !isset($p_parent)) { + $result[] = array('what' => 'parent', + 'title' => sprintf($lang['ProjectIOChgParent'], + isset($p_parent) ? $p_parent->name : $lang['Project'], + isset($f_parent) ? $f_parent['name'] : $lang['Project']) + ); + } + return $result; + } + + function synchroDoNew ($key) { + global $lang, $current_user; + $msg = ""; + + $pio_sess = $_SESSION['projectio']; + $change = $pio_sess['changes']['new'][$key]; +// $msg .= "SYNCHRONIZE: NEW ".$change['fid'].$change['fname']."<br/>"; + + $taskData = $pio_sess['ftaskListById'][$change['fid']]; + $parentId = $this->project->id; + if ($taskData['parentId']) { + $fparent = $pio_sess['ftaskListById'][$taskData['parentId']]; + $parentId = $pio_sess['ptaskListByName'][projectio::name2key($fparent['name'])][0]; + } + if (!$parentId) { + $msg = ("Can't find parent for new task"); + $parentId = $this->project->id; + } + + error_log("Create Task \"".$taskData['name']."\" id=".$taskData['id']. " parentId=".$parentId); + + $t = new task($this->dbconn); + $t->p_id = $parentId; + + $t->setName(trim(StripSlashes($taskData['name']))); + $t->setDescription(trim(StripSlashes($taskData['note']))); + $t->logical = (count($taskData['subtasks'])>0) ? 1 : 0; + $t->milestone = ($taskData['milestone']) ? 1 : 0; + + $s_start = new DateTime(0); + $s_start->setDateTimeTS($taskData['start']); + $s_end = new DateTime(0); + $s_end->setDateTimeTS($taskData['end']); + + $t->worker = array(); + + if (!count($taskData['resources'])) { + $t->worker[$current_user->id] = $current_user; + } else { + // search for user by name + foreach ($taskData['resources'] as $resource) { + $newusers = $this->searchUser($resource['name']); + foreach ($newusers as $newuser) { + $t->worker[$newuser->id] = $newuser; + if ( !isset($hasrole['current'][$newuser->id]) ) { + $hasrole['new'][$newuser->id] = $newuser; + } + } + } + } + + $t->setState(TASK_PRE); + $t->setVolume($taskData['work']); + $t->setVolumeTodo($taskData['work']); + $t->setVolumeDone(0); + if ($t->milestone) + $s_end = $s_start; + + $t->setSStart($s_start); + $t->setSEnd($s_end); + + $t->parent = getObject($this->dbconn,$t->p_id); + $msg .= $t->save(); + $msg .= sprintf($lang['ProjectIOMessCreate']."<br/>", $t->name); + + return $msg; + } + + function synchroDoDel ($key) { + global $lang; + $msg = ""; + + $pio_sess = $_SESSION['projectio']; + $change = $pio_sess['changes']['del'][$key]; + + $t = getObject($this->dbconn,$change['pid']); + $msg .= $t->delete(); + + $msg .= sprintf($lang['ProjectIOMessDelete']."<br/>", $t->name); + return $msg; + } + + function synchroDoUpdate ($key) { + global $lang; + $msg = ""; + + $pio_sess = $_SESSION['projectio']; + $change = $pio_sess['changes']['sync'][$key]; + + $t = getObject($this->dbconn,$change['pid']); + if (!isset($t) || $t->getType() != 'task') { + $msg .= $lang['Err0048']."<br/>"; + } else { + $taskData = $pio_sess['ftaskListById'][$change['fid']]; + foreach ($change['diff'] as $d) { + switch ($d['what']) { + + case 'work': + $t->setVolume($taskData['work']); + if ($t->state == TASK_PRE) + $t->setVolumeTodo($taskData['work']); + break; + + case 'sdate': + $s_start = new DateTime(0); + $s_start->setDateTimeTS($taskData['start']); + $t->setSStart($s_start); + if ($t->milestone) { + $s_end = $s_start; + $t->setSEnd($s_end); + } + break; + + case 'edate': + $s_end = new DateTime(0); + $s_end->setDateTimeTS($taskData['end']); + $t->setSEnd($s_end); + break; + + case 'parent': + $parentId = $this->project->id; + if ($taskData['parentId']) { + $fparent = $pio_sess['ftaskListById'][$taskData['parentId']]; + $parentId = $pio_sess['ptaskListByName'][projectio::name2key($fparent['name'])][0]; + } + if (!$parentId) { + $msg = ("Can't find parent for new task"); + $parentId = $this->project->id; + } + $t->p_id = $parentId; + $t->parent = getObject($this->dbconn,$parentId); + break; + } + } + $msg .= $t->save(); + $msg .= sprintf($lang['ProjectIOMessUpdate']."<br/>", $t->name); + } + return $msg; + } + + function synchroSessionClean() { + unset($_SESSION['projectio']); + } +} ?> \ No newline at end of file Index: projectio_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/projectio/Attic/projectio_ins.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- projectio_ins.php 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ projectio_ins.php 22 Feb 2006 15:52:42 -0000 1.1.2.2 @@ -78,37 +78,53 @@ /* Verify Uploaded FILE */ -if ( isset($_FILES['projectfile']) ) { - $fi = $_FILES['projectfile']; - $fname = basename($fi['name']); - $localfile = $fi['tmp_name']; - $type = $fi['type']; - - if (is_uploaded_file($fi['tmp_name']) ) { - error_log("FILE $fname TO $localfile TYPE $type"); - $file = $fi; +if ($fct == PROJECTIO_FCT_IMPORT || $fct == PROJECTIO_FCT_SYNCHRO) { + if ( isset($_FILES['projectfile']) ) { + $fi = $_FILES['projectfile']; + $fname = basename($fi['name']); + $localfile = $fi['tmp_name']; + $type = $fi['type']; + + if (is_uploaded_file($fi['tmp_name']) ) { + error_log("FILE $fname TO $localfile TYPE $type"); + $file = $fi; + } + } + if ( !$file ) { + $msg .= $lang['ProjectIOErr0004'] . "<br />"; } -} -if ( !$file ) { - $msg .= $lang['ProjectIOErr0004'] . "<br />"; } - # other modules $msg .= module_parseforms($current_user,$m,$gotourl); if ( $msg == "" ) { - error_log(">>>>>>>>>>>>>GLOOOOOOOOPS"); - - $dbconn->Begin("WORK"); - $import_result = $pio->importFile($file, $ftype, &$msg); - $dbconn->Commit("WORK"); - if ($import_result) { - $gotourl = "task_overview.php?id=" . $pio->project->id; + switch ($fct) { + case PROJECTIO_FCT_IMPORT : + $dbconn->Begin("WORK"); + $import_result = $pio->importFile($file, $ftype, &$msg); + $dbconn->Commit("WORK"); + + if ($import_result) { + $gotourl = "task_overview.php"; + $gotourl = addUrlParameter($gotourl, "id=". $pio->project->id, true); + } + break; + + case PROJECTIO_FCT_EXPORT : + break; + + case PROJECTIO_FCT_SYNCHRO : + $synchro_result = $pio->synchroLoadFile($file, $ftype, $msg); + if ($synchro_result) { + $gotourl = "projectio/projectio_synchro_new.php"; + $gotourl = addUrlParameter($gotourl, "pro_id=". $pio->project->id, true); + break; + } } } Index: projectio_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/projectio/Attic/projectio_new.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- projectio_new.php 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ projectio_new.php 22 Feb 2006 15:52:42 -0000 1.1.2.2 @@ -37,7 +37,6 @@ Function info() { global $tutos,$lang,$table; - error_log ("PROJECTIO_NEW::INFO start"); $this->assign('action', "projectio_ins.php"); $this->assign('name', myentities($this->name)); $this->assign('pro_id', $this->ref->id); @@ -71,7 +70,6 @@ */ Function navigate() { global $lang; - error_log ("PROJECTIO_NEW::NAVIGATE start"); } /** @@ -80,9 +78,8 @@ Function prepare() { global $msg,$lang,$tutos; - error_log ("PROJECTIO_NEW::PREPARE start"); - $this->obj = new projectio($this->dbconn); + unset($_SESSION['projectio']); if ( isset($_REQUEST['fct']) ) { $this->fct = $_REQUEST['fct']; |
From: Emmanuel D. <ede...@us...> - 2006-02-22 15:52:49
|
Update of /cvsroot/tutos/tutos/templates/classic/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14708/templates/classic/projectio Modified Files: Tag: BRANCH-2-0 projectio_new.tpl Added Files: Tag: BRANCH-2-0 projectio_synchro_new.tpl Log Message: - add synchronize to the projectio module --- NEW FILE: projectio_synchro_new.tpl --- {* TUTOS MANTIS editing *} {* $Id: projectio_synchro_new.tpl,v 1.1.2.1 2006/02/22 15:52:42 edeweerdt Exp $ *} <!-- projectio_synchro_new start --> {literal} <script type="text/javascript" language="JavaScript"> <!-- function CheckAll2() { for (var i=0; i < document.forms['projectiosynchronew'].elements.length; i++) { var e = document.forms['projectiosynchronew'].elements[i]; if ( (e.name != 'checkit') && (!e.disabled) ) e.checked = document.forms['projectiosynchronew'].checkit.checked; } } //--> </script> {/literal} <form name="projectiosynchronew" action="{$action}" method="post"> <input type="hidden" name="pro_id" value="{$pro_id}" /> <table class="summary" style="margin-left: 0px;"> <thead> <tr><th colspan="4">{$name}</th></tr> </thead> <tbody> <tr> <td class="desc">{$ref.label}</td> <td class="data"><a href="{$base}/php/{$ref.link}" title="{$ref.title}">{$ref.name}</a></td> </tr> <tr> <td class="desc">{$ftype.label}</td> <td class="data">{$ftype.value}</td> </tr> <tr> <td class="desc"><img src="{$base}/html/classic/{$fcticon}.png" alt="{$fct}}" />{$file.label}</td> <td class="data">{$file.value}</td> </tr> </tbody> </table> <table class="overview" cellpadding="0" cellspacing="0" style="margin-left: 0px;"> <thead> <tr><th colspan="5">{$synchro.title}</th></tr> <tr> {foreach name=synclabels from=$synchro.labels item=slabel} <th>{$slabel} {if $smarty.foreach.synclabels.last}<br/><input type="checkbox" name="checkit" >{/if} </th> {/foreach} </tr> </thead> <tfoot> <tr> <th colspan="3" align="right"> <label for="RESET">{$Reset}</label> <input id="RESET" name="RESET" type="reset" value="{$Reset}" title="{$Reset}" /> </th> <th colspan="2" align="right"> <label for="OK">{$InputOk}</label> <input id="OK" name="OK" type="submit" value="{$Enter}" title="{$Enter}" /> </th> </tr> </tfoot> <tbody> {foreach from=$synchro.changes.new item=data key=key} {strip} <tr> <td class="data"> <p id="f{$data.fid}" style="position:absolute; overflow:auto; display:none; padding:5px; border:solid 1px black; margin-left:50px; background:white;"> <u>Description</u> :<br /> {$data.fdesc|nl2br} </p> <a > <img src="{$base}/html/classic/task.png" alt="description" /> </a> {$data.fname} </td> <td class="data" style="text-align:center;"><img src="{$base}/html/classic/newtask.png" alt="new" /></td> <td class="data">-</td> <td class="data"> </td> <td class="data" style="text-align:center;"> <input type="checkbox" name="new[{$key}]" {if !$data.authorized} disabled="disabled"{/if}> </td> </tr> {/strip} {/foreach} {foreach from=$synchro.changes.sync item=data key=key} {strip} <tr> <td class="data"> <p id="f{$data.fid}" style="position:absolute; overflow:auto; display:none; padding:5px; border:solid 1px black; margin-left:50px; background:white;"> <u>Description</u> :<br /> {$data.fdesc|nl2br} </p> <a > <img src="{$base}/html/classic/task.png" alt="description" /> </a> {$data.fname} </td> <td class="data" style="text-align:center;"><img src="{$base}/html/classic/sync.png" alt="synchronize" /></td> <td class="data"> <p id="p{$data.pid}" style="position:absolute; overflow:auto; display:none; padding:5px; border:solid 1px black; margin-left:50px; background:white;"> <u>Description</u> :<br /> {$data.pdesc|nl2br} </p> <a > <img src="{$base}/html/classic/task.png" alt="description" /> </a> {$data.pname} </td> <td class="data"> {if !$data.authorized}{$data.msg}{/if} {foreach from=$data.diff item=d} <img src="{$base}/html/classic/{$d.what}.png" alt="{$d.what}" title="{$d.title}" /> {/foreach} </td> <td class="data" style="text-align:center;"> <input type="checkbox" name="sync[{$key}]" {if !$data.authorized} disabled="disabled"{/if}> </td> </tr> {/strip} {/foreach} {foreach from=$synchro.changes.del item=data key=key} {strip} <tr> <td class="data">-</td> <td class="data" style="text-align:center;"><img src="{$base}/html/classic/remove.png" alt="delete" /></td> <td class="data"> <p id="p{$data.pid}" style="position:absolute; overflow:auto; display:none; padding:5px; border:solid 1px black; margin-left:50px; background:white;"> <u>Description</u> :<br /> {$data.pdesc|nl2br} </p> <a > <img src="{$base}/html/classic/task.png" alt="description" /> </a> {$data.pname} </td> <td class="data"> {if !$data.authorized}<img src="{$base}/html/classic/warning.png" alt="warning" />{$data.msg}{/if} </td> <td class="data" style="text-align:center;"> <input type="checkbox" name="del[{$key}]" {if !$data.authorized} disabled="disabled"{/if}> </td> </tr> {/strip} {/foreach} </tbody> </table> </form> <!-- projectio_synchro_new stop --> Index: projectio_new.tpl =================================================================== RCS file: /cvsroot/tutos/tutos/templates/classic/projectio/Attic/projectio_new.tpl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- projectio_new.tpl 10 Feb 2006 09:37:55 -0000 1.1.2.1 +++ projectio_new.tpl 22 Feb 2006 15:52:42 -0000 1.1.2.2 @@ -1,7 +1,7 @@ {* TUTOS MANTIS editing *} {* $Id$ *} <!-- projectio_new start --> -<form name="projectionew" method="post" enctype="multipart/form-data" action="{$action}" method="post"> +<form name="projectionew" enctype="multipart/form-data" action="{$action}" method="post"> <input type="hidden" name="pro_id" value="{$pro_id}" /> <input type="hidden" name="fct" value="{$fct}" /> <input type="hidden" name="MAX_FILE_SIZE" value="1048576" /> |
From: Emmanuel D. <ede...@us...> - 2006-02-22 15:52:49
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14708/php Modified Files: Tag: BRANCH-2-0 product_show.php Log Message: - add synchronize to the projectio module Index: product_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_show.php,v retrieving revision 1.90.2.25 retrieving revision 1.90.2.26 diff -u -r1.90.2.25 -r1.90.2.26 --- product_show.php 10 Feb 2006 09:37:55 -0000 1.90.2.25 +++ product_show.php 22 Feb 2006 15:52:42 -0000 1.90.2.26 @@ -458,7 +458,7 @@ 'info' => $lang['ProjectIOSynchroDesc'], 'category' => array("projectio", "new") ); -// $this->addMenu($x); + $this->addMenu($x); } } |
Update of /cvsroot/tutos/tutos/html/classic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14708/html/classic Added Files: Tag: BRANCH-2-0 edate.png newtask.png parent.png remove.png sdate.png sync.png warning.png work.png Log Message: - add synchronize to the projectio module --- NEW FILE: edate.png --- PNG ETª³ z}åV»¯¥¥åªÉdª\ÅbÃMrr² dññ¢´´ÒÒÒsuu?»ºòã'x·Æã'}N¡P(üµPL )))³¾¾ÉÓýh}3ù E¸iô>L¿"%%¥|G@Óí;#ã3X§ýXql`ÉjÓãÃjËl tCZ=¼#oÚ²æÆÛÊÖ<®£hlßÐ ÎhD°¹5¼fþñD(,,T¼ÿ² Í;/H¥Ò]Íí}ôǰÖóN®L ¾¨þ]áùgìH$Jù ¥ºob9@vÁ¹7áðn¾>+Ý©Ed21@TÒùjV/`ÍÑWËcÕÉb.^¾2KüEQ --- NEW FILE: newtask.png --- PNG ODþýÛ-® ÿu1ÌÿûAá/Я9Ùþqó3ØÜÌ"/Áþ¼cx>ã °~}ÅÀðñ'DàR<áß?Ô@(üzúÈ1#ïÿÑñMèP âfà 0= :L¼@5ìõ --- NEW FILE: parent.png --- PNG +-Øpaµí»¤Ámà>¥èGDEW|/Â÷ã{VÃÃcÝ(^ku VX,{>ýÖDhGrVY#}¸k4©0,ñBXþèwî»ÀSà cÀ$BíÉ @ÐOÙÒüîù©¢ZÂÀu{ïEÜuÐE_wÕOKÄù®HL,Ià´Ë³Å½Ý4M¤þå'E!½Í ºkQéµ¶ØëÄR¡B·®<&¥18IÖã8yN²¹<£Yó¶Ty øO³Öç¿ÑgÒT±YiÒÏ --- NEW FILE: remove.png --- PNG IDAT8mOLwÇ?ï۷о´o»2*¦i^P«BkRRãE\L ì`7o$ÉÍyp]311Äìäq l]\¢h!°fµF,ŵHmßZÞ¶¿ °}ßáyò<ßçy~ÏóĦ©>]³(J!zMEÉõz*Í?*Kã¥ãño0øàÔÕ«v_?v¿ ËO¥X¾ÝÙùêÎÂÂô¾¿pa&H$ 8Ò$ðÛô´X^YùñΠQ3ÚNÜ@kZ¥i8³YçXlL±(JL¶?g±Ùäü[x pöì¡È¿|ÉêÔ{óó´.E°$|¾o[[F.¼·Çt_$Ãí>ü&fy|ëü<ÕU,BðÁç³(ͦI>¤½Ù¤úþ=v^¿ÆL&i[[Ã% `dl¶²üiU==>|ÈH£è»r î{÷({½8§ÅBÃfËÊF½¾hu¹¨ûý=yBh` ô×ÜùL¦eÇ®_Ç79I]Qpª*×ë)¾ôxÔápùñà øhb>{&fC!ñC4*òëë-ÿÛ ñË¥Kbª§§õxTùQ±X2mnmÛ·©U«¤>å÷79±¾Nde äµkä_½bçÝ;þÄË5M].KSþ6 æpG8,Õð¿x ,³qñ"íýýHssâ'uÊÄt7é¬V¿;£(ÍëÅV«áPìííÈÛÛüº·WI:£ÿ'¦}$4M=¯ëc^«5æ2Í^PµZ39ÓLýÍ/ó?+¾[¥ó¾ --- NEW FILE: sdate.png --- PNG ETª³ z}åV»¯¥¥åªÉdª\ÅbÃMrr² dññ¢´´ÒÒÒsuu?»ºòã'x·Æã'}N¡P(üµPL )))³¾¾ÉÓýh}3ù E¸iô>L¿"%%¥|G@Óí;#ã3X§ýXql`ÉjÓãÃjËl tCZ=¼#oÚ²æÆÛÊÖ<®£hlßÐ ÎhD°¹5¼fþñD(,,T¼ÿ² Í;/H¥Ò]Íí}ôǰÖóN®L ¾¨þ]áùgìH$Jù ¥ºob9@vÁ¹7áðn¾>+Ý©Ed21@TÒùjV/`ÍÑWËcÕÉb.^¾2KüEQ --- NEW FILE: sync.png --- PNG ~Ñ_ ½ÙCP! EôR`¨¤fþjÑ/Ë6SÇæ6WºíÞ»¹ëݽ=²:p^ßóá¾çðh3AiD½\вOãóF$^ãÕ$§iÅâ-gÍ wyl ±ûxZbc¡³uEÚnKsIËkVRÈ --- NEW FILE: warning.png --- PNG uÔ>tE D¶PÌÅ(æ=ÆæÉ03sO0*_ÿæpøÿÿpø6Á»ÓìÍ4êFDÈÇU§ôë\´tëÁ^j+x¶'¹ò#æ ß&H³]|ÜÏwØ³ïÆ¶Ì3½ú<¨³±Ç29ùR²±GòiP[½wcëåñ_ºÁ]«ÿ¢>3ï`zz7S%<ý´7C@ù¦B>üu=5GmFb±He¥àhÐ|¼ºãi=kÍÔYLÃÉp½¿4 ÆFB¡Û h6õþ>Z¸uÊKݺV§Qqvq,«@>¡¥å'Eq¤é|mÃõÜ 6ª¨Qü-¸Ü&ûí?ÉnK|ËòUÙê+·ý9¡Î¡pÆç --- NEW FILE: work.png --- PNG *B,L` üJ)jÞÔ\0m9Ã_M;ýO¾2ÜÿøAÎQ;ö A K±ðáÛÿÑÁé?ÿ®m¹ |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:09
|
Update of /cvsroot/tutos/tutos/php/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/php/projectio Added Files: Tag: BRANCH-2-0 fr.p3 mconfig.pinc projectio_ins.php projectio_new.php projectio.pinc project_readers.pinc Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. --- NEW FILE: fr.p3 --- <?php # $Id: fr.p3,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ # # ========================= NOTE ======================== # Please put site specific extensions and changes # to TUTOS language files in a file called "fr_custom.p3" # or "lang_custom.p3" (for all languages) # using the same format like here # ======================================================= error_log("Lecture projectio/fr.p3"); # Filehandling $lang['ProjectIO'] = "Import/Export Projet"; $lang['ProjectIOCreate'] = "Importer ou Exporter un Projet"; $lang['ProjectIOImport'] = "Importer un Projet"; $lang['ProjectIOImportDesc'] = "Importer un fichier Projet dans le projet en cours"; $lang['ProjectIOExport'] = "Exporter le Projet"; $lang['ProjectIOExportDesc'] = "Exporter le projet courant vers un fichier Projet"; $lang['ProjectIOSynchro'] = "Synchroniser le Projet"; $lang['ProjectIOSynchroDesc'] = "Synchroniser le projet courant avec un fichier Projet"; $lang['ProjectIOfct'][1] = &$lang['ProjectIOImport']; $lang['ProjectIOfct'][2] = &$lang['ProjectIOExport']; $lang['ProjectIOfct'][3] = &$lang['ProjectIOSynchro']; $lang['ProjectIOFType'][1] = "Microsoft Project XML"; $lang['ProjectIOFType'][2] = "Imendio Planner"; $lang['ProjectIOFileType'] = "Type de fichier"; $lang['ProjectIOSelectType'] = "Sélectionnez le type de fichier"; $lang['ProjectIOFile'] = "Fichier"; $lang['ProjectIOErr0001'] = "Erreur de sélection d'action"; $lang['ProjectIOErr0002'] = "Vous n'avez pas les droits suffisants pour cette action"; $lang['ProjectIOErr0003'] = "Type de fichier non reconnu"; $lang['ProjectIOErr0004'] = "Problème de lecture du fichier"; $lang['perm'][useprojectio] = "Import/Export Projet"; $lang['projectio'] = &$lang['ProjectIO']; $lang['menu']['projectio'] = &$lang['ProjectIO']; ### Local Variables: *** ### mode:iso-accents *** ### End: *** ?> --- NEW FILE: mconfig.pinc --- <?php /* * Module specific configuration * * CVS Info: $Id: mconfig.pinc,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ * $Author: edeweerdt $ */ # # Every module must have an individual ID ( < 0 > -100 ). # this is module 40 define ('useprojectio',-41); $tutos[modules]['projectio'] = array( name => "projectio", Desc => "Project import export", file => "php/projectio/projectio.pinc", 'overview' => "projectio/projectio_overview.php", 'perm' => useprojectio, 'defaultrole' => 5 /* ROLE MANAGER2 */ ); # # globally enable this module # if (!isset($tutos[useprojectio])) $tutos[useprojectio] = 1; # # List of objects/modules where we do something with this module # and need to include this module # $tutos[modulesinc]['projectio'][] = "product"; ?> --- NEW FILE: projectio_ins.php --- <?php /** * @modulegroup projectio * @module projectio_ins * @package projectio */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; include_once 'product.pinc'; include_once 'task.pinc'; include_once 'address.pinc'; /* Check if user is allowed to use it */ check_user(); loadmodules('projectio','ins'); loadmodule('projectio'); error_log ("PROJECTIO_INS Start"); $pio = new projectio($dbconn); /* Check Input */ $gotourl = ''; $msg = ''; $fct; $ftype; $file; if ( empty($_REQUEST['gotourl']) ) { $gotourl = "projectio/projectio_new.php"; } else { $gotourl = $_REQUEST['gotourl']; } /* Verify FCT */ if ( isset($_REQUEST['fct']) ) { if ($_REQUEST['fct'] == PROJECTIO_FCT_IMPORT || $_REQUEST['fct'] == PROJECTIO_FCT_EXPORT || $_REQUEST['fct'] == PROJECTIO_FCT_SYNCHRO) { error_log("FCT=".$_REQUEST['fct']); $fct = $_REQUEST['fct']; $gotourl = addUrlParameter($gotourl, "fct=".$fct, true); } } if ( !$fct ) { $msg .= $lang['ProjectIOErr0001'] . "<br/>"; } /* Verify PRO_ID */ if ( isset($_REQUEST['pro_id']) ) { $p = getObject($dbconn, $_REQUEST['pro_id']); if ($p != -1 && $p->getType() == 'product') { $pio->project = $p; $gotourl = addUrlParameter($gotourl, "pro_id=". $pio->project->id, true); } } if ( !$pio->project ){ $msg .= $lang['Err0048'] . "<br />"; } /* Verify FTYPE */ if ( isset($_REQUEST['ftype']) ) { $ft = $_REQUEST['ftype']; if ($ft == PROJECTIO_FTYPE_MPPXML || $ft == PROJECTIO_FTYPE_PLANNER) { $ftype = $ft; $gotourl = addUrlParameter($gotourl, "ftype=". $ft, true); } } if ( !$ftype ) { $msg .= $lang['ProjectIOErr0003'] . "<br />"; } /* Verify Uploaded FILE */ if ( isset($_FILES['projectfile']) ) { $fi = $_FILES['projectfile']; $fname = basename($fi['name']); $localfile = $fi['tmp_name']; $type = $fi['type']; if (is_uploaded_file($fi['tmp_name']) ) { error_log("FILE $fname TO $localfile TYPE $type"); $file = $fi; } } if ( !$file ) { $msg .= $lang['ProjectIOErr0004'] . "<br />"; } # other modules $msg .= module_parseforms($current_user,$m,$gotourl); if ( $msg == "" ) { error_log(">>>>>>>>>>>>>GLOOOOOOOOPS"); $dbconn->Begin("WORK"); $import_result = $pio->importFile($file, $ftype, &$msg); $dbconn->Commit("WORK"); if ($import_result) { $gotourl = "task_overview.php?id=" . $pio->project->id; } } $gotourl = addMessage($gotourl,$msg,true); $gotourl = addSessionKey($gotourl,true); Header("Status: 302 Moved Temporarily"); Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); $dbconn->Close(); error_log ("PROJECTIO_INS Stop"); /* * CVS Info: $Id: projectio_ins.php,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ * $Author: edeweerdt $ */ ?> --- NEW FILE: projectio_new.php --- <?php /** * Import, export or synchronize tasks project with Planner or MS-Project file * * @modulegroup projectio * @module projectio_new * @package projectio */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; include_once 'product.pinc'; require_once 'layout/layout.pinc'; /* Check if user is allowed to use it */ check_user(); loadmodules('projectio','new'); loadmodule('projectio'); /** * import/export access for project */ class projectio_new extends layout { var $fct; var $obj; var $ref; var $name; var $ftype_sel; /** * display the form */ Function info() { global $tutos,$lang,$table; error_log ("PROJECTIO_NEW::INFO start"); $this->assign('action', "projectio_ins.php"); $this->assign('name', myentities($this->name)); $this->assign('pro_id', $this->ref->id); $this->assign('fct', $this->fct); $this->assign('fcticon', $tutos['projectio_fct_icon'][$this->fct]); $this->assign('ref', array('label' => $lang[$this->ref->getType()], 'name' => $this->ref->getFullName(), 'title' => $this->ref->getFullName(), 'link' => $this->ref->getUrl())); $this->assign('ftype', array('label' => $lang['ProjectIOFileType'], 'firstopt' => '', //$lang['ProjectIOSelectType'], 'options' => $lang['ProjectIOFType'], 'selected' => $this->ftype_sel)); $this->assign('file', array('label' => $lang['ProjectIOFile'], 'value' => '')); $this->assign('InputOk', $lang['InputOk']); $this->assign('ChangesOk', $lang['ChangesOk']); $this->assign('Enter', $lang['Enter']); $this->assign('Reset', $lang['Reset']); $this->assign('FldsRequired', $lang['FldsRequired']); $this->template('projectio/projectio_new'); } /** * navigate */ Function navigate() { global $lang; error_log ("PROJECTIO_NEW::NAVIGATE start"); } /** * prepare */ Function prepare() { global $msg,$lang,$tutos; error_log ("PROJECTIO_NEW::PREPARE start"); $this->obj = new projectio($this->dbconn); if ( isset($_REQUEST['fct']) ) { $this->fct = $_REQUEST['fct']; if ($this->fct != PROJECTIO_FCT_IMPORT && $this->fct != PROJECTIO_FCT_EXPORT && $this->fct != PROJECTIO_FCT_SYNCHRO) { $msg .= $lang['ProjectIOErr0001']; $this->stop = true; return; } } $this->name = $lang['ProjectIOfct'][$this->fct]; if ( isset($_REQUEST['pro_id']) ){ $this->ref = getObject($this->dbconn,$_REQUEST['pro_id']); if ( $this->fct == PROJECTIO_FCT_IMPORT && !$this->ref->see_ok() ) { $msg .= $lang['ProjectIOErr0002']; $this->stop = true; return; } if ( !$this->ref->del_ok() ) { $msg .= $lang['ProjectIOErr0002']; $this->stop = true; return; } } if (!isset ($this->ref)) { $msg .= $lang['Err0048']; $this->stop = true; return; } if ( isset ($_REQUEST['ftype']) ) { $this->ftype_sel = $_REQUEST['ftype']; } add_module_newlinks($this,$this->obj); } } $l = new projectio_new($current_user); $l->display(); $dbconn->Close(); ?> --- NEW FILE: projectio.pinc --- <?php # $Id: projectio.pinc,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ /** * @modulegroup projectio * @module projectio * @package projectio */ include_once('project_readers.pinc'); define ('PROJECTIO_FCT_IMPORT',1); define ('PROJECTIO_FCT_EXPORT',2); define ('PROJECTIO_FCT_SYNCHRO',3); define ('PROJECTIO_FTYPE_MPPXML',1); define ('PROJECTIO_FTYPE_PLANNER',2); $tutos['projectio_fct_icon'] = array(PROJECTIO_FCT_IMPORT => 'projectimport', PROJECTIO_FCT_EXPORT => 'projectexport', PROJECTIO_FCT_SYNCHRO => 'projectsynchro'); $tutos['projectio_ftype'] = array(PROJECTIO_FTYPE_MPPXML, PROJECTIO_FTYPE_PLANNER); /** * Basic class for import export Project */ class projectio extends tutos_module { /** * project */ var $project; /** * Constructor class * @param dbconn point to database connector */ function projectio(&$dbconn) { global $tutos,$current_user,$table; $this->init($dbconn); } /** * create a link where a note to for the given object could be added */ function getaddlink (&$user,&$obj,$text = "") { global $lang; return ""; error_log("PROJECTIO::GETADDLINK"); if ( $obj == -1 ) return ""; if (! is_object($obj) ) return ""; if ( $obj->id == -1 ) return ""; if (! $user->feature_ok(useprojectio,PERM_NEW) ) return ""; if (! $obj->use_ok() ) return ""; error_log("PROJECTIO::GETADDLINK OK"); $x = array('url' => "projectio/projectio_new.php?pro_id=". $obj->id, 'text' => ($text == "" ? $lang['ProjectIOCreate'] : $text), 'image' => 'projectio', 'info' => $lang['ProjectIOCreate'], 'confirm' => false, 'category' => array("projectio","new","module") ); return $x; } /** * get the type of object */ function gettype () { return "projectio"; } /** * get the type id of object */ function gettypeid () { return useprojectio; } /** * Import project from file */ function importFile($file, $ftype, $msg) { global $tutos; if (!$this->project || $this->project->getType() != 'product') { $msg .= $lang['Err0048'] . "<br />"; return; } $reader; if ($ftype == PROJECTIO_FTYPE_PLANNER) $reader = new plannerReader($file['tmp_name']); else if ($ftype == PROJECTIO_FTYPE_MPPXML) $reader = new msprojectReader($file['tmp_name']); if (!$reader) { error_log("Parsing error for file ". $file['name']); $msg .= $lang['ProjectIOErr0004'] . "<br />"; return false; } if (!$reader->read()) { error_log("Reading error for file ". $file['name']); $msg .= $lang['ProjectIOErr0004'] . "<br />"; return false; } $data = $reader->getResult(); unset($reader); /* read project roles */ $this->project->readroles(); $hasrole = array('current' => array(), 'new' => array()); if (isset($this->project->role)) { foreach ($this->project->role as $role => $roleuser) { foreach ($roleuser as $ru) { $hasrole['current'][$ru->id] = $ru; } } } /* create tasks from file */ foreach ($data['subtasks'] as $stask) { $this->createSubTasks($stask, $this->project->id, $hasrole); } /* add new roles for project */ foreach ($hasrole['new'] as $newuser) { $this->project->setRole($newuser, $tutos[modules]['projectio']['defaultrole'], ''); } $this->project->save(); return true; } function searchUser($name) { $result = array(); $name = StripSlashes($name); $q = "SELECT * FROM ". $this->dbconn->prefix ."addresses"; $pre = "WHERE"; $q .= " ". $pre ."(". $this->dbconn->Like("l_name",$name,"f_name") .")"; $pre = " OR "; $q .= " ". $pre ."(". $this->dbconn->Like("f_name",$name,"l_name") .")"; $dbres = $this->dbconn->Exec($q); if ($dbres->numrows() >= 1) { for ($i = 0; $i < $dbres->numrows(); $i++) { $a = new tutos_address($this->dbconn); $a->read_result($dbres,$i); $dbres->free(); error_log("Found USER id ". $a->id); $result[] = $a; } } return $result; } function createSubTasks($taskData, $parentId, &$hasrole) { global $current_user; $t = null; /* create the task */ if ( isset($taskData['id']) ) { error_log("Create Task \"".$taskData['name']."\" id=".$taskData['id']); $t = new task($this->dbconn); $t->p_id = $parentId; $t->setName(trim(StripSlashes($taskData['name']))); $t->setDescription(trim(StripSlashes($taskData['note']))); $t->logical = (count($taskData['subtasks'])>0) ? 1 : 0; $t->milestone = ($taskData['milestone']) ? 1 : 0; $s_start = new DateTime(0); $s_start->setDateTimeTS($taskData['start']); $s_end = new DateTime(0); $s_end->setDateTimeTS($taskData['end']); $t->worker = array(); if (!count($taskData['resources'])) { $t->worker[$current_user->id] = $current_user; } else { // search for user by name foreach ($taskData['resources'] as $resource) { $newusers = $this->searchUser($resource['name']); foreach ($newusers as $newuser) { $t->worker[$newuser->id] = $newuser; if ( !isset($hasrole['current'][$newuser->id]) ) { $hasrole['new'][$newuser->id] = $newuser; } } } } $t->setState(TASK_PRE); $t->setVolume($taskData['work']); $t->setVolumeTodo($taskData['work']); $t->setVolumeDone(0); if ($t->milestone) $s_end = $s_start; $t->setSStart($s_start); $t->setSEnd($s_end); $t->parent = getObject($this->dbconn,$t->p_id); $msg .= $t->save(); } /* scan the subtasks */ foreach ($taskData['subtasks'] as $stask) { if (!$this->createSubTasks($stask, $t->id)) return false; } return true; } } ?> --- NEW FILE: project_readers.pinc --- <?php /** * Class plannerReader for parsing Project Planner XML file */ class plannerReader { /** * DomElement instance root from document */ var $DomProject; /** * Common result of parsing tasks */ var $Result; /** * constructor * @param file planner file to read */ function plannerReader($file){ $DomXml = domxml_open_file($file, DOMXML_LOAD_PARSING | DOMXML_LOAD_DONT_KEEP_BLANKS); if (!$DomXml) { error_log("Not a XML Planner file"); $this = null; return; } $this->DomProject = $DomXml->document_element(); if (!$this->verify($this->DomProject)) { error_log("Not a Planner file project"); $this = null; return; } } /** * verify if this is really a Planner Project file */ function verify($DomRoot) { $ret = true; if ($ret && $DomRoot->tagname != "project") $ret = false; if ($ret && !$DomRoot->has_attribute("mrproject-version")) $ret = false; return $ret; } /** * read the planner * @return true if ok or false */ function read() { // resources reading $DomResources = $this->DomProject->get_elements_by_tagname("resources"); $Resources = array(); if (isset($DomResources) && count($DomResources)) $Resources = $this->readResources($DomResources[0]); // allocations reading (resources must be reading before) $DomAllocations = $this->DomProject->get_elements_by_tagname("allocations"); $Allocations = array(); if (isset($DomAllocations) && count($DomAllocations)) $Allocations = $this->readAllocations($DomAllocations[0], $Resources); // tasks reading (resources and allocations must be reading at first) $DomTasks = $this->DomProject->get_elements_by_tagname("tasks"); if (isset($DomTasks) && count($DomTasks)) $this->Result = $this->readSubTasks($DomTasks[0], $Allocations); else return false; return true; } /** * Is reading a DOM Element named "resource" * @param DomResource DomElement named "resource" * @return array with resource informations */ function readResource($DomResource) { $Resource = array(); if ($DomResource->node_name() == "resource") { $Resource["id"] = $DomResource->get_attribute("id"); $Resource["name"] = utf8_decode($DomResource->get_attribute("name")); $Resource["email"] = utf8_decode($DomResource->get_attribute("email")); } return $Resource; } /** * Is reading all resources * @param DomElt DomElement named "resources" * @return array with all resource available */ function readResources($DomElt) { $ret = array(); $nodes = $DomElt->get_elements_by_tagname("resource"); foreach ($nodes as $node) { $res = $this->readResource($node); $ret[$res["id"]] = $res; } return $ret; } /** * Is reading a DOM Element named "allocation" * @param DomResource DomElement named "allocation" * @param Resources array of resources available * @return array with allocated resource for a task */ function readAllocation($DomAllocation, $Resources) { $Allocation = array(); if ($DomAllocation->node_name() == "allocation") { $Allocation["task-id"] = $DomAllocation->get_attribute("task-id"); $Allocation["resource"] = $Resources[$DomAllocation->get_attribute("resource-id")]; } return $Allocation; } /** * Is reading resources allocations * @param DomElt DomElement named "allocations" * @param Resources array of resources available * @return array with all allocation including resources */ function readAllocations($DomElt, $Resources) { $ret = array(); $nodes = $DomElt->get_elements_by_tagname("allocation"); foreach ($nodes as $node) { $Alloc = $this->readAllocation($node, $Resources); $tid = $Alloc["task-id"]; $res = $Alloc["resource"]; if ( !isset($ret[$tid]) ) $ret[$tid] = array(); $ret[$tid][] = $res; } return $ret; } /** * Convert planner date * @param Date in planner formated (AAAAMMJJTHHMMSS) * @return unix timestamp */ function plannerDate ($Date) { $res = mktime (substr($Date,9,2), substr($Date,11,2), substr($Date,13,2), substr($Date,4,2), substr($Date,6,2), substr($Date,0,4)); return $res; } /** * Convert work in hour * @param Time in second * @return time in hour */ function plannerWork ($Time) { // second to hour return ($Time/3600); } /** * Is reading a DOM Element named "task" * @param DomTask DomElement named "task" * @param Allocations array of allocations tasks * @return array with task informations */ function readTask($DomTask, $Allocations) { $Task = array(); if ($DomTask->node_name() == "task") { $Task["id"] = $DomTask->get_attribute("id"); $Task["name"] = utf8_decode($DomTask->get_attribute("name")); $Task["start"] = $this->plannerDate($DomTask->get_attribute("work-start")); $Task["end"] = $this->plannerDate($DomTask->get_attribute("end")); $Task["milestone"] = ($DomTask->get_attribute("type") == "milestone") ? true : false; $Task["work"] = $this->plannerWork($DomTask->get_attribute("work")); $Task["note"] = utf8_decode($DomTask->get_attribute("note")); if ( isset($Allocations[$Task["id"]]) ) $Task["resources"] = $Allocations[$Task["id"]]; else $Task["resources"] = array(); } return $Task; } /** * Recursive function reading tasks tree * @param DomElt DomElement named "tasks" or "task" * @param Allocations array of allocations tasks * @return tree of task in array */ function readSubTasks($DomElt, $Allocations) { $ret = $this->readTask($DomElt, $Allocations); $ret["subtasks"] = array(); $nodes = $DomElt->child_nodes(); foreach ($nodes as $node) { if ($node->node_type() == XML_ELEMENT_NODE && $node->node_name() == "task") { $ret["subtasks"][] = $this->readSubTasks($node, $Allocations); } } return $ret; } /** * Get the file transformed * @return data of file */ function getResult() { return $this->Result; } } /* ------------------------------------------------------------------------- */ /** * Class msprojectReader for parsing MS-Project XML export file */ class msprojectReader { /** * DomElement instance root from document */ var $DomProject; /** * Common result of parsing tasks */ var $Result; /** * constructor * @param file planner file to read */ function msprojectReader($file){ $DomXml = domxml_open_file($file, DOMXML_LOAD_PARSING | DOMXML_LOAD_DONT_KEEP_BLANKS); if (!$DomXml) { error_log("Not a XML MS-Project file"); $this = null; return; } print_r($DomXml->doctype); $this->DomProject = $DomXml->document_element(); if (!$this->verify($this->DomProject)) { error_log("Not a MS-Project XML file project"); $this = null; return; } } /** * verify if this is really a Planner Project file */ function verify($DomRoot) { $ret = true; if ($ret && $DomRoot->tagname != "Project") $ret = false; return $ret; } /** * read the project * @return true if ok or false */ function read() { // resources reading $DomResources = $this->DomProject->get_elements_by_tagname("Resources"); $Resources = array(); if (isset($DomResources) && count($DomResources)) $Resources = $this->readResources($DomResources[0]); // allocations reading (resources must be reading before) $DomAllocations = $this->DomProject->get_elements_by_tagname("Assignments"); $Allocations = array(); if (isset($DomAllocations) && count($DomAllocations)) $Allocations = $this->readAllocations($DomAllocations[0], $Resources); // tasks reading (resources and allocations must be reading at first) $DomTasks = $this->DomProject->get_elements_by_tagname("Tasks"); if (isset($DomTasks) && count($DomTasks)) $this->Result = $this->readTasks($DomTasks[0], $Allocations); else return false; return true; } /** * Find DOM element value in a DOM element * @param DomElt DOM element base * @param TagName name to find * @return content data of tag named TagName */ function getTagData($DomElt, $TagName) { $val; $nodes = $DomElt->child_nodes(); foreach ($nodes as $node) { if ($node->node_type() != XML_ELEMENT_NODE) continue; if ($node->node_name() != $TagName) continue; $val .= $node->get_content(); } return $val; } /** * Is reading a DOM Element named "Resource" * @param DomResource DomElement named "Resource" * @return array with resource informations */ function readResource($DomResource) { $Resource = array(); if ($DomResource->node_name() == "Resource") { $Resource["id"] = $this->getTagData($DomResource, "UID"); $Resource["name"] = utf8_decode($this->getTagData($DomResource, "Name")); $Resource["email"] = utf8_decode($this->getTagData($DomResource, "EmailAddress")); } return $Resource; } /** * Is reading all resources * @param DomElt DomElement named "Resources" * @return array with all resource available */ function readResources($DomElt) { $ret = array(); $nodes = $DomElt->get_elements_by_tagname("Resource"); foreach ($nodes as $node) { $res = $this->readResource($node); $ret[$res["id"]] = $res; } return $ret; } /** * Is reading a DOM Element named "Assignment" * @param DomResource DomElement named "Assignment" * @param Resources array of resources available * @return array with allocated resource for a task */ function readAllocation($DomAllocation, $Resources) { $Allocation = array(); if ($DomAllocation->node_name() == "Assignment") { $taskid = $this->getTagData($DomAllocation, "TaskUID"); $Allocation["task-id"] = $taskid; $Allocation["resource"] = $Resources[$this->getTagData($DomAllocation, "ResourceUID")]; } return $Allocation; } /** * Is reading resources allocations * @param DomElt DomElement named "Assignments" * @param Resources array of resources available * @return array with all allocation including resources */ function readAllocations($DomElt, $Resources) { $ret = array(); $nodes = $DomElt->get_elements_by_tagname("Assignment"); foreach ($nodes as $node) { $Alloc = $this->readAllocation($node, $Resources); $tid = $Alloc["task-id"]; $res = $Alloc["resource"]; if ( !isset($ret[$tid]) ) $ret[$tid] = array(); $ret[$tid][] = $res; } return $ret; } /** * Convert msproject date * @param Date in msproject formated (AAAA-MM-JJTHH:MM:SS) * @return unix timestamp */ function msprojectDate ($Date) { $res = mktime (substr($Date,11,2), substr($Date,14,2), substr($Date,17,2), substr($Date,5,2), substr($Date,8,2), substr($Date,0,4)); return $res; } /** * Convert work in hour * @param Time in msproject format (PTxHxMxS) * @return time in hour */ function msprojectWork ($Time) { list($h,$m,$s) = sscanf ($Time, "PT%dH%dM%dS"); $ret = $h + ($m / 60) + ($s / 3600); return $ret; } /** * Find parent outline numbre * @param OutlineNumber the outline number of task * @return the ouline number of the parent */ function getOutlineParent($OutlineNumber){ $parent = 0; $ids = split("\.", $OutlineNumber); array_pop($ids); if (count($ids) > 0) $parent = implode(".", $ids); return $parent; } /** * Is reading a DOM Element named "task" * @param DomTask DomElement named "task" * @param Allocations array of allocations tasks * @return array with task informations */ function readTask($DomTask, $Allocations) { $Task = array(); if ($DomTask->node_name() == "Task") { $Task["OutlineLevel"] = $this->getTagData($DomTask, "OutlineLevel"); $Task["OutlineNumber"] = $this->getTagData($DomTask, "OutlineNumber"); $Task["OutlineParent"] = $this->getOutlineParent($Task["OutlineNumber"]); $Task["id"] = $this->getTagData($DomTask, "UID"); $Task["name"] = utf8_decode($this->getTagData($DomTask, "Name")); $Task["start"] = $this->msprojectDate ($this->getTagData($DomTask, "Start")); $Task["end"] = $this->msprojectDate ($this->getTagData($DomTask, "Finish")); $Task["milestone"] = $this->getTagData($DomTask, "Milestone"); $Task["work"] = $this->msprojectWork ($this->getTagData($DomTask, "Work")); $Task["note"] = utf8_decode($this->getTagData($DomTask, "Notes")); if ( isset($Allocations[$Task["id"]]) ) $Task["resources"] = $Allocations[$Task["id"]]; else $Task["resources"] = array(); } return $Task; } /** * Recursive function reading tasks tree * @param DomElt DomElement named "Tasks" * @param Allocations array of allocations tasks * @return tree of task in array */ function readTasks($DomElt, $Allocations) { $ret = array(); $byLevel = array(); // read all task and search for parent $nodes = $DomElt->child_nodes(); foreach ($nodes as $node) { if ($node->node_type() == XML_ELEMENT_NODE && $node->node_name() == "Task") { $task = $this->readTask($node, $Allocations); $level = $task["OutlineLevel"]; if ( !isset($byLevel[$level]) ) $byLevel[$level] = array(); $byLevel[$level][] = $task; } } // make tasks tree $ret = $this->scanSubTasks($byLevel, null); unset($byLevel); return $ret; } function scanSubTasks($byLevel, $task) { $ret = array(); $curLevel = 0; if ($task != null) { $ret = $task; $curLevel = $task["OutlineLevel"]; } $ret["subtasks"] = array(); $subLevel = $curLevel + 1; if ( isset($byLevel[$subLevel]) ) { foreach ($byLevel[$subLevel] as $subTask) { if ($subTask["OutlineParent"] == $task["OutlineNumber"]) { $ret["subtasks"][] = $this->scanSubTasks($byLevel, $subTask); } } } unset($ret["OutlineNumber"]); unset($ret["OutlineParent"]); unset($ret["OutlineLevel"]); return $ret; } /** * Get the file transformed * @return data of file */ function getResult() { return $this->Result; } } ?> |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:07
|
Update of /cvsroot/tutos/tutos/html/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/html/help Added Files: Tag: BRANCH-2-0 projectio_new.html Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. --- NEW FILE: projectio_new.html --- <!--$Id: projectio_new.html,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ --> <div class="help"> <h1><?php echo $lang['ProjectIO'] ?></h1> <p>Cet écran vous permet d'importer, d'exporter ou de synchroniser les tâches de votre produit/project avec un fichier.<br /> Cette page est accessible depuis l'aperçu projet dans le menu "Modules". </p> <p> - Les formats reconnus sont: <dl> <dt>Microsoft Project XML (<a href="http://office.microsoft.com/project/" target="_new">lien</a>)</dt> <dd>Ce type de fichier s'obtient depuis MS-Project en enregistrant le projet au format XML.</dd> <br /> <dt>Imendio Planner (<a href="http://developer.imendio.com/wiki/Planner" target="_new">lien</a>)</dt> <dd>Il s'agit du format natif des projets produit par Planner</dd> </dl> </p> <p> - Les trois fonctions disponibles sont: <dl> <dt><a name="import">Fonction d'import</a></dt> <dd> <p>Cette fonction permet d'importer toutes les tâches du fichier projet dans le projet en cours de sélection.<br/> Si le projet Tutos contient déjà des tâches, les nouvelles seront ajoutées. </p> <p>Sont prises en compte les tâches standards, les taches récapitulatives ainsi que les jalons.</p> <p>Les données prises en compte pour chaque tâche sont le nom, le descriptif (ou note), les dates de début et de fin et le temps aloué en heures.<br /> Celui-ci dépendra de la configuration du calendrier fait pour le fichier projet.<br /> Les ressources sont également affectées si le fichier les renseigne. C'est le nom qui est utilisé pour retrouver un équivalent dans Tutos. </p> </dd> <dt><a name="export">Fonction d'export</a></dt> <dd> <p>A faire</p> </dd> <dt><a name="synchro">Fonction de synchronisation</a></dt> <dd> <p>A faire</p> </dd> </p> </div> |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:06
|
Update of /cvsroot/tutos/tutos/php/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/php/layout Modified Files: Tag: BRANCH-2-0 layout.pinc Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. Index: layout.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/layout/Attic/layout.pinc,v retrieving revision 1.1.2.31 retrieving revision 1.1.2.32 diff -u -r1.1.2.31 -r1.1.2.32 --- layout.pinc 18 Jan 2006 13:52:53 -0000 1.1.2.31 +++ layout.pinc 10 Feb 2006 09:37:55 -0000 1.1.2.32 @@ -147,6 +147,10 @@ array('label' => $lang['menu']['mantis'], 'icon' => 'mantis'), + 'projectio' => + array('label' => $lang['menu']['projectio'], + 'icon' => 'projectio'), + 'app' => array('label' => $lang['menu']['app'], 'icon' => 'appointments')); |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:06
|
Update of /cvsroot/tutos/tutos/templates/classic/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/templates/classic/projectio Added Files: Tag: BRANCH-2-0 projectio_new.tpl Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. --- NEW FILE: projectio_new.tpl --- {* TUTOS MANTIS editing *} {* $Id: projectio_new.tpl,v 1.1.2.1 2006/02/10 09:37:55 edeweerdt Exp $ *} <!-- projectio_new start --> <form name="projectionew" method="post" enctype="multipart/form-data" action="{$action}" method="post"> <input type="hidden" name="pro_id" value="{$pro_id}" /> <input type="hidden" name="fct" value="{$fct}" /> <input type="hidden" name="MAX_FILE_SIZE" value="1048576" /> <table class="summary" > <thead> <tr><th colspan="2">{$name}</th></tr> </thead> <tbody> <tr> <td class="desc">{$ref.label}</td> <td class="data"><a href="{$base}/php/{$ref.link}" title="{$ref.title}">{$ref.name}</a></td> </tr> <tr> <td class="desc">{$ftype.label}</td> <td class="data"> <select name="ftype"> {if $ftype.firstopt}<option value="">-- {$ftype.firstopt} --</option>{/if} {foreach from=$ftype.options item=ftval key=ftid} {strip} <option value="{$ftid}" {if $ftype.selected == $ftid} selected="selected"{/if}>{$ftval}</option> {/strip} {/foreach} </select> </td> </tr> <tr> <td class="desc"><img src="{$base}/html/classic/{$fcticon}.png" alt="{$fct}}" />{$file.label}</td> <td class="data"> <input type="file" name="projectfile" value="{$file.value}" size="30" /> </td> </tr> </tbody> </table> <table class="summary"> <thead> <tr><th colspan="4">{$FldsRequired}</th></tr> </thead> <tbody> <tr> <td class="desc"><label for="OK">{$InputOk}</label></td> <td><input id="OK" name="OK" type="submit" value="{$Enter}" title="{$Enter}" /></td> <td class="desc" align="right"><label for="RESET">{$Reset}</label></td> <td><input id="RESET" name="RESET" type="reset" value="{$Reset}" title="{$Reset}" /></td> </tr> </tbody> </table> </form> <!-- projectio_new stop --> |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:05
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/php Modified Files: Tag: BRANCH-2-0 db.p3 modules.pinc product_show.php Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. Index: db.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/db.p3,v retrieving revision 1.138.2.5 retrieving revision 1.138.2.6 diff -u -r1.138.2.5 -r1.138.2.6 --- db.p3 18 Jan 2006 13:52:52 -0000 1.138.2.5 +++ db.p3 10 Feb 2006 09:37:55 -0000 1.138.2.6 @@ -177,6 +177,7 @@ define ('usesync',-34); define ('useacl',-35); # ID 40 is mantis module +# ID 41 is projectio module # ID 50 is riskmanagement module (non GPL by Gero Kohnert www.tutos.de) # ID 51 is requirements module (non GPL by Gero Kohnert www.tutos.de) Index: modules.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/modules.pinc,v retrieving revision 1.33.2.1 retrieving revision 1.33.2.2 diff -u -r1.33.2.1 -r1.33.2.2 --- modules.pinc 18 Jan 2006 13:52:53 -0000 1.33.2.1 +++ modules.pinc 10 Feb 2006 09:37:55 -0000 1.33.2.2 @@ -117,5 +117,11 @@ # @include("mantis/mconfig.pinc"); # +# The Project import-export support +# allows you to import and export project from Planner or MS-Project +# Modul by Emmanuel Deweerdt - CVF +# +@include("projectio/mconfig.pinc"); +# # ?> \ No newline at end of file Index: product_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_show.php,v retrieving revision 1.90.2.24 retrieving revision 1.90.2.25 diff -u -r1.90.2.24 -r1.90.2.25 --- product_show.php 18 Jan 2006 13:52:53 -0000 1.90.2.24 +++ product_show.php 10 Feb 2006 09:37:55 -0000 1.90.2.25 @@ -323,6 +323,7 @@ $this->menuprint("url"); $this->menuprint("file"); $this->menuprint("mantis"); + $this->menuprint("projectio"); // $this->debug($this->menu); } @@ -433,6 +434,34 @@ $this->addMenu($x); } + if( $this->obj->id > 0 && $this->user->feature_ok(useprojectio, PERM_NEW) ) { + if ($this->obj->see_ok()) { + $x = array('url' => "projectio/projectio_new.php?pro_id=".$this->obj->id."&fct=2", + 'text' => $lang['ProjectIOExport'], + 'image' => 'projectexport', + 'info' => $lang['ProjectIOExportDesc'], + 'category' => array("projectio", "new") + ); +// $this->addMenu($x); + } + if ($this->obj->mod_ok()) { + $x = array('url' => "projectio/projectio_new.php?pro_id=".$this->obj->id."&fct=1", + 'text' => $lang['ProjectIOImport'], + 'image' => 'projectimport', + 'info' => $lang['ProjectIOImportDesc'], + 'category' => array("projectio", "new") + ); + $this->addMenu($x); + $x = array('url' => "projectio/projectio_new.php?pro_id=".$this->obj->id."&fct=3", + 'text' => $lang['ProjectIOSynchro'], + 'image' => 'projectsynchro', + 'info' => $lang['ProjectIOSynchroDesc'], + 'category' => array("projectio", "new") + ); +// $this->addMenu($x); + } + } + if ( ($this->obj->id > 0) && $this->user->feature_ok(usecalendar,PERM_SEE) ) { $x = array( 'url' => "calendar.php?team=". $this->obj->id, |
From: Emmanuel D. <ede...@us...> - 2006-02-10 09:38:03
|
Update of /cvsroot/tutos/tutos/html/classic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4318/html/classic Added Files: Tag: BRANCH-2-0 projectexport.png projectimport.png projectio.png projectsynchro.png Log Message: - New module "projectio": this module makes it possible to make exchanges with file of projects manager. Initially, it allows the importation of MS-Project or Planner files. Soon, it will be possible to export a project or synchronize it. --- NEW FILE: projectexport.png --- PNG ºèÊî,QÂÔõB!èJqÐ wb,E12#I3óo.E̵¢ûqnß7ß·±üu[ÞçpxÎyÏsÎþ[#;Áà gÕlEÎ Æ8(011'M_io¿æøëL##s*co¿xñ >5õ÷õ¹yCCOÝðÑdNÎ98c@$ÌÎ.ayy:¶£¾¾ûÎÞø´ê[as°Å^·ØJ§aÛ/î T¾b3WË!l((È V+ ÚÀä¤÷.V µMÏxwX9gÉùr @J`C%\`Æ îúüo;tÁب>÷TSÔ^^Bõ]Rd8_±_jÁ§æ]\¯µ ȵç B¸o º«¾ÇÑýûôÛ \®¡>kh×bÙlUA@ Eý®âO´ìóBP --- NEW FILE: projectimport.png --- PNG µÓXí×2Â+ÎÖq¥´YU. ìÕX(I0e©ðùlpðYXzåaïR¬åU?Ra=aDÂ9kFõBúmsóZôa» ±Y".(© --- NEW FILE: projectio.png --- PNG 7ä5OÃbw¡ÌYMA4*ÍÖÐUºA|8ýÍ~ê½íH à·[óp_÷>ä/]±Ès+ ²z".©PR ·Úõ --- NEW FILE: projectsynchro.png --- PNG ڢࠢ -ZAA¶µkM45mI'¯ÉL¾ï®îµnîVüïÎóãÃÿà·&<}Ú?êr©"ç¦ÉÀ¥º»?¨]]ï¶:µãòÿãEÕÿr$:$I I EB§j[[· `}pMË fÐ\^p |
From: Emmanuel D. <ede...@us...> - 2006-02-09 17:06:01
|
Update of /cvsroot/tutos/tutos/templates/classic/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1541/templates/classic/projectio Log Message: Directory /cvsroot/tutos/tutos/templates/classic/projectio added to the repository --> Using per-directory sticky tag `BRANCH-2-0' |
From: Emmanuel D. <ede...@us...> - 2006-02-09 17:04:36
|
Update of /cvsroot/tutos/tutos/php/projectio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv790/php/projectio Log Message: Directory /cvsroot/tutos/tutos/php/projectio added to the repository --> Using per-directory sticky tag `BRANCH-2-0' |
From: Emmanuel D. <ede...@us...> - 2006-02-09 17:02:57
|
Update of /cvsroot/tutos/tutos/php/mantis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32371/php/mantis Modified Files: Tag: BRANCH-2-0 mantis.pinc Log Message: * delete comment Index: mantis.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/mantis/Attic/mantis.pinc,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- mantis.pinc 1 Feb 2006 10:51:11 -0000 1.1.2.2 +++ mantis.pinc 9 Feb 2006 17:02:44 -0000 1.1.2.3 @@ -35,7 +35,6 @@ mantisbug::obj_read($b); if (!isset($b->mbuglist) || count($b->mbuglist) == 0) { - error_log("********* NO MANTIS BUG FOR THIS BUG ".$b->id); return; } $mb = $b->mbuglist[0]; @@ -43,8 +42,6 @@ if (isset($b->state) && $b->state != $h->state && $h->state >= BUG_STATE_CLOSED) { error_log("********* CHANGE STATUS OF MANTIS BUG"); $mb->updateMBug(MANTIS_BUG_STATE_SOLVED, $h->description); - } else { - error_log("********* NO SIGNIFICATIVE CHANGE"); } } @@ -52,7 +49,6 @@ function mantisbug(&$dbconn) { global $tutos,$current_user,$table; - error_log ("MANTISBUG::NEW"); $this->init($dbconn); $this->mp_id = ''; // mantis project id in tutos @@ -69,7 +65,6 @@ function read_result (&$r, $pos ) { global $current_user; - error_log ("MANTISBUG::READ_RESULT"); $this->mp_id = $r->get($pos, "mp_id"); $this->bug_id = $r->get($pos, "bug_id"); $this->m_bug_id = $r->get($pos, "m_bug_id"); @@ -88,7 +83,6 @@ function save () { global $current_user, $tutos, $lang ,$table ; - error_log ("MANTISBUG::SAVE"); $msg = ""; $now = new DateTime(); @@ -113,7 +107,6 @@ * read the linked object */ function read_reference () { - error_log ("MANTISBUG::READ_REFERENCE"); if ( $this->mp_id == -1 ) return; if ( empty($this->mp_id) ) return; @@ -134,7 +127,6 @@ function delete() { global $current_user; - error_log ("MANTISBUG::DELETE"); $msg = ""; $q = "DELETE FROM ". $this->tablename ." WHERE id = ". $this->id; @@ -160,7 +152,6 @@ function obj_read(&$obj) { global $table; - error_log ("MANTISBUG::OBJ_READ"); if ( $obj == -1 ) return; if (! is_object($obj) ) return; @@ -224,7 +215,6 @@ function mantis(&$dbconn) { global $tutos,$current_user,$table; - error_log ("MANTIS::NEW"); $this->init($dbconn); $this->pro_id = ''; # Linked Tutos product ID @@ -288,7 +278,6 @@ function getaddlink (&$user,&$obj,$text = "") { global $lang; - error_log("MANTIS::GETADDLINK"); if ( $obj == -1 ) return ""; if (! is_object($obj) ) return ""; if ( $obj->id == -1 ) return ""; @@ -436,14 +425,12 @@ * get the type of object */ function gettype () { - error_log("MANTIS::GETTYPE"); return "mantis"; } /** * get the type id of object */ function gettypeid () { - error_log("MANTIS::GETTYPEID"); return usemantis; } @@ -459,7 +446,6 @@ $obj->list[usemantis] = array(); if ($obj->gettype() == "product") { - error_log ("MANTIS::OBJ_READ for product_id:".$obj->id); $q = "SELECT * from ". $obj->dbconn->prefix ."mantisprojects where pro_id = ". $obj->id; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); @@ -474,7 +460,6 @@ $r->free(); } if ($obj->gettype() == "bug") { - error_log ("MANTIS::OBJ_READ for bug_id:".$obj->id); $q = "SELECT * from ". $obj->dbconn->prefix ."mantisbugs where bug_id = ". $obj->id; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); @@ -497,7 +482,6 @@ */ function infolist (&$user,&$obj,$cols,$format = "html") { global $lang; - error_log ("MANTIS::INFOLIST"); if ( $obj == -1 ) return; if (! is_object($obj) ) return; @@ -604,7 +588,6 @@ $cmd .= " --".$p." \"". str_replace('"','\"',$v) ."\""; } } - error_log ("MANTISQUERY CDM=$cmd"); $output = shell_exec ($cmd); $result = unserialize($output); |
From: <jan...@ed...> - 2006-02-07 18:10:53
|
Do TUTOS allow export and inport of data? I want transfer data from one instalation to another. And, how is it for various versions of TUTOS? |
From: Emmanuel D. <ede...@us...> - 2006-02-01 10:51:22
|
Update of /cvsroot/tutos/tutos/php/mantis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13466 Modified Files: Tag: BRANCH-2-0 mantis.pinc Log Message: * bugfix: implode is a destructive function for string Index: mantis.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/mantis/Attic/mantis.pinc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- mantis.pinc 18 Jan 2006 13:52:53 -0000 1.1.2.1 +++ mantis.pinc 1 Feb 2006 10:51:11 -0000 1.1.2.2 @@ -604,10 +604,10 @@ $cmd .= " --".$p." \"". str_replace('"','\"',$v) ."\""; } } - $output = array(); error_log ("MANTISQUERY CDM=$cmd"); - exec ($cmd, $output); - $result = unserialize(implode("\n",$output)); + $output = shell_exec ($cmd); + + $result = unserialize($output); if (!isset ($result) || !isset ($result['result']) || $result['result'] != 1) { return null; |