Skip to content

Commit

Permalink
Merge pull request #889 from openeyes/release/v1.18.1
Browse files Browse the repository at this point in the history
Release/v1.18.1
  • Loading branch information
mikepargeter authored Jul 4, 2017
2 parents 9708e7c + b082437 commit 6ca3fae
Show file tree
Hide file tree
Showing 163 changed files with 4,379 additions and 657 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"sebastian/phpcpd": "*",
"phpdocumentor/phpdocumentor": "2.*",
"guzzle/guzzle": "^3.9.3"

},
"config": {
"bin-dir": "bin"
Expand Down
357 changes: 200 additions & 157 deletions protected/assets/css/style.css

Large diffs are not rendered by default.

Empty file.
Binary file not shown.
Binary file removed protected/assets/img/_print/letterhead_seal.jpg
Binary file not shown.
10 changes: 7 additions & 3 deletions protected/assets/js/OpenEyes.UI.Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Intit the search by calling the
OpenEyes.UI.Search.init( $('#patient_merge_search') );
and pass the input DOM
Clik on one item in the autocomplete list will redirect to the patien's summery page like: /patient/view/19942
Click on one item in the autocomplete list will redirect to the patien's summery page like: /patient/view/19942
To override the default functionality
Expand Down Expand Up @@ -67,6 +67,7 @@

var autocompleteSource = '/patient/ajaxSearch';
var $searchInput;
var loader = '.loader';

/**
* Render an item
Expand Down Expand Up @@ -97,13 +98,13 @@
}, response);
},
search: function () {
$('.loader').show();
$(loader).show();
},
select: function(event, ui){
window.location.href = "/patient/view/" + ui.item.id;
},
response: function (event, ui) {
$('.loader').hide();
$(loader).hide();
if (ui.content.length === 0) {
$input.siblings('.no-result-patients').slideDown();
} else {
Expand Down Expand Up @@ -132,6 +133,9 @@
},
getElement: function(){
return $searchInput;
},
setLoader: function(selector){
loader = selector;
}
};
}(this.OpenEyes.UI));
2 changes: 1 addition & 1 deletion protected/assets/js/docman.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ var docman = (function() {

$('#DocumentTarget_' + rowindex + '_attributes_contact_type').val('OTHER');
$('#yDocumentTarget_' + rowindex + '_attributes_contact_type').val('OTHER');

$('#DocumentTarget_' + rowindex + '_attributes_contact_type').trigger('change');
//set readonly
//$('#DocumentTarget_' + rowindex + '_attributes_contact_name').attr('readonly', false);
$('#Document_Target_Address_' + rowindex).attr('readonly', false);
Expand Down
52 changes: 52 additions & 0 deletions protected/assets/sass/openeyes/components/_tagsinput.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* OpenEyes
*
* (C) OpenEyes Foundation, 2017
* This file is part of OpenEyes.
* OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
*
* @package OpenEyes
* @link http://www.openeyes.org.uk
* @author OpenEyes <[email protected]>
* @copyright Copyright (c) 2017, OpenEyes Foundation
* @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
*/

// Tags container

.oe-tagsinput-wrapper .tagsinput{
@extend textarea
}

// Tag element

.oe-tagsinput-wrapper .tagsinput .tag{
@extend .pill;
border-radius: $oe-box-border-radius;
border-color: $primary-color;
background-color: lighten($primary-color, 50%);
}

// Tag text

.oe-tagsinput-wrapper .tagsinput .tag span{
color: $primary-color;
}

// Remove link

.oe-tagsinput-wrapper .tagsinput .tag a{
background: image-url("_elements/icons/event-optional/element-remove.png") no-repeat -10px -2px;
color: transparent;
display: inline-block;
height: 15px;
margin-left: 2px;
margin-top: 1px;
vertical-align: top;
width: 14px;
&:hover {
@include opacity(1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
}

.icon-patient-panel-info {
background: url('_elements/icons/information.png');
background: image-url('_elements/icons/information.png');
margin: 0;
width:16px;
height:16px;
Expand All @@ -186,4 +186,4 @@
width: 280px;
background-color: white;
z-index: 10000;
}
}
1 change: 1 addition & 0 deletions protected/assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@
@import "openeyes/components/studies";
@import "openeyes/components/docman";
@import "openeyes/components/cdetail-view";
@import "openeyes/components/tagsinput";
3 changes: 2 additions & 1 deletion protected/behaviors/Study.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public function canBeProposedByUser(CWebUser $user)
*/
public function canBeProposedByUserDateCheck(CWebUser $user)
{
if (new DateTime($this->end_date) < new DateTime('midnight')) {

if ( (Helper::isValidDateTime($this->end_date)) && (new DateTime($this->end_date) < new DateTime('midnight')) ) {
return false;
}
return true;
Expand Down
84 changes: 84 additions & 0 deletions protected/behaviors/TaggedActiveRecordBehavior.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

/**
* OpenEyes
*
* (C) OpenEyes Foundation, 2017
* This file is part of OpenEyes.
* OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>.
*
* @package OpenEyes
* @link http://www.openeyes.org.uk
* @author OpenEyes <[email protected]>
* @copyright Copyright (c) 2017, OpenEyes Foundation
* @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0
*/
/**
* Class TaggedActiveRecordBehavior
*
* Attach this behaviour to all Active Records that have
* MANY_MANY relation to Tags
*/

class TaggedActiveRecordBehavior extends CActiveRecordBehavior
{
/**
* Translates tag names from user input
* into an array of tag ids. If tag name
* cant be found, creates one.
*
* @return bool
*/

public function beforeSave($event)
{
if(is_array($this->owner->tags))
{
return parent::beforeSave($event);
}

if($this->owner->tags !== '')
{
$tags = explode(",", $this->owner->tags);
$tag_ids=array();
foreach($tags as $tag)
{
// Get tag id...
if($t = Tag::model()->findByAttributes(['name'=>$tag]))
{
$tag_ids[] = $t->id;
}
// ...or create new tag
else
{
$t = new Tag();
$t->name = $tag;
$t->save();
$tag_ids[] = $t->id;
}
}

$this->owner->tags = $tag_ids;
}
else
{
$this->owner->tags = array();
}

return parent::beforeSave($event);
}

/**
* @return string
*
* Returns the list of tag names,
* separated by comma+space (', ')
*/

public function getTagNames()
{
return implode(', ', array_map(function($e){ return $e->name; }, $this->owner->tags));
}
}
2 changes: 1 addition & 1 deletion protected/cli_commands/file_watcher/runFileWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function processDir($dirResource, $root, $logger)
global $mysqli;
global $newfile;
//echo "Processing: ".$root."\n";
while (false !== ($entry = readdir($dirResource))) {
while ($dirResource && false !== ($entry = readdir($dirResource))) {
if ($entry != '.' && $entry != '..') {
if (is_dir($root.'/'.$entry)) {
$dirToProcess = opendir($root.'/'.$entry);
Expand Down
28 changes: 22 additions & 6 deletions protected/commands/DocManDeliveryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ private function savePDFFile($event_id, $output_id)
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $login_page);
// disable SSL certificate check for locally issued certificates
if(Yii::app()->params['disable_ssl_certificate_check']) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookie.txt');
Expand Down Expand Up @@ -224,12 +228,24 @@ private function savePDFFile($event_id, $output_id)
curl_close($ch);

if(substr($content, 0, 4) !== "%PDF"){
echo 'File is not a PDF for event id: '.$event->id."\n";
echo 'File is not a PDF for event id: '.$this->event->id."\n";
$this->updateFailedDelivery($output_id);
return false;
}

$filename = $this->getFileName();

if (!isset(Yii::app()->params['docman_filename_format']) || Yii::app()->params['docman_filename_format'] === 'format1') {
$filename = "OPENEYES_" . (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_' . $this->event->id . "_" . rand();
} else {
if (Yii::app()->params['docman_filename_format'] === 'format2') {
$filename = (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_' . date('YmdHi',
strtotime($this->event->last_modified_date)) . '_' . $this->event->id;
} else {
if (Yii::app()->params['docman_filename_format'] === 'format3') {
$filename = (str_replace(' ', '', $this->event->episode->patient->hos_num)) . '_edtdep-OEY_' .
date('Ymd_His', strtotime($this->event->last_modified_date)) . '_' . $this->event->id;
}
}
}

$pdf_generated = (file_put_contents($this->path . "/" . $filename . ".pdf", $content) !== false);

Expand Down Expand Up @@ -288,9 +304,9 @@ private function getFileName($prefix = '')
private function generateXMLOutput($filename, $document_output)
{
$element_letter = ElementLetter::model()->findByAttributes(array("event_id" => $this->event->id));
$subObj = $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty;
$subspeciality = isset($subObj->ref_spec) ? $subObj->ref_spec : 'SS';
$subspeciality_name = isset($subObj->name) ? $subObj->name : 'Support Services';
$sub_obj = isset($this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty) ? $this->event->episode->firm->serviceSubspecialtyAssignment->subspecialty : null;
$subspeciality = isset($sub_obj->ref_spec) ? $sub_obj->ref_spec : 'SS';
$subspeciality_name = isset($sub_obj->name) ? $sub_obj->name : 'Support Services';
$nat_id = isset($this->event->episode->patient->gp->nat_id) ? $this->event->episode->patient->gp->nat_id : null;
$gp_name = isset($this->event->episode->patient->gp->contact) ? $this->event->episode->patient->gp->contact->getFullName() : null;
$practice_code = isset($this->event->episode->patient->practice->code) ? $this->event->episode->patient->practice->code : '';
Expand Down
Loading

0 comments on commit 6ca3fae

Please sign in to comment.