=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-04-04 11:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json 2014-04-07 11:43:43 +0000
@@ -8,6 +8,7 @@
"list_all_entities": "List All Entities",
"list": "List",
"search": "Search",
+ "advanced_search": "Advanced search",
"search_for": "Search for",
"registered_entities": "Registered Entities",
"empty_entity_list": "There are no reigstered entities",
@@ -32,6 +33,8 @@
"create_new_event": "Create new event",
"close_search": "Close search",
"search_attributes": "Search attributes",
+ "available_search_attributes": "Available search attributes",
+ "selected_search_attributes": "Selected search attributes",
"search_for_dashboard": "Search for dashboard items",
"dashboard": "Dashboard",
"home": "Home",
@@ -41,6 +44,10 @@
"notes": "Notes",
"dataentry": "Data Entry",
"current_selections": "Current selections",
+ "org_unit_mode": "Searching org unit",
+ "use_selected": "Use selected",
+ "use_immediate_children": "Use immdiate children",
+ "use_all_children": "Use all children",
"data_element": "Data element",
"value": "Value",
"show_hide_widgets": "Show/Hide widgets",
@@ -49,5 +56,7 @@
"program_stage": "Program stage",
"scheduled_date": "Scheduled date",
"scheduling": "Scheduling",
- "enroll": "Enroll"
+ "enroll": "Enroll",
+ "like": "LIKE",
+ "not_like": "NOT LIKE"
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-04-04 11:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-04-07 11:43:43 +0000
@@ -17,6 +17,7 @@
//Selection
$scope.selectedOrgUnit = '';
$scope.selectedProgram = '';
+ $scope.ouMode = 'SELECTED';
//Filtering
$scope.reverse = false;
@@ -49,7 +50,7 @@
$scope.searchField.isOpen = false;
- $scope.trackedEntityList = [];
+ $scope.trackedEntityList = null;
$scope.gridColumns = AttributesFactory.getForListing();
@@ -69,17 +70,21 @@
};
$scope.clearEntities = function(){
- $scope.trackedEntityList = [];
+ $scope.trackedEntityList = null;
};
$scope.showRegistration = function(){
};
- $scope.showSearch = function(){
+ $scope.showSearch = function(){
$scope.showSearchDiv = !$scope.showSearchDiv;
};
+ $scope.hideSearch = function(){
+ $scope.showSearchDiv = false;
+ };
+
$scope.closeSearch = function(){
$scope.showSearchDiv = !$scope.showSearchDiv;
};
@@ -118,6 +123,7 @@
$scope.search = function(){
console.log('the search is: ', $scope.attributes);
+ console.log('the mode is: ', $scope.ouMode);
};
$scope.getHelpContent = function(){
@@ -125,6 +131,143 @@
};
})
+//Controller for the search section
+.controller('SearchController',
+ function($scope,
+ storage,
+ TranslationService) {
+
+ TranslationService.translate();
+
+ //search attibutes
+ $scope.attributes = storage.get('ATTRIBUTES');
+ $scope.availableAttributes = [];
+ $scope.selectedAttributes = [];
+ $scope.showAdvancedSearchDiv = false;
+
+ angular.forEach($scope.attributes, function(attribute){
+ $scope.availableAttributes.push(attribute);
+ });
+
+ $scope.moveToSelected = function(attribute, fromView){
+
+ if(attribute){
+
+ if(fromView){
+ attribute = attribute[0];
+ }
+
+ if(angular.isObject(attribute)) {
+ if($scope.selectedAttributes.indexOf(attribute) === -1){
+
+ var filter = {operands: [], operand: '', values: [], value: ''};
+
+ if(attribute.valueType === 'number' || attribute.valueType === 'date'){
+ filter.operands = ['=', '>','>=', '<', '<=', '!=' ];
+ filter.operand = filter.operands[0];
+ }
+
+ else if(attribute.valueType === 'bool'){
+ filter.operands = ['One of'];
+ filter.operand = filter.operands[0];
+ filter.values = ['No', 'Yes'];
+ filter.value = filter.values[0];
+ }
+
+ else if(attribute.valueType === 'combo'){
+ filter.operands = ['One of'];
+ filter.operand = filter.operands[0];
+ filter.values = attribute.optionSet.options;
+ filter.value = filter.values[0];
+ }
+ else{
+ filter.operands = ['like', 'not_like' ];
+ filter.operand = filter.operands[0];
+ }
+
+ attribute.filters = [filter];
+ $scope.selectedAttributes.push(attribute);
+ var index = $scope.availableAttributes.indexOf(attribute);
+ $scope.availableAttributes.splice(index, 1);
+ }
+ }
+ }
+ };
+
+ $scope.moveAllToSelected = function(){
+ for(var i=0; i<$scope.availableAttributes.length;)
+ angular.forEach($scope.availableAttributes, function(attribute){
+ //$scope.selectedAttributes.push(attribute);
+ $scope.moveToSelected(attribute, false);
+ });
+
+ $scope.availableAttributes = [];
+ };
+
+ $scope.addFilter = function(attribute){
+
+ var filter = {operands: [], operand: '', values: [], value: ''};
+
+ if(attribute.valueType === 'number' || attribute.valueType === 'date'){
+ filter.operands = ['=', '>','>=', '<', '<=', '!=' ];
+ filter.operand = filter.operands[0];
+ }
+
+ else if(attribute.valueType === 'bool'){
+ filter.operands = ['One of'];
+ filter.operand = filter.operands[0];
+ filter.values = ['No', 'Yes'];
+ filter.value = filter.values[0];
+ }
+
+ else if(attribute.valueType === 'combo'){
+ filter.operands = ['One of'];
+ filter.operand = filter.operands[0];
+ filter.values = attribute.optionSet.options;
+ filter.value = filter.values[0];
+ }
+ else{
+ filter.operands = ['like', 'not_like' ];
+ filter.operand = filter.operands[0];
+ }
+
+ attribute.filters.push(filter);
+
+ //console.log('I am going to add filter for dataElement: ', dataElement);
+ };
+
+ $scope.removeFilter = function(filter, attribute){
+
+ var index = attribute.filters.indexOf(filter);
+ attribute.filters.splice(index, 1);
+
+ console.log();
+ if(attribute.filters.length === 0 || angular.isUndefined(attribute.filters.length)){
+ index = $scope.selectedAttributes.indexOf(attribute);
+ $scope.selectedAttributes.splice(index, 1);
+ $scope.availableAttributes.push(attribute);
+ }
+
+ };
+
+ $scope.showAdvancedSearch = function(){
+ $scope.showAdvancedSearchDiv = !$scope.showAdvancedSearchDiv;
+ };
+
+ $scope.hideAdvancedSearch = function(){
+ $scope.showAdvancedSearchDiv = false;
+ };
+
+ $scope.closeAdvancedSearch = function(){
+ $scope.showAdvancedSearchDiv = !$scope.showAdvancedSearchDiv;
+ };
+
+ $scope.search = function(){
+ console.log($scope.attributes);
+ };
+
+})
+
//Controller for dashboard
.controller('DashboardController',
function($rootScope,
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-04-04 11:55:55 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-04-07 11:43:43 +0000
@@ -389,6 +389,11 @@
margin: 0;
}
+.big-button {
+ padding-left: 40px;
+ padding-right: 40px;
+}
+
.max-column-width {
max-width:200px !important;
word-wrap:break-word;
@@ -418,6 +423,11 @@
border-top: none;
background-color: #ebf0f6;
}
+.dhis2-table-striped-border {
+ width: 100%;
+ border-collapse: collapse;
+ cursor: pointer;
+}
.dhis2-table-striped-border tr th {
border: 1px solid #cad5e5;
@@ -437,8 +447,7 @@
.dhis2-table-striped>thead>tr,
.dhis2-table-striped>tbody>tr,
.dhis2-table-striped>tfoot>tr {
- border-bottom: 1px solid #cad5e5;
- //border: none;
+ border-bottom: 1px solid #cad5e5;
}
.dhis2-table-striped > tbody > tr:nth-child(odd)> td, .dhis2-table-striped > tbody > tr:nth-child(odd)> th {
@@ -549,7 +558,8 @@
}
.vertial-spacing {
- margin-top: 10px;
+ margin-top: 20px;
+ margin-bottom: 20px;
}
/*----------------------------------------------------------------------------*/
@@ -675,13 +685,96 @@
}
}
-.form-control {
+/*.form-control {
height: 30px;
font-size: 12px;
color: #555;
-}
+}*/
input[type=number] {
border: 1px solid #aaa;
padding: 4px 1px;
+}
+
+/*----------------------------------------------------------------------------*/
+/* Search filters
+/*----------------------------------------------------------------------------*/
+
+.panel-heading {
+ padding: 5px 10px;
+}
+
+.panel {
+ margin-top: 2px;
+}
+
+.selected-data-item-list {
+ width: 100%;
+ display: inline-block;
+ color: #000;
+ margin: 0;
+ padding: 0;
+ text-decoration: none;
+ overflow-y: auto;
+ white-space: nowrap;
+ word-wrap: break-word;
+ font-size: 14px;
+ color: #555;
+}
+
+.selected-data-item {
+ margin: 5px;
+ display: block;
+ white-space: nowrap;
+ word-wrap: break-word;
+}
+
+.dataelement-filter{
+ width: 100%;
+ display: block;
+}
+
+.filter-nameĀ {
+ color: red;
+}
+
+.filter-operand {
+ width: 20%;
+ float: left;
+}
+
+.filter-value {
+ width: 70%;
+ float: left;
+}
+
+.filter-add {
+ width: 5%;
+ float: left;
+ padding-top: 5px;
+ padding-left: 5px;
+}
+.filter-remove {
+ width: 5%;
+ float: left;
+ padding-top: 5px;
+ padding-left: 5px;
+}
+
+.input-field {
+ border: 1px solid #aaa;
+ padding: 4px 1px;
+ display: block;
+ width: 100%;
+ color: #555;
+ vertical-align: middle;
+ background-color: #fff;
+ background-image: none;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+ -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
+
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html 2014-03-17 15:59:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html 2014-04-07 11:43:43 +0000
@@ -1,48 +1,184 @@
-
-
-
-
-
-
- {{attribute.name}}
-
-
-
-
+ {{attribute.name}} + | +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
{{'org_unit_mode'| translate}} | +
+ {{'use_selected'| translate}} + {{'use_immediate_children'| translate}} + {{'use_all_children'| translate}} + |
+
{{'registering_unit'| translate}} | -- | - - | -- - | -- - | -
- - - - | -
- {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}} -
-- {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}} -
-+ {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}} +
++ {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}} +
+