Project

General

Profile

1
<?php
2

    
3
defined('_JEXEC') or die('Access denied');
4

    
5
jimport('joomla.environment.uri');
6
jimport('joomla.html.html');
7
jimport('joomla.methods');
8

    
9
JHtml :: _('behavior.framework',true);
10
JViewLegacy:: loadHelper('PublicationHelper');
11
JViewLegacy:: loadHelper('DatasetHelper');
12

    
13
$document = JFactory :: getDocument();
14
$document -> addScript(JRoute :: _(JUri :: base() . 'components/com_openaire/js/datasource.js'));
15
$document -> addScript(JRoute :: _(JUri :: base() . 'components/com_openaire/js/tabcontent.js'));
16
$document -> addStyleSheet(JRoute :: _(JUri :: base() . 'components/com_openaire/css/tabcontent.css'));
17
 
18
?>
19
<!-- Go to www.addthis.com/dashboard to customize your tools -->
20
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-55a0e50aaa63d56f" async="async"></script>
21

    
22

    
23
<div class="uk-grid" >
24
   <div class="uk-width-7-10">
25
        
26
	<?php if (($this -> datasourceId == NULL) || ($this -> datasource == NULL) || (($this -> datasource -> englishName == NULL) && ($this -> datasource -> name == NULL))) { ?>
27
		<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_DATASOURCE')); ?></div>
28
	<?php } else {
29
		switch ($this -> datasource -> compatibility) {
30
		case OpenAireViewDatasource :: OPENAIRE:
31
			$compatibilityClass = 'openaireCompatible';
32
			break;
33
		case OpenAireViewDatasource :: DRIVER:
34
			$compatibilityClass = 'driverCompatible';
35
			break;
36
		case OpenAireViewDatasource :: DRIVER_OPENAIRE:
37
			$compatibilityClass = 'driverOpenaireCompatible';
38
			break;
39
		case OpenAireViewDatasource :: NON_COMPATIBLE:
40
			$compatibilityClass = 'nonCompatible';
41
			break;
42
		default:
43
			$compatibilityClass = NULL;
44
		} ?>
45
                
46
		<div class="dataSourceBox">
47
			<div class="datasourceIcon">
48
			<h3<?php echo(($compatibilityClass == NULL) ? '' : (' class="' . $compatibilityClass . '" title="' . $this -> datasource -> compatibility . '"')); ?>><?php echo((($this -> datasource -> url == NULL) ? '' : ('<a target="_blank" class="custom-external" href="' . $this -> datasource -> url . '">')) . (($this -> datasource -> englishName == NULL) ? $this -> datasource -> name : $this -> datasource -> englishName) . (($this -> datasource -> url == NULL) ? '' : '</a>')); ?></h3>
49
			</div>
50
			<?php if ($this -> datasource -> logo != NULL) { ?>
51
				<img class="datasourceLogo" src="<?php echo($this -> datasource -> logo); ?>" />
52
			<?php } ?>
53
			<dl class="uk-description-list-horizontal">
54
				<dt width="25%"><?php echo(JText :: _('NAME')); ?></dt>
55
				
56
				
57
				<dd><?php echo(($this -> datasource -> name == NULL) ? '-' : $this -> datasource -> name); ?></dd>
58
				<dt><?php echo(JText :: _('TYPE')); ?></dt>
59
				<dd><?php echo(($this -> datasource -> type == NULL) ? '-' : $this -> datasource -> type); ?></dd>
60
				<dt><?php echo(JText :: _('ITEMS')); ?></dt>
61
				<dd><?php 
62
                                        $data = '';
63
                                        $publications = '';
64
                                        if($this -> datasets !== NULL && $this -> datasets -> totalDatasets>0)
65
                                            $data = 'Data: <a class="viewall" href="'.JRoute :: _('index.php?option=com_openaire&view=browsedatasets&Itemid=' . $this -> itemId . '&datasource=' . $this -> datasourceId). '">'.$this -> datasets -> totalDatasets.'</a>';
66
                                        if($this -> publications !== NULL && $this -> publications -> totalPublications>0)
67
                                            $publications = 'Publications: <a class="viewall" href="'.JRoute :: _('index.php?option=com_openaire&view=browsepublications&Itemid=' . $this -> itemId . '&datasource=' . $this -> datasourceId). '">'.$this -> publications -> totalPublications.'</a>';
68
                                        echo(($data==='' &&$publications === '')?'-':(($data!=='' &&$publications !== '')?$publications.' / '.$data:$publications.''.$data)); ?></dd>
69
                                
70
                                <!--<dd><?php echo(($this -> datasource -> items == NULL) ? '-' : ($this -> datasource -> items . (($this -> datasource -> date == NULL) ? '' : ('&nbsp;(' . date(JText :: _('DATE_FORMAT'), $this -> datasource -> date) . ')')))); ?></dd>-->				<!--<dt><?php echo(JText :: _('SUBJECTS')); ?></dt>
71
				<dd><?php echo(($this -> datasource -> subjects == NULL) ? '-' : $this -> datasource -> subjects); ?></dd>
72
				<dt><?php echo(JText :: _('LANGUAGES')); ?></dt>
73
				<dd><?php echo(($this -> datasource -> languages == NULL) ? '-' : $this -> datasource -> languages); ?></dd>
74
				<dt><?php echo(JText :: _('CONTENTS')); ?></dt>
75
				<dd><?php echo(($this -> datasource -> contents == NULL) ? '-' : $this -> datasource -> contents); ?></dd>
76
				<dt><?php echo(JText :: _('POLICIES')); ?></dt>
77
				<dd><?php echo(($this -> datasource -> policies == NULL) ? '-' : $this -> datasource -> policies); ?></dd>-->
78
				<dt><?php echo(JText :: _('COMPATIBILITY')); ?></dt>
79
				<dd><?php echo(($this -> datasource -> compatibility == NULL) ? '-' : $this -> datasource -> compatibility); ?></dd>
80
				<dt><?php echo(JText :: _('OAI_PMH')); ?></dt>
81
				<dd><?php echo(($this -> datasource -> oaiPmh == NULL) ? '-' : ('<a target="_blank" href="' . $this -> datasource -> oaiPmh . '">' . $this -> datasource -> oaiPmh . '</a>')); ?></dd>
82
			</dl>
83
			<p><?php echo($this -> datasource -> description); ?></p>
84
		</div>
85
		<p>&nbsp;</p>
86
		<div>
87
				<ul class="uk-tab"  data-uk-tab="{connect:'#tab-content'}"  > 
88
					<li class="uk-active"><a rel="pubs"><?php echo(JText :: _('PUBLICATIONS')); ?></a></li>
89
					<li><a rel="data"><?php echo(JText :: _('DATA')); ?></a></li>
90
					<li><a rel="stats"><?php echo(JText :: _('STATISTICS')); ?></a></li>
91
				</ul>
92
                            <ul id="tab-content" class="uk-switcher uk-margin">  
93
  				<li id="pubs" >
94
					<?php if ($this -> publications == NULL) { ?>
95
						<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_DATASOURCE_PUBLICATIONS')); ?></div>
96
					<?php } else if ($this -> publications -> publications == NULL) { ?>
97
						<div class="box-info"><?php echo(JText :: _('NO_DATASOURCE_PUBLICATIONS_FOUND')); ?></div>
98
					<?php } else {
99
						if ($this -> publications -> totalPublications > OpenAireViewDatasource :: SIZE) { ?>
100
							<div class="pageController">
101
								<a class="viewall" href="<?php echo(JRoute :: _('index.php?option=com_openaire&view=browsepublications&Itemid=' . $this -> itemId . '&datasource=' . $this -> datasourceId)); ?> "><?php JText :: printf('VIEW_ALL_N', $this -> publications -> totalPublications); ?></a>
102
							</div>
103
						<?php } ?>
104
						<div class="searchResults">
105
							<?php foreach ($this -> publications -> publications as $publication) {
106
								echo(PublicationHelper :: formatPublication($publication, $this -> itemId));
107
							} ?>
108
						</div>
109
					<?php } ?>
110
				</li>
111
  				<li id="data" class="">
112
					<?php if ($this -> datasets == NULL) { ?>
113
						<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_DATASOURCE_DATASETS')); ?></div>
114
					<?php } else if ($this -> datasets -> datasets == NULL) { ?>
115
						<div class="box-info"><?php echo(JText :: _('NO_DATASOURCE_DATASETS_FOUND')); ?></div>
116
					<?php } else {
117
						if ($this -> datasets -> totalDatasets > OpenAireViewDatasource :: SIZE) { ?>
118
							<div class="pageController">
119
								<a class="viewall" href="<?php echo(JRoute :: _('index.php?option=com_openaire&view=browsedatasets&Itemid=' . $this -> itemId . '&datasource=' . $this -> datasourceId)); ?> "><?php JText :: printf('VIEW_ALL_N', $this -> datasets -> totalDatasets); ?></a>
120
							</div>
121
						<?php } ?>
122
						<div class="searchResults">
123
							<?php foreach ($this -> datasets -> datasets as $dataset) {
124
								echo(DatasetHelper :: formatDataset($dataset, $this -> itemId));
125
							} ?>
126
						</div>
127
					<?php } ?>
128
				</li>
129
				<li id="stats" class="uk-active">	
130
				<?php
131
                                if(($this -> datasets == NULL || ($this -> datasets -> datasets == NULL ))&&($this -> publications == NULL || $this -> publications -> publications == NULL)){
132
                                    
133
                                ?>
134
                                    <div class="box-info" ><?php echo(JText :: _('NO_DATASOURCE_STATISTICS_FOUND')); ?></div>
135
                                
136
                                <?php
137
                                }else{
138

    
139
                                 ////Set charts urls for ajax calls
140
                                //TODO Eri  kane escape ta quotes sto onoma gia na mn petaei error i postgres       
141
                                    $sanitized=str_replace('\'','\'\'',$this -> datasource -> name);
142
                                 ?>
143
                                    <div id="latestPublicationsTimeline">  
144
                                        <h3><?php echo(JText :: _('Latest Publications Timeline')); ?></h3>
145

    
146
                                         <div class="loading">
147
                                             <?php echo(JText :: _('PLEASE_WAIT_CHART_IS_LOADING_')); ?>
148
                                             <img  class="loader  " src="./components/com_openaire/images/loader.gif" />
149
                                         </div>
150
                                             <?php
151
                                           // $url = $this->projectStatisticsChartUrl . 'chart.php?com=query&persistent=false&data='.urlencode('{"table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [{"f":0, "text": "'.JText ::_('YEARLY').'"}], "filters": [{"name":"year","max":"'.date("Y",strtotime("-1 year")).'","min":"'. date("Y",strtotime("-20 year")).'"},{"name": "result_datasources-datasource-name", "values":["'.$sanitized.'"], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "'.JText :: _('YEAR').'"}');
152
                                             $url = $this->projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"query":"dtsrcYear","dtsrcName":"'.$this -> datasourceId.'","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [{"f":0, "text": "'.JText ::_('YEARLY').'"}], "filters": [{"name":"year","max":"'.date("Y",strtotime("-1 year")).'","min":"'. date("Y",strtotime("-20 year")).'"},{"name": "result_datasources-datasource-name", "values":["'.$sanitized.'"], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "'.JText :: _('YEAR').'"}');
153

    
154

    
155

    
156
                                             $document->addScriptDeclaration("var latestPublicationsTimelineUrl = '" . $url . "'");
157
                                             ?>
158
                                            <div class="frame"> </div>
159
                                            <div class="ajaxframe"> </div>
160
                                     </div>	
161
                                     
162
                                       <div id="publicationsPerFunder">
163
                                        <h3><?php echo(JText :: _('PUBLICATIONS PER FUNDER')); ?></h3>
164
                                      
165
                                       <div class="loading">
166
                                             <?php echo(JText :: _('PLEASE_WAIT_CHART_IS_LOADING_')); ?>
167
                                           <img  class="loader  " src="./components/com_openaire/images/loader.gif" />
168
                                         </div>
169
                                      
170
                                         <?php
171
                                             $url = $this -> projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"query":"dtsrcPubsFund","dtsrcName":"'.$this -> datasourceId.'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "column", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": ["'.$sanitized.'"], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}');
172
                        		 $document->addScriptDeclaration("var publicationsPerFunderUrl = '" . $url . "'");
173
                                              ?>
174
                                        <div class="frame"> </div>
175
                                        <div class="ajaxframe"> </div>
176

    
177
                                    </div>                            
178
                                         
179
                                     <div id="publicationsPerProject">
180
                                        <h3><?php echo(JText :: _('TOP PROJECTS IN PUBLICATIONS')); ?></h3>
181
                                         <div class="loading">
182
                                             <?php echo(JText :: _('PLEASE_WAIT_CHART_IS_LOADING_')); ?>
183
                                             <img  class="loader  " src="./components/com_openaire/images/loader.gif" />
184
                                         </div>
185
                                         <?php
186
                                           
187
                                        $url = $this -> projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"query":"dtsrcProjPubs","dtsrcName":"'.$this -> datasourceId.'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "column", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": ["'.$sanitized.'"], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}');
188
                     $document->addScriptDeclaration("var publicationsPerProjectUrl = '" . $url . "'");
189
                                             ?>
190
                                        <div class="frame"> </div>
191
                                        <div class="ajaxframe"> </div>
192

    
193
                                    </div>                            
194
                                      <div id="dataPerProject">
195
                                        <h3><?php echo(JText :: _('TOP PROJECTS IN DATA')); ?></h3>
196
                                         <div class="loading">
197
                                             <?php echo(JText :: _('PLEASE_WAIT_CHART_IS_LOADING_')); ?>
198
                                             <img  class="loader  " src="./components/com_openaire/images/loader.gif" />
199
                                         </div>
200
                                         <?php
201
                                           
202
                                             $url = $this -> projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"query":"dtsrcProjData","dtsrcName":"'.$this -> datasourceId.'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "column", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": ["'.$sanitized.'"], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}');
203

    
204
                                             $document->addScriptDeclaration("var dataPerProjectUrl = '" . $url . "'");
205
                                             ?>
206
                                        <div class="frame"> </div>
207
                                        <div class="ajaxframe"> </div>
208

    
209
                                    </div>        
210
                                   
211
                                   
212
                                   
213
                                   
214
                                    <div id="publicationsPerDocumentType">
215
                                        <h3><?php echo(JText :: _('PUBLICATIONS PER DOCUMENT TYPE')); ?></h3>
216
                                         <div class="loading">
217
                                             <?php echo(JText :: _('PLEASE_WAIT_CHART_IS_LOADING_')); ?>
218
                                             <img  class="loader  " src="./components/com_openaire/images/loader.gif" />
219
                                         </div>
220
                                         <?php
221
                                           //  $url = $this -> projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": ["'.$sanitized.'"], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}');
222

    
223
                                             $url = $this -> projectStatisticsChartUrl.'chart.php?com=query&persistent=false&data='.urlencode('{"query":"dtsrcPubs","dtsrcName":"'.$this -> datasourceId.'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "pie", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["'.JText :: _('PUBLICATIONS').'"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": ["'.$sanitized.'"], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}');
224

    
225
                                             $document->addScriptDeclaration("var publicationsPerDocumentTypeUrl = '" . $url . "'");
226
                                             ?>
227
                                        <div class="frame"> </div>
228
                                        <div class="ajaxframe"> </div>
229

    
230
                                    </div>							 
231
                                    <?php
232
                                    }
233
                                    ?>
234
				</li>
235
			</ul>
236
		</div>
237
 
238
	<?php } ?>
239
    </div>
240
    <div class="uk-width-3-10">
241
        <div class="mainFunctionsBlock">
242
            <div class="functionsSection">
243
                <h3 class="title"><?php echo(JText :: _('SHARE_BOOKMARK')); ?></h3>
244
                <!-- Go to www.addthis.com/dashboard to customize your tools -->
245
                <div class="addthis_sharing_toolbox"></div>
246

    
247
            </div>
248
        </div>        
249
    </div>
250
</div>
251
 
(1-1/2)