Project

General

Profile

1
<?php
2
defined('_JEXEC') or die('Access denied');
3

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

    
8
JHtml :: _('behavior.mootools');
9
$document = JFactory :: getDocument();
10
$application = JFactory :: getApplication();
11
JView :: loadHelper('ProjectHelper');
12
JView :: loadHelper('PagingHelper');
13
JView :: loadHelper('PublicationHelper');
14
JView :: loadHelper('DatasetHelper');
15
if (isset($this->formatCart) && $this->formatCart === 'true') {
16
    ?>
17
    <input type="hidden" id="showCartTooltip" value="<?php echo($this->showCartTooltip ? 'true' : 'false'); ?>" />
18
    <span class="shoppingIcon"></span>
19
    <a id="selected">
20
        <span><?php echo(count($this->selectedPublications)); ?></span>&nbsp;
21
        <?php
22
        if ($this->claiminline === 'false') {
23
            echo(JText :: _('ITEMS_IN'));
24
            ?>&nbsp;<span><?php echo(count($this->selectedProjects)); ?></span>&nbsp;<?php echo(JText :: _('PROJECTS')); ?>&nbsp;<?php echo(JText :: _('AND')); ?>&nbsp;<span><?php echo(count($this->selectedConcepts)); ?></span>&nbsp;<?php
25
            echo(JText :: _('CONCEPTS'));
26
        } else {
27
            echo(JText :: _('ITEMS'));
28
        }
29
        ?>
30
    </a>
31
    <div style="display: none;">
32

    
33
        <div id="projectsPublications">
34
            <div class="flowWrapper">
35
                <?php if ($this->selectedProjects != NULL) { ?>
36
                    <h3> <?php echo(JText :: _('SELECTED_PROJECTS')); ?></h3>
37
                    <?php foreach ($this->selectedProjects as $project) { ?>
38
                        <div class="project">
39
                            <p><span>[<a onclick="addPublication('<?php
40
                                    echo(JRoute :: _('index.php?option=com_openaire&view=claim2raw&format=raw&Itemid=' . $this->itemId . '&action=' . OpenAireViewClaim2 :: REMOVE_PROJECT . '&projectId=' . $project->id . '&showCartTooltip=true&source=' . $this->source . (($this->keyword == NULL) ? '' : ('&keyword=' . $this->keyword))) .
41
                                    '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&sourceType=' . $this->sourceType . '&activeId=' . $this->activeId );
42
                                    ?>');"><span style="color: #800517;">x</span></a>]</span>&nbsp;<?php echo ProjectHelper::formatFunder($project->funder) ?>&nbsp;>&nbsp;<span class="acronym"><?php echo(($project->acronym == NULL) ? ((strlen($project->title) > OpenAireViewClaim2 :: MAX_TITLE) ? (substr($project->title, 0, OpenAireViewClaim2 :: MAX_TITLE - strlen('...')) . '...') : $project->title) : $project->acronym); ?></span></p>
43
                        </div>
44
                        <?php
45
                    }
46
                }
47
                ?>
48
            </div>
49
            <div class="flowWrapper">
50
                <?php if ($this->selectedConcepts != NULL) { ?>
51
                    <h3> <?php echo(JText :: _('SELECTED_CONCEPTS')); ?></h3>
52
                    <?php foreach ($this->selectedConcepts as $concept) { ?>
53
                        <div class="concept">
54
                            <p><span>[<a onclick="addPublication('<?php
55
                                    echo(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claim2raw&format=raw&Itemid=' . $this->itemId . '&action=' . OpenAireViewClaim2 :: REMOVE_CONCEPT . '&conceptId=' . $concept->id . '&showCartTooltip=true&source=' . $this->source . (($this->keyword == NULL) ? '' : ('&keyword=' . $this->keyword)))
56
                                    . '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&sourceType=' . $this->sourceType . '&activeId=' . $this->activeId );
57
                                    ?>');"><span style="color: #800517;">x</span></a>]</span>&nbsp<?php echo $concept->path ?></p>
58
                        </div>
59
                        <?php
60
                    }
61
                }
62
                ?>
63
            </div>
64
            <div class="flowWrapper">
65
                <h3><?php echo(JText :: _('SELECTED_PUBLICATIONS_DATASETS')); ?></h3>
66
                <?php if ($this->selectedPublications === NULL) { ?>
67
                    <div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_SELECTED_PUBLICATIONS_DATASETS')); ?></div>
68
                <?php } else if ($this->selectedPublications == NULL) { ?>
69
                    <div class="box-info"><?php echo(JText :: _('NO_SELECTED_PUBLICATIONS_OR_DATASETS_USE_THE_FORM_BELOW_TO_LOCATE_AND_SELECT_PUBLICATIONS_DATASETS_')); ?></div>
70
                    <?php
71
                } else {
72
                    foreach ($this->selectedPublications as $publication) {
73
                        ?>
74
                        <div class="publication">
75
                            <p><span>[<a onclick="addPublication('<?php
76
                                    echo(JRoute :: _('index.php?option=com_openaire&view=claim2raw&format=raw&Itemid=' . $this->itemId . '&action=' .
77
                                            OpenAireViewClaim2 :: REMOVE_PUBLICATION . '&showCartTooltip=true&publicationSource=' . $publication->source . '&publicationId='
78
                                            . $publication->id . '&source=' . $this->source . (($this->keyword == NULL) ? '' : ('&keyword=' . $this->keyword)))
79
                                    . '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&sourceType=' . $this->sourceType . '&activeId=' . $this->activeId . '&size=' . $this->size);
80
                                    ?>');"><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>
81
                        </div>
82
                        <?php
83
                    }
84
                }
85
                ?>
86
            </div> 
87
        </div>
88
    </div>
89
    </div>
90
    <?php
91
} else {
92
    if (isset($this->results->alternativeAuthors)) {
93
        ?>
94
        <div id="orcidAuthorResultsInner">
95
            <span ><?php JText :: printf('SEARCH_ALTERNATIVE_AUTHOR'); ?>							
96
            </span>												  			
97
           <!-- <div id="moreAuthors" class="more moreAuthors">	-->
98
                <select id="authorsSelect" onchange="authorsChangeFunction()">
99
                    <?php
100
                    foreach ($this->results->alternativeAuthors as $author) {
101
                        $text = (($author->firstName != null) ? $author->firstName . ' ' : ' ') . (($author->lastName != null) ? $author->lastName . ' ' : ' ') . " - " . $author->id;
102
                        $baseUrl = "index.php?&option=com_openaire&view=claim2raw&format=raw&keyword=" . $author->id . "&source=" . $this->source . "&size=" . $this->size . "&page=1"
103
                                . '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&sourceType=' . $this->sourceType . '&activeId=' . $this->activeId;
104
                        echo('<option value="'.$baseUrl.'">'.$text);
105
                    }
106
                    ?>
107
                    
108
                </select>
109
                <?php
110
               /* $authorsLink = array();
111
                foreach ($this->results->alternativeAuthors as $author) {
112
                    $baseUrl = "index.php?&option=com_openaire&view=claim2raw&format=raw&keyword=" . $author->id . "&source=" . $this->source . "&size=" . $this->size . "&page=1"
113
                            . '&claiminline=' . $this->claiminline . '&targetType=' . $this->targetType . '&sourceType=' . $this->sourceType . '&activeId=' . $this->activeId;
114
                    $text = (($author->firstName != null) ? $author->firstName . ' ' : ' ') . (($author->lastName != null) ? $author->lastName . ' ' : ' ') . " - " . $author->id;
115
                    $authorsLink[] = '<a onclick="gotoPage(\'' . $baseUrl . '\',\'1\',\'' . ($this->source) . '\',\' \');" >' . $text . '</a>';
116
                }
117
                echo(implode(', ', $authorsLink));
118
                */?>
119
           <!-- </div>-->
120
        </div>
121

    
122
        <?php
123
    }
124
    format_results($this->results, $this->itemId, $this->pagesFormat->page, $this->pagesFormat->totalPages, $this->pagesFormat->pagingStart, $this->pagesFormat->pagingEnd, $this->source, $this->keyword, $this->size, $this->claiminline, $this->targetType, $this->sourceType, $this->activeId);
125
}
126

    
127
function format_results($result, $itemId, $page, $totalPages, $pagingStart, $pagingEnd, $source, $keyword, $size, $claiminline, $targetType, $sourceType, $activeId) {
128
    ?>
129
    <div class="availablePublications">
130
        <input type="hidden" id="<?php echo($source); ?>ResultsNumber"  value=" (<?php echo(isset($result->publications) ? $result->totalPublications : $result->totalDatasets); ?>)"/>
131
        <div class="publicationSelectedHolder" id="publicationSelectedHolder">
132
            <?php if (isset($result->author) && isset($result->author->firstName) && isset($result->author->lastName)) {
133
                ?>
134
                <div class="authorResults">
135
                    <span class=""><?php JText :: printf('RESULTS_FOR_AUTHOR', (($result->author->firstName != null) ? $result->author->firstName . ' ' : ' ') . (($result->author->lastName != null) ? $result->author->lastName . ' ' : ' '), $result->author->id); ?>							
136
                    </span>          
137
                    <?php
138
                }
139
                ?>
140
                <h3><?php echo(JText :: _('SELECT_FROM_PUBLICATIONS_DATASETS_')); ?></h3>
141
                <?php if ($result == NULL) { ?>
142
                    <div class="error"><?php echo(JText :: _('ERROR_PERFORMING_SEARCH')); ?></div>
143
                    <?php
144
                } else if(isset($result->maxDoisExceeded) && $result->maxDoisExceeded===true){
145
                    ?>
146
                    <div class="box-hint"><?php echo(JText :: _('MAX_DOIS_SEARCH_LIMIT_EXCEEDED')); ?></div>
147
                    <?php
148
                } else if (isset($result->publications) && ($result->totalPublications == 0)) {
149
                    ?>
150
                    <div class="box-info"><?php echo(JText :: _('NO_PUBLICATIONS_FOUND')); ?></div>
151
                    <?php
152
                } else if (isset($result->datasets) && ($result->totalDatasets == 0)) {
153
                    ?>
154
                    <div class="box-info"><?php echo(JText :: _('NO_DATASETS_FOUND')); ?></div>
155
                    <?php
156
                } else if (!isset($result->datasets) && !isset($result->publications)) {
157
                    ?>
158
                    <div class="box-info"><?php echo(JText :: _('NO_RESULTS_FOUND')); ?></div>
159
                    <?php
160
                } else {
161
                    ?>
162
                    
163
                    <div class="pageController">
164
                        <?php
165
                        JText :: printf('N_DOCUMENTS_PAGE_N_OF_N', isset($result->publications) ? $result->totalPublications : $result->totalDatasets, $page, $totalPages);
166
                        $baseUrl = "index.php?&option=com_openaire&view=claim2raw&format=raw&keyword=" . $keyword . "&source=" . $source . "&size=" . $size
167
                                . '&claiminline=' . $claiminline . '&targetType=' . $targetType . '&sourceType=' . $sourceType . '&activeId=' . $activeId;
168
                        echo(PagingHelper :: formatPagingForAjax($page, $totalPages, $pagingStart, $pagingEnd, $baseUrl, '', $source));
169
                        ?>
170
                    </div>
171
                    <div class="claimSearchResults">
172
                        <?php
173
                        if (isset($result->publications)) {
174
                            foreach ($result->publications as $publication) {
175
                                ?>
176
                                <div class="claimresult">
177
                                    <?php echo(PublicationHelper :: formatPublication($publication, $itemId)); ?>
178
                                    <a  class="selectPublication" onclick="addPublication('<?php
179
                                        echo(JRoute :: _('index.php?option=com_openaire&view=claim2raw&format=raw&Itemid=' . $itemId . '&action=' .
180
                                                OpenAireViewClaim2 :: ADD_PUBLICATION . '&publicationId=' . $publication->id . '&source=' . $source . '&keyword=' .
181
                                                $keyword . '&page=' . $page . '&showCartTooltip=true' . "&size=" . $size
182
                                                . '&claiminline=' . $claiminline . '&targetType=' . $targetType . '&sourceType=' . $sourceType . '&activeId=' . $activeId));
183
                                        ?>');">
184
                                        
185
                                        <div  class="claimAdd">
186
                                            <?php echo(JText :: _('SELECT')); ?>
187
                                        </div>
188
                                         <img class="claimAddImg" src="./components/com_openaire/images/img_go.jpeg" >                                        
189
                                    </a>
190
                                </div>
191

    
192
                                <?php
193
                            }
194
                        } else if (isset($result->datasets)) {
195
                            foreach ($result->datasets as $dataset) {
196
                                ?>
197
                                <a class="selectPublication" onclick="addPublication('<?php
198
                                    echo(JRoute :: _('index.php?option=com_openaire&view=claim2raw&format=raw&Itemid=' .
199
                                            $itemId . '&action=' . OpenAireViewClaim2 :: ADD_PUBLICATION . '&publicationId=' . $dataset->id . '&source=' .
200
                                            $source . '&keyword=' . $keyword . '&page=' . $page . '&showCartTooltip=true' . "&size=" . $size
201
                                            . '&claiminline=' . $claiminline . '&targetType=' . $targetType . '&sourceType=' . $sourceType . '&activeId=' . $activeId));
202
                                    ?>');">
203
                                    <!--<button type="button" class="button-primary"  ><?php echo(JText :: _('SELECT')); ?></button>-->
204
                                        <div  class="claimAdd">
205
                                            <?php echo(JText :: _('SELECT')); ?>
206
                                        </div>
207
                                         <img class="claimAddImg" src="./components/com_openaire/images/img_go.jpeg" >                                    
208
                                </a>
209
                                    <?php
210
                                    echo(DatasetHelper :: formatDataset($dataset, $itemId));
211
                                }
212
                            }
213
                            ?>
214
                    </div>
215
                    <div class="pageController">
216
                        <?php echo(PagingHelper :: formatPagingForAjax($page, $totalPages, $pagingStart, $pagingEnd, $baseUrl, '', $source)); ?>
217
                    </div>
218
                <?php } ?>
219
            </div>
220
        </div> 
221
        <?php
222
    }
223
    ?>
224

    
225

    
226

    
227

    
(1-1/2)