From: David T. <mmm...@us...> - 2007-03-11 15:23:58
|
Update of /cvsroot/helpmeict/Helpdesk In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv11591 Modified Files: footer.php issue.php newissue.php summary.php Log Message: getting there... Index: summary.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/summary.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** summary.php 7 Feb 2007 01:20:04 -0000 1.11 --- summary.php 11 Mar 2007 15:23:48 -0000 1.12 *************** *** 172,176 **** function run_query($fieldsx, $fieldsy, &$display) { ! global $aselects; global $afrom, $db; function maketimes($time) { --- 172,176 ---- function run_query($fieldsx, $fieldsy, &$display) { ! global $aselects; global $afrom, $helpdeskdb; function maketimes($time) { *************** *** 188,192 **** global $dateto; ! if ($db->phptype == "pgsql") { $axes = "vw_issues.{$fieldsx['id']}, vw_issues.{$fieldsy['id']}"; $names = "vw_issues.{$fieldsx['name']}, vw_issues.{$fieldsy['name']}"; --- 188,192 ---- global $dateto; ! if ($helpdeskdb->phptype == "pgsql") { $axes = "vw_issues.{$fieldsx['id']}, vw_issues.{$fieldsy['id']}"; $names = "vw_issues.{$fieldsx['name']}, vw_issues.{$fieldsy['name']}"; *************** *** 356,361 **** } ! global $db; ! return db_recordset($sql[$db->phptype]); } } --- 356,361 ---- } ! global $helpdeskdb; ! return db_recordset($sql[$helpdeskdb->phptype]); } } Index: newissue.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/newissue.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** newissue.php 7 Feb 2007 01:20:04 -0000 1.10 --- newissue.php 11 Mar 2007 15:23:48 -0000 1.11 *************** *** 143,152 **** } ! // Deal with adding an attachment ! if ($_FILES['attachment']['error'] == UPLOAD_ERR_OK) { ! $attachment_dir = get_attachment_dir($issue, true); ! move_uploaded_file($_FILES['attachment']['tmp_name'], $attachment_dir."/".$_FILES['attachment']['name']); } ! $act = 'thanks'; } --- 143,156 ---- } ! // Deal with adding attachments ! $attachment_dir = get_attachment_dir($issue, true); ! for ($i = 0; $i < count($_FILES['attachments']['name']); ++$i) ! { ! if ($_FILES['attachments']['name'][$i] != '' && $_FILES['attachments']['error'][$i] == UPLOAD_ERR_OK) ! { ! move_uploaded_file($_FILES['attachments']['tmp_name'][$i], $attachment_dir.'/'.$_FILES['attachments']['name'][$i]); ! } } ! $act = 'thanks'; } *************** *** 595,602 **** <label for="attachment"><?php echo gettext("Add attachment")?></label> </div> ! <div class="field"> ! <input type="file" name="attachment" /> </div> </div> <?php } --- 599,639 ---- <label for="attachment"><?php echo gettext("Add attachment")?></label> </div> ! <div class="field" id="attachments_wrapper"> ! <div id="attachments"> ! <input type="file" name="attachments[]" /> ! </div> </div> </div> + + <script language="javascript" type="text/javascript"> + //<![CDATA[ + <!-- + + function add_attachment() + { + // New file input + attachments = document.getElementById('attachments'); + var new_attachment = document.createElement('input'); + new_attachment.type = 'file'; + new_attachment.className = 'clearboth'; + new_attachment.name = 'attachments[]'; + attachments.appendChild(new_attachment); + } + + if (document.getElementById) + { + attachments_wrapper = document.getElementById('attachments_wrapper'); + + // Add link + var add_link = document.createElement('a'); + add_link.href = 'javascript: add_attachment();'; + add_link.innerHTML = 'Add Another...'; + attachments_wrapper.appendChild(add_link); + } + + //--> + //]]> + </script> + <?php } Index: issue.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/issue.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** issue.php 7 Feb 2007 01:20:03 -0000 1.34 --- issue.php 11 Mar 2007 15:23:48 -0000 1.35 *************** *** 271,275 **** chdir($attachment_dir); unlink(urldecode($attachment)); ! $track .= "File \'".$attachment."\' removed from issue.\n"; chdir($cwd); } --- 271,275 ---- chdir($attachment_dir); unlink(urldecode($attachment)); ! $track .= "File \'".$attachment."\' removed from issue.<br />\n"; chdir($cwd); } *************** *** 300,308 **** } ! // Deal with adding an attachment ! if ($_FILES['attachment']['error'] == UPLOAD_ERR_OK) { ! $attachment_dir = get_attachment_dir($id, true); ! move_uploaded_file($_FILES['attachment']['tmp_name'], $attachment_dir."/".$_FILES['attachment']['name']); ! $track .= "File \'".$_FILES['attachment']['name']."\' attached to issue.\n"; } --- 300,312 ---- } ! // Deal with adding attachments ! $attachment_dir = get_attachment_dir($id, true); ! for ($i = 0; $i < count($_FILES['attachments']['name']); ++$i) ! { ! if ($_FILES['attachments']['name'][$i] != '' && $_FILES['attachments']['error'][$i] == UPLOAD_ERR_OK) ! { ! move_uploaded_file($_FILES['attachments']['tmp_name'][$i], $attachment_dir.'/'.$_FILES['attachments']['name'][$i]); ! $track .= "File \'".$_FILES['attachments']['name'][$i]."\' attached to issue.<br />\n"; ! } } *************** *** 1241,1245 **** <label for="attachments"><?php echo gettext("Attachments")?></label> </div> ! <div class="field"> <?php // Get a list of attachment files for this issue. --- 1245,1249 ---- <label for="attachments"><?php echo gettext("Attachments")?></label> </div> ! <div class="value"> <?php // Get a list of attachment files for this issue. *************** *** 1278,1284 **** <label for="attachment"><?php echo gettext("Add attachment")?></label> </div> ! <div class="field"> ! <input type="file" name="attachment" /> </div> </div> <?php --- 1282,1321 ---- <label for="attachment"><?php echo gettext("Add attachment")?></label> </div> ! <div class="field" id="attachments_wrapper"> ! <div id="attachments"> ! <input type="file" name="attachments[]" /> ! </div> </div> + + <script language="javascript" type="text/javascript"> + //<![CDATA[ + <!-- + + function add_attachment() + { + // New file input + attachments = document.getElementById('attachments'); + var new_attachment = document.createElement('input'); + new_attachment.type = 'file'; + new_attachment.className = 'clearboth'; + new_attachment.name = 'attachments[]'; + attachments.appendChild(new_attachment); + } + + if (document.getElementById) + { + attachments_wrapper = document.getElementById('attachments_wrapper'); + + // Add link + var add_link = document.createElement('a'); + add_link.href = 'javascript: add_attachment();'; + add_link.innerHTML = 'Add Another...'; + attachments_wrapper.appendChild(add_link); + } + + //--> + //]]> + </script> + </div> <?php Index: footer.php =================================================================== RCS file: /cvsroot/helpmeict/Helpdesk/footer.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** footer.php 7 Feb 2007 01:46:40 -0000 1.3 --- footer.php 11 Mar 2007 15:23:48 -0000 1.4 *************** *** 27,31 **** */ ! require_once 'system/global_preferences.php'; // Get all navigation category name --- 27,32 ---- */ ! require_once 'system/db.php'; ! require_once 'system/lang.php'; // Get all navigation category name *************** *** 75,78 **** --- 76,80 ---- // Build navigation tree + if ($_SESSION['_username'] == '') { // Set up sidebar links from DB *************** *** 217,220 **** --- 219,223 ---- } } + include_once 'system/global_preferences.php'; ?> </div> |