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.mootools');
10
$document = JFactory :: getDocument();
11
$application = JFactory :: getApplication();
12
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'components/com_openaire/css/tooltip/tooltip1.css'));
13
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'templates/' . $application -> getTemplate() . '/styles/openaire/css/claims.css'));
14
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'templates/' . $application -> getTemplate() . '/styles/openaire/css/custom.css'));
15
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'templates/' . $application -> getTemplate() . '/styles/openaire/css/tooltip.css'));
16
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/claim2.js'));
17
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/tooltip.js'));
18
JView :: loadHelper('ProjectHelper');
19
JView :: loadHelper('PagingHelper');
20
JView :: loadHelper('PublicationHelper');
21
JView :: loadHelper('DatasetHelper');
22
if ($this -> complete){?>
23
<div class="claims">
24
    <h2 class="title"><?php echo(JText :: _('LINK_RESEARCH_RESULTS')); ?></h2>
25
    <?php if ($this -> error==="0"||$this -> error==="false"){?>
26
   <p>An error occured. Please try again.The popup will close automatically in 5 seconds</p>
27
    
28
<?php }else{?>
29
	<p>Successfully submitted data. The popup will close automatically in 5 seconds</p>
30
	<?php }?>
31
</div>
32
<script type="text/javascript">
33
    window.addEvent('domready', function () {
34
        setTimeout(function(){window.parent.SqueezeBox.close();}, 5000);
35
    });
36
</script>
37
<?php }
38
else{	 
39
?>
40

    
41
<input type="hidden" id="newPublication" value="<?php echo($this -> newPublication ? 'true' : 'false'); ?>" />
42
<div class="claims">
43
	<h2 class="title"><?php echo(JText :: _('LINK_RESEARCH_RESULTS')); ?></h2>
44
	<!--<div class="claimNavigationBlock">
45
		<ul>
46
			<li class="step step-1">
47
				<a class="completedState" href="<?php echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claim1&Itemid=' . $this -> itemId)); ?>" ><strong>1</strong><?php echo(JText :: _('IDENTIFY_PROJECT')); ?></a>
48
			</li>
49
			<li class="step step-2">
50
				<a class="activeState"><strong>2</strong><?php echo(JText :: _('SELECT_PUBLICATIONS_DATASETS')); ?></a>
51
			</li>
52
			<li class="step step-3">
53
				<a><strong>3</strong><?php echo(JText :: _('SET_ACCESS_RIGHTS')); ?></a>
54
			</li>
55
		</ul>
56
	</div>-->
57
	<div class="claimBox">
58
		<div class="claimStep2">
59
			<div class="shoppingCart">
60
				<a id="selected"><span><?php echo(count($this -> selectedPublications)); ?></span>&nbsp;<?php echo(JText :: _('ITEMS')); ?></a>
61
				<div style="display: none;">
62
					<div id="projectsPublications">
63
						<div class="flowWrapper">
64
							<h3><?php echo(JText :: _('SELECTED_PUBLICATIONS_DATASETS')); ?></h3>
65
							<?php if ($this -> selectedPublications === NULL) { ?>
66
								<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_SELECTED_PUBLICATIONS_DATASETS')); ?></div>
67
							<?php } else if ($this -> selectedPublications == NULL) { ?>
68
								<div class="box-info"><?php echo(JText :: _('NO_SELECTED_PUBLICATIONS_OR_DATASETS_USE_THE_FORM_BELOW_TO_LOCATE_AND_SELECT_PUBLICATIONS_DATASETS_')); ?></div>
69
							<?php } else {
70
								foreach ($this -> selectedPublications as $publication) { ?>
71
									<div class="publication">
72
										<p><span>[<a href="<?php echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&isDataset='.$this -> linkType.'&sourceType='.$this -> sourceType.'&activePublicationId=' . $this -> publicationId . '&Itemid=' . $this -> itemId . '&action=' . OpenAireViewClaim2 :: REMOVE_PUBLICATION . '&publicationSource=' . $publication -> source . '&publicationId=' . $publication -> id . '&source=' . $this -> source . (($this -> keyword == NULL) ? '' : ('&keyword=' . $this -> keyword)) . '&page=' . $this -> page)); ?>"><span style="color: #800517;">x</span></a>]</span>&nbsp;<span class="title"><?php echo((strlen($publication -> title) > OpenAireViewClaim2 :: MAX_TITLE) ? (substr($publication -> title, 0, OpenAireViewClaim2 :: MAX_TITLE - strlen('...')) . '...') : $publication -> title); ?></span></p>
73
									</div>
74
								<?php }
75
							} ?>
76
						</div> 
77
					</div>
78
				</div>
79
			</div>
80
			<div class="flowWrapper">
81
				<form id="identifyForm" method="get" action="<?php echo(JRoute :: _(JURI :: base() . 'index.php')); ?>">	
82
					<input type="hidden" name="tmpl" value="modal" />
83
					<input type="hidden" name="option" value="com_openaire" />
84
					<input type="hidden" name="view" value="claiminline2" />
85
                    <input type="hidden" name="activePublicationId" value="<?php echo($this -> publicationId); ?>" />
86
					<input type="hidden" name="Itemid" value="<?php echo($this -> itemId); ?>" />
87
					<input type="hidden" name="page" value="1" />
88
					<input type="hidden" name="isDataset" value="<?php echo($this -> linkType); ?>" />
89
					<input type="hidden" name="sourceType" value="<?php echo($this -> sourceType); ?>" />
90
					<input type="hidden" id="<?php echo(OpenAireViewClaim2 :: OPENAIRE); ?>" value="<?php echo(JText :: _('ENTER_SEARCH_TERM_')); ?>" />
91
					<input type="hidden" id="<?php echo(OpenAireViewClaim2 :: DOI); ?>" value="<?php echo(JText :: _('ENTER_PUBLICATION_DOI_EG_10_1037_0003_066X_59_1_29_')); ?>" />
92
					<input type="hidden" id="<?php echo(OpenAireViewClaim2 :: ORCID); ?>" value="<?php echo(JText :: _('ENTER_ORCID_EG_0000_0002_5914_6747_')); ?>" />
93
					<input type="hidden" id="<?php echo(OpenAireViewClaim2 :: DATACITE); ?>" value="<?php echo(JText :: _('ENTER_DATASET_DOI_EG_10_1594_PANGAEA_484677_')); ?>" />
94
					<div class="selectBox">
95
						<div class="instructions"><?php echo(JText :: _('SELECT_ONE_OF_THE_FOLLOWING_METHODS_TO_IMPORT_PUBLICATIONS_DATASETS')); ?></div>
96
						<div class="sourceHolder srchNavText" id="sourceHolder">
97
 							<?php
98
							if($this ->linkType!=null && $this ->linkType==="false"){
99
							?>
100
								<select name="source">
101
									<option value="<?php echo(OpenAireViewClaim2 :: OPENAIRE); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: OPENAIRE) ? ' selected' : ''); ?>><?php echo(JText :: _('OPENAIRE_PUBLICATIONS')); ?></option>
102
									<option value="<?php echo(OpenAireViewClaim2 :: DOI); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: DOI) ? ' selected' : ''); ?>><?php echo(JText :: _('PUBLICATION_DOI_RESOLVED_VIA_CROSSREF_')); ?></option>
103
									<option value="<?php echo(OpenAireViewClaim2 :: ORCID); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: ORCID) ? ' selected' : ''); ?>><?php echo(JText :: _('ORCID_RESOLVED_VIA_ORCID_')); ?></option>
104
 								</select>
105
							<?php	
106
							}else if($this ->linkType!=null &&  $this ->linkType==="true"){
107
							?>
108
								<select name="source">
109
									<!--<option value="<?php echo(OpenAireViewClaim2 :: ORCID); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: ORCID) ? ' selected' : ''); ?>><?php echo(JText :: _('ORCID_RESOLVED_VIA_ORCID_')); ?></option>-->
110
									<option value="<?php echo(OpenAireViewClaim2 :: DATACITE); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: DATACITE) ? ' selected' : ''); ?>><?php echo(JText :: _('DATASET_DOI_RESOLVED_VIA_DATACITE_')); ?></option>
111
								</select>
112
							<?php
113
							}else{
114
							?>
115
								<select name="source">
116
									<option value="<?php echo(OpenAireViewClaim2 :: OPENAIRE); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: OPENAIRE) ? ' selected' : ''); ?>><?php echo(JText :: _('OPENAIRE_PUBLICATIONS')); ?></option>
117
									<option value="<?php echo(OpenAireViewClaim2 :: DOI); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: DOI) ? ' selected' : ''); ?>><?php echo(JText :: _('PUBLICATION_DOI_RESOLVED_VIA_CROSSREF_')); ?></option>
118
									<option value="<?php echo(OpenAireViewClaim2 :: ORCID); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: ORCID) ? ' selected' : ''); ?>><?php echo(JText :: _('ORCID_RESOLVED_VIA_ORCID_')); ?></option>
119
									<option value="<?php echo(OpenAireViewClaim2 :: DATACITE); ?>" <?php echo(($this -> source == OpenAireViewClaim2 :: DATACITE) ? ' selected' : ''); ?>><?php echo(JText :: _('DATASET_DOI_RESOLVED_VIA_DATACITE_')); ?></option>
120
								</select>
121
							<?php
122
							}
123
							?>
124
							
125
							<input type="text" class="textsearch" name="keyword" value="<?php echo($this -> keyword); ?>" /><input type="submit" class="search-button" value="<?php echo(JText :: _('IDENTIFY')); ?>" />
126
						</div>
127
					</div>
128
				</form>
129
			</div>
130
		</div>
131
	</div>
132
	<div class="align-right">
133
		<form id="proceedForm" method="get" action="<?php echo(JRoute :: _(JURI :: base() . 'index.php')); ?>">
134
			<input type="hidden" name="option" value="com_openaire" />
135
			<input type="hidden" name="view" value="claiminline2" />
136
			<input type="hidden" name="action" value="<?php echo OpenAireViewClaimInline2 :: SUBMIT?>" />
137
			<input type="hidden" name="tmpl" value="modal" />
138
			<input type="hidden" name="Itemid" value="<?php echo($this -> itemId); ?>" />
139
			<input type="hidden" name="activePublicationId" value="<?php echo($this -> publicationId); ?>" />
140
			<input type="hidden" name="sourceType" value="<?php echo($this -> sourceType); ?>" />
141
			
142
			<!--<a href="<?php echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claim1&Itemid=' . $this -> itemId)); ?>"><input type="button" class="button-default" value="<?php echo(JText :: _('PREV')); ?>" /></a>-->
143
			<input type="submit" class="button-primary" value="<?php echo(JText :: _('PROCEED')); ?>" />
144
		</form>
145
	</div>
146
	<div id="errorMessage" class="box-warning"><?php echo(JText :: _('YOU_NEED_TO_SELECT_AT_LEAST_ONE_PUBLICATION_OR_DATASET_BEFORE_YOU_PROCEED_')); ?></div>
147
	<?php if ($this -> keyword != NULL) { ?>	
148
		<div class="availablePublications">
149
			<div class="publicationSelectedHolder" id="publicationSelectedHolder">
150
				<h3><?php echo(JText :: _('SELECT_FROM_PUBLICATIONS_DATASETS_')); ?></h3>
151
				<?php if ($this -> result == NULL) { ?>
152
					<div class="error"><?php echo(JText :: _('ERROR_PERFORMING_SEARCH')); ?></div>
153
				<?php } else if (isset($this -> result -> totalPublications) && ($this -> result -> totalPublications == 0)) { ?>
154
					<div class="box-info"><?php echo(JText :: _('NO_PUBLICATIONS_FOUND')); ?></div>
155
				<?php } else if (isset($this -> result -> totalDatasets) && ($this -> result -> totalDatasets == 0)) { ?>
156
					<div class="box-info"><?php echo(JText :: _('NO_DATASETS_FOUND')); ?></div>
157
				<?php } else { ?>
158
					<div class="pageController">
159
						<?php JText :: printf('N_DOCUMENTS_PAGE_N_OF_N', isset($this -> result -> totalPublications) ? $this -> result -> totalPublications : $this -> result -> totalDatasets, $this -> page, $this -> totalPages);
160
						$baseUrl = 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&isDataset='.$this -> linkType.'&sourceType='.$this -> sourceType.'&activePublicationId=' . $this -> publicationId . '&Itemid=' . $this -> itemId . '&source=' . urlencode($this -> source) . '&keyword=' . urlencode($this -> keyword) . '&size=' . urlencode($this -> size) . '&page=';
161
						echo(PagingHelper :: formatPaging($this -> page, $this -> totalPages, $this -> pagingStart, $this -> pagingEnd, $baseUrl, '')); ?>
162
					</div>
163
					<div class="claimSearchResults">
164
						<?php if (isset($this -> result -> publications)) {
165
							foreach ($this -> result -> publications as $publication) { ?>
166
								<a href="<?php echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&isDataset='.$this -> linkType.'&sourceType='.$this -> sourceType.'&activePublicationId=' . $this -> publicationId . '&Itemid=' . $this -> itemId . '&action=' . OpenAireViewClaim2 :: ADD_PUBLICATION . '&publicationId=' . $publication -> id . '&source=' . $this -> source . '&keyword=' . $this -> keyword . '&page=' . $this -> page)); ?>" class="selectPublication"><button type="button" class="button-primary"><?php echo(JText :: _('SELECT')); ?></button></a>
167
								<?php echo(PublicationHelper :: formatPublication($publication, $this -> itemId));
168
							}
169
						} else if (isset($this -> result -> datasets)) {
170
							foreach ($this -> result -> datasets as $dataset) { ?>
171
								<a href="<?php echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&isDataset='.$this -> linkType.'&sourceType='.$this -> sourceType.'&activePublicationId=' . $this -> publicationId . '&Itemid=' . $this -> itemId . '&action=' . OpenAireViewClaim2 :: ADD_PUBLICATION . '&publicationId=' . $dataset -> id . '&source=' . $this -> source . '&keyword=' . $this -> keyword . '&page=' . $this -> page)); ?>" class="selectPublication"><button type="button" class="button-primary"><?php echo(JText :: _('SELECT')); ?></button></a>
172
								<?php echo(DatasetHelper :: formatDataset($dataset, $this -> itemId));
173
							}
174
						} ?>
175
					</div>
176
					<div class="pageController">
177
						<?php echo(PagingHelper :: formatPaging($this -> page, $this -> totalPages, $this -> pagingStart, $this -> pagingEnd, $baseUrl, '')); ?>
178
					</div>
179
				<?php } ?>
180
			</div>
181
		</div>
182
	<?php } ?>
183
</div>
184

    
185
<?php }?>
(1-1/2)