3 * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
5 * This file is part of FusionForge.
7 * FusionForge is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License,
10 * or (at your option) any later version.
12 * FusionForge is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with FusionForge; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 * Standard Alcatel-Lucent disclaimer for contributing to open source
26 * "The provided file ("Contribution") has not been tested and/or
27 * validated for release as or in products, combinations with products or
28 * other commercial use. Any use of the Contribution is entirely made at
29 * the user's own responsibility and the user can not rely on any features,
30 * functionalities or performances Alcatel-Lucent has attributed to the
33 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
34 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
35 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
36 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
37 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
38 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
39 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
41 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
46 // This page contains a form with a file-upload button
47 // so a user can choose a file to upload a .csv file and store it in task mgr
51 pm_header(array('title'=>_('Upload data into the tasks.'),'group_project_id'=>$group_project_id));
53 $headers = getIntFromRequest('headers', 1);
54 $full = getIntFromRequest('full', 1);
55 $sep = getStringFromRequest('sep', ',');
57 $url_set_format = '/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=format_csv&sep='.urlencode($sep).'&full='.$full.'&headers='.$headers;
59 $url_export = '/pm/task.php?group_id='.$group_id.'&group_project_id='.$group_project_id.'&func=downloadcsv&sep='.urlencode($sep).'&full='.$full.'&headers='.$headers;
61 $format = $full ? "Full CSV" : "Normal CSV";
62 $format .= $headers ? ' with headers' : ' without headers';
63 $format .= " using '$sep' as separator.";
65 <p><?php echo _('This page allows you to export or import all the tasks using a CSV (<a href="http://en.wikipedia.org/wiki/Comma-separated_values">Comma Separated Values</a>) File. This format can be used to view tasks using MS Excel.'); ?></p>
66 <h2><?php echo _('Export tasks as a CSV file'); ?></h2>
68 <strong><?php echo _('Selected CSV Format :'); ?></strong> <?php echo $format ?> <a href="<?php echo $url_set_format ?>">(Change)</a>
70 <p><a href="<?php echo $url_export ?>"><?php echo _('Export CSV file'); ?></a></p>
72 <h2><?php echo _('Import tasks using a CSV file'); ?></h2>
73 <form enctype="multipart/form-data" method="post" action="<?php echo getStringFromServer('PHP_SELF')?>?group_project_id=<? echo $group_project_id ?>&group_id=<? echo $group_id ?>&func=postuploadcsv">
74 <p><?php echo _('Choose a file in the proper .csv format for uploading.'); ?></p>
75 <input type="file" name="userfile" size="30" />
76 <input type="submit" name="submit" value="submit" />
79 <p><strong>Notes:</strong></p>
82 <li>Be careful, when importing a CSV file, all the tasks will be replaced by the ones present in the file.</li>
83 <li>If project_task_id is empty, then a new task will be created.</li>
84 <li>If project_task_id is present, then the corresponding task will be updated.</li>
88 <h2>Record Layout</h2>
90 <table align="center" border="1" cellspacing="0" cellpadding="3">
91 <tr><td><strong>Field Name</strong></td><td><strong>Description</strong></td></tr>
92 <tr><td>project_task_id</td><td>this is the ID in gforge database</td></tr>
93 <tr><td>external_task_id</td><td>optional, the equivalent of project_task_id but determined by
94 external application, such as MS Project. Primarily preserved for sorting purposes only.</td></tr>
95 <tr><td>parent_id</td><td>the project_task_id of the parent task, if any</td></tr>
96 <tr><td>external_parent_id</td><td>the equivalent of parent project_task_id but
97 determined by external application, such as MS Project. Primarily preserved for matching purposes only.</td></tr>
98 <tr><td>title</td><td>The summary or brief description</td></tr>
99 <tr><td>category</td><td>The category name (must be defined, only available in full export)</td></tr>
100 <tr><td>duration</td><td>Duration in days</td></tr>
101 <tr><td>work</td><td>Number of hours required to complete</td></tr>
102 <tr><td>start_date</td><td>The start date in MM-DD-YYYY HH:MM:SS format</td></tr>
103 <tr><td>end_date</td><td>The end date in MM-DD-YYYY HH:MM:SS format</td></tr>
104 <tr><td>percent_complete</td><td>Percentage of completion</td></tr>
105 <tr><td>priority</td><td>integers 1 to 5</td></tr>
106 <tr><td>notes</td><td>optional, the details of the task or a comment to add to a task</td></tr>
107 <tr><td>resource1_unixname</td><td>optional, the unixname or precisely-matched realname of the assignee </td></tr>
108 <tr><td>resource2_unixname</td><td>optional, same as above</td></tr>
109 <tr><td>resource3_unixname</td><td>optional, same as above</td></tr>
110 <tr><td>resource4_unixname</td><td>optional, same as above</td></tr>
111 <tr><td>resource5_unixname</td><td>optional, same as above</td></tr>
112 <tr><td>dependenton1_project_task_id</td><td>optional, the GForge task_id of a task to be dependent on</td></tr>
113 <tr><td>dependenton1_external_task_id</td><td>optional, the ID used by the external application</td></tr>
114 <tr><td>dependenton1_linktype</td><td>SS, SF, FS, FF, - The same types as MS Project</td></tr>
115 <tr><td>dependenton2_project_task_id</td><td>repetition of dependenton1</td></tr>
116 <tr><td>dependenton2_external_task_id</td><td>repetition of dependenton1</td></tr>
117 <tr><td>dependenton2_linktype</td><td>repetition of dependenton1</td></tr>
118 <tr><td>dependenton3_project_task_id</td><td>repetition of dependenton1</td></tr>
119 <tr><td>dependenton3_external_task_id</td><td>repetition of dependenton1</td></tr>
120 <tr><td>dependenton3_linktype</td><td>repetition of dependenton1</td></tr>
121 <tr><td>dependenton4_project_task_id</td><td>repetition of dependenton1</td></tr>
122 <tr><td>dependenton4_external_task_id</td><td>repetition of dependenton1</td></tr>
123 <tr><td>dependenton4_linktype</td><td>repetition of dependenton1</td></tr>
124 <tr><td>dependenton5_project_task_id</td><td>repetition of dependenton1</td></tr>
125 <tr><td>dependenton5_external_task_id</td><td>repetition of dependenton1</td></tr>
126 <tr><td>dependenton5_linktype</td><td>repetition of dependenton1</td></tr>