Skip to content

Commit

Permalink
Document UI cleanup (list, view, upload)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachoac committed Jan 29, 2010
1 parent 5a340bc commit 231b4c2
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 100 deletions.
6 changes: 3 additions & 3 deletions controllers/C_Document.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function upload_action_process() {
$error .= xl('Current file name was changed to','','',' ') . $fname ."\n";
}
if (move_uploaded_file($file['tmp_name'],$this->file_path.$file['name'])) {
$error .= xl('File','','',' ') . $file['name'] . xl('successfully stored.','',' ') . "\n";
$this->assign("upload_success", "true");
$d = new Document();
$d->url = "file:https://" .$this->file_path.$file['name'];
$d->mimetype = $file['type'];
Expand Down Expand Up @@ -154,8 +154,8 @@ function view_action($patient_id="",$doc_id) {
// Added by Rod to support document delete:
$delete_string = '';
if (acl_check('admin', 'super')) {
$delete_string = "<a href='' onclick='return deleteme(" . $d->get_id() .
")'><font color='red'>(" . xl('Delete this document') . ")</font></a>";
$delete_string = "<a href='' class='css_button' onclick='return deleteme(" . $d->get_id() .
")'><span><font color='red'>" . xl('Delete') . "</font></span></a>";
}
$this->assign("delete_string", $delete_string);
$this->assign("REFRESH_ACTION",$this->_link("list"));
Expand Down
15 changes: 8 additions & 7 deletions interface/themes/style_sky_blue.css
Original file line number Diff line number Diff line change
Expand Up @@ -243,32 +243,32 @@ font-style: italic;
font-weight: bold;
}
#documents_list {
width: 28%;
height: 100%;
width: 29%;
height: 95%;
overflow: auto;
border: 2px inset;
float: left;
border-right: dashed 1px;
}
#documents_actions {
padding-top: 10px;
width: 70%;
height: 100%;
height: 95%;
float: right;
overflow: auto;
}
#documents_actions iframe {
display: inline;
border:none;
width:100%;
height:600px;
height:200px;
overflow: auto;
}
#documents_actions form {
margin: 0px; padding: 0px;
}
#documents_actions table {
width: 100%;
height: 100%;
height: 95%;
}

/*=============================================================
Expand Down Expand Up @@ -794,4 +794,5 @@ font-size:9pt;
background-color: #94D6E7;
padding: 5px;
position: absolute;
display: block;
display: block;
}
12 changes: 7 additions & 5 deletions templates/documents/general_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@

<script src="DocumentTreeMenu.js" language="JavaScript" type="text/javascript"></script>
</head>
<body bgcolor="{$STYLE.BGCOLOR2}">
<!--<body bgcolor="{$STYLE.BGCOLOR2}">-->
<body class="body_top">
<div class="title">{xl t='Documents'}</div>
<div id="documents_list">
<table>
<tr>
<td height="20" valign="top">{xl t='Document Categories'}<br>
&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:objTreeMenu_1.collapseAll();return false;">{xl t='collapse all'}</a>
<td height="20" valign="top">{xl t='Categories'} &nbsp;
(<a href="#" onclick="javascript:objTreeMenu_1.collapseAll();return false;">{xl t='Collapse all'}</a>)
</td>
</tr>
<tr>
Expand All @@ -24,10 +26,10 @@
</div>
<div id="documents_actions">
{if $message}
{$message}<br>
<div class='text' style="margin-bottom:-10px; margin-top:-8px"><i>{$message}</i></div><br>
{/if}
{if $messages}
{$messages}<br>
<div class='text' style="margin-bottom:-10px; margin-top:-8px"><i>{$messages}</i></div><br>
{/if}
{$activity}
</div>
Expand Down
65 changes: 29 additions & 36 deletions templates/documents/general_upload.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
<form method=post enctype="multipart/form-data" action="{$FORM_ACTION}" onsubmit="return top.restoreSession()">
<input type="hidden" name="MAX_FILE_SIZE" value="12000000" />
<table>
<tr>
<td>{xl t="NOTE: Uploading files with duplicate names will cause the files to be automatically renamed (for example, file.jpg will become file.1.jpg). Filenames are considered unique per patient, not per category."}</td>
</tr>
<tr>
<td>{xl t="Upload Document"} {if $category_name} {xl t="to category"} '{$category_name}'{/if}</td>
</tr>
<tr>
<td><input type="file" name="file"></td>
</tr>
<tr>
<td><input type="submit" value="{xl t='Upload'}"></td>
</tr>
{if !empty($file)}
<tr>
<td><br><br></td>
</tr>
<tr>
<td>{xl t='Upload Report'}</td>
</tr>
<tr>
<td>{$error}</td>
</tr>
<tr>
<td>
{xl t='ID'}: {$file->get_id()}<br>
{xl t='Patient'}: {$file->get_foreign_id()}<br>
{xl t='URL'}: {$file->get_url()}<br>
{xl t='Size'}: {$file->get_size()}<br>
{xl t='Date'}: {$file->get_date()}<br>
{xl t='MimeType'}: {$file->get_mimetype()}<br>
{xl t='Revision'}: {$file->revision}<br>
</td>
</tr>
{/if}
</table>

<div class="text">
{xl t="NOTE: Uploading files with duplicate names will cause the files to be automatically renamed (for example, file.jpg will become file.1.jpg). Filenames are considered unique per patient, not per category."}
<br/>
<br/>
</div>
<div class="text bold">
{xl t="Upload Document"} {if $category_name} {xl t="to category"} '{$category_name}'{/if}
</div>
<div class="text">
<input type="file" name="file"> <input type="submit" value="{xl t='Upload'}">
</div>
{if !empty($file)}
<div class="text bold">
<br/>
{xl t='Upload Report'}
</div>
<div class="text">
{if $error}<i>{$error}</i><br/>{/if}
{xl t='ID'}: {$file->get_id()}<br>
{xl t='Patient'}: {$file->get_foreign_id()}<br>
{xl t='URL'}: {$file->get_url()}<br>
{xl t='Size'}: {$file->get_size()}<br>
{xl t='Date'}: {$file->get_date()}<br>
{xl t='MimeType'}: {$file->get_mimetype()}<br>
{xl t='Revision'}: {$file->revision}<br>
</div>
{/if}

<input type="hidden" name="patient_id" value="{$patient_id}" />
<input type="hidden" name="category_id" value="{$category_id}" />
<input type="hidden" name="process" value="{$PROCESS}" />
Expand Down
144 changes: 95 additions & 49 deletions templates/documents/general_view.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<head>
<style type="text/css">@import url(library/dynarch_calendar.css);</style>
<script type="text/javascript" src="library/dialog.js"></script>
<script type="text/javascript" src="library/textformat.js"></script>
Expand Down Expand Up @@ -30,62 +31,107 @@
return false;
{literal}}{/literal}


</script>

</head>


<table valign="top">
<tr>
<tr>
<td>
<a class="css_button" href="{$web_path}" onclick="top.restoreSession()"><span>{xl t='Download'}</span></a>
<a class="css_button" href='' onclick='return showpnotes({$file->get_id()})'><span>{xl t='Show Notes'}</span></a>
{$delete_string}
</td>
</tr>
<tr>
<td valign="top">
<a href="{$web_path}" onclick="top.restoreSession()">{xl t='Click to download'}</a>

&nbsp;&nbsp;&nbsp;
<a href='' onclick='return showpnotes({$file->get_id()})'>{xl t='Show Patient Notes'}</a>

&nbsp;&nbsp;&nbsp;{$delete_string}

<p><form method="post" name="document_update" action="{$UPDATE_ACTION}" onsubmit="return top.restoreSession()">
{xl t='Date'}:
<input type='text' size='10' name='docdate' id='docdate'
value='{$DOCDATE}' title='{xl t='yyyy-mm-dd document date'}'
onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
<img src='interface/pic/show_calendar.gif' id='img_docdate' align='absbottom'
width='24' height='22' border='0' alt='[?]' style='cursor:pointer'
title='{xl t='Click here to choose a date'}' />
&nbsp;&nbsp;
<select name="issue_id">{$ISSUES_LIST}</select>
&nbsp;&nbsp;
<input type="submit" name="docupdate" value="{xl t='Update'}" />
</form>

<p><form method="post" name="document_move" action="{$MOVE_ACTION}" onsubmit="return top.restoreSession()">
<select name="new_category_id">{$tree_html_listbox}</select>&nbsp;
{xl t='Move to Patient'} # <input type="text" name="new_patient_id" size="4" />
<a href="javascript:{literal}{}{/literal}"
onclick="top.restoreSession();var URL='controller.php?patient_finder&find&form_id={"document_move['new_patient_id']"|escape:"url"}&form_name={"document_move['new_patient_name']"|escape:"url"}'; window.open(URL, 'document_move', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=450,height=400,left=425,top=250');">
<img src="images/stock_search-16.png" border="0" /></a>
<input type="hidden" name="new_patient_name" value="" />
&nbsp;&nbsp;&nbsp;<input type="submit" name="move" value="{xl t='Move'}" />
</form>

<p><form name="notes" method="post" action="{$NOTE_ACTION}" onsubmit="return top.restoreSession()">
<textarea cols="53" rows="4" wrap="virtual" name="note"></textarea><br>
<input type="submit" name="add note" value="{xl t='Add Note'}">
<input type="hidden" name="process" value="{$PROCESS}" />
<input type="hidden" name="foreign_id" value="{$file->get_id()}" />
</form>

<textarea cols="53" rows="10" readonly style='background-color:transparent'>
{foreach name=note_loop from=$notes item=note}
{xl t='Note'} #{$note->get_id()}
{xl t='Date:'} {$note->get_date()}
{$note->get_note()}

{/foreach}
</textarea>
<br />

<div class="text">
<form method="post" name="document_update" action="{$UPDATE_ACTION}" onsubmit="return top.restoreSession()">
<div>
<div style="float:left">
<b>{xl t='Update'}</b>&nbsp;
</div>
<div style="float:none">
<a href="javascript:;" onclick="document.forms['document_update'].submit();">(<span>{xl t='submit'})</span></a>
</div>
</div>
<div>
{xl t='Date'}:
<input type='text' size='10' name='docdate' id='docdate'
value='{$DOCDATE}' title='{xl t='yyyy-mm-dd document date'}'
onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
<img src='interface/pic/show_calendar.gif' id='img_docdate' align='absbottom'
width='24' height='22' border='0' alt='[?]' style='cursor:pointer'
title='{xl t='Click here to choose a date'}' />
<select name="issue_id">{$ISSUES_LIST}</select>
</div>
</form>
</div>

<br/>

<div class="text">
<form method="post" name="document_move" action="{$MOVE_ACTION}" onsubmit="return top.restoreSession()">
<div>
<div style="float:left">
<b>{xl t='Move'}</b>&nbsp;
</div>
<div style="float:none">
<a href="javascript:;" onclick="document.forms['document_move'].submit();">(<span>{xl t='submit'})</span></a>
</div>
</div>

<div>
<select name="new_category_id">{$tree_html_listbox}</select>&nbsp;
{xl t='Move to Patient'} # <input type="text" name="new_patient_id" size="4" />
<a href="javascript:{literal}{}{/literal}"
onclick="top.restoreSession();var URL='controller.php?patient_finder&find&form_id={"document_move['new_patient_id']"|escape:"url"}&form_name={"document_move['new_patient_name']"|escape:"url"}'; window.open(URL, 'document_move', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=450,height=400,left=425,top=250');">
<img src="images/stock_search-16.png" border="0" /></a>
<input type="hidden" name="new_patient_name" value="" />
</div>
</form>
</div>

<br/>

<form name="notes" method="post" action="{$NOTE_ACTION}" onsubmit="return top.restoreSession()">
<div class="text">
<div>
<div style="float:left">
<b>{xl t='Notes'}</b>&nbsp;
</div>
<div style="float:none">
<a href="javascript:;" onclick="document.forms['notes'].submit();">(<span>{xl t='add'}</span>)</a>
</div>
<div>
<textarea cols="53" rows="4" wrap="virtual" name="note"></textarea><br>
<input type="hidden" name="process" value="{$PROCESS}" />
<input type="hidden" name="foreign_id" value="{$file->get_id()}" />

{if $notes}
<div style="margin-top:7px">
{foreach name=note_loop from=$notes item=note}
<div>
{xl t='Note'} #{$note->get_id()}
{xl t='Date:'} {$note->get_date()}
{$note->get_note()}
</div>
{/foreach}
{/if}
</div>
</div>
</div>
</form>

</td>
</tr>
<tr>
<td>
{if $file->get_mimetype() eq "image/tiff"}
<div class="text"><b>{xl t='Content'}</b></div>
{if $file->get_mimetype() eq "image/tiff"}
<embed frameborder="0" type="{$file->get_mimetype()}" src="{$web_path}as_file=false"></embed>
{elseif $file->get_mimetype() eq "image/png" or
$file->get_mimetype() eq "image/jpg" or
Expand Down

0 comments on commit 231b4c2

Please sign in to comment.