Project

General

Profile

« Previous | Next » 

Revision 09f028e2

Added by Andreas Kohlbecker over 5 years ago

ref #7562 removing "Associated with" name from Specimen table

View differences:

modules/cdm_dataportal/includes/pages.inc
111 111
        }
112 112

  
113 113
        $by_associatedtaxon_query = http_build_query($associatedFieldUnitsQuery_parameters);
114
        $pagerFieldUnits = cdm_ws_get(CDM_WS_PORTAL_TAXON,
114
        $pager_field_units = cdm_ws_get(CDM_WS_PORTAL_TAXON,
115 115
            array($taxon->uuid, 'associatedFieldUnits'),
116 116
            $by_associatedtaxon_query . '&pageSize=' . variable_get('cdm_dataportal_compressed_specimen_derivate_table_page_size')
117 117
        );
118
        if (isset($pager_field_units->records[0])) {
119
          $field_unit_uuids = array();
120
          foreach ($pager_field_units->records as $field_unit) {
121
            $field_unit_uuids[] = $field_unit->uuid;
122
          }
123
        }
118 124
        // get icon images
119 125
        $expand_icon = font_awesome_icon_markup(
120 126
            'fa-plus-square-o',
......
135 141
        $sequence_icon = '<img title="Molecular Data" src="' . base_path() . drupal_get_path('module', 'cdm_dataportal') . '/images/sequence_derivate-16x16-32.png' . '"/>';
136 142
        $character_data_icon = '<img title="Character Data" src="' . base_path() . drupal_get_path('module', 'cdm_dataportal') . '/images/character_data_derivate-16x16-32.png' . '"/>';
137 143
        if (isset($pagerFieldUnits->records[0])) {
138
            $rowcount = 0;
139
            foreach ($pagerFieldUnits->records as $fieldUnit) {
140
                //get derivate hierarchy for the FieldUnit
141
                $derivateHierarchy = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, array($fieldUnit->uuid, 'derivateHierarchy'), 'taxonUuid=' . $taxon->uuid);
142
                if($derivateHierarchy){
143
                    //summary row
144
                    $rows[] = array(
145
                        'data' => array(
146
                            array(
147
                                'data' => $expand_icon . $collapse_icon,
148
                                'class' => array('summary_row_cell', 'summary_row_icon', 'expand_column')
149
                            ),
150
                            array(
151
                                'data' => $derivateHierarchy->country,
152
                                'class' => array('summary_row_cell')
153
                            ),
154
                            array(
155
                                'data' => $derivateHierarchy->date,
156
                                'class' => array('summary_row_cell')
157
                            ),
158
                            array(
159
                                'data' => $derivateHierarchy->collection,
160
                                'class' => array('summary_row_cell')
161
                            ),
162
                            array(
163
                                'data' => $derivateHierarchy->herbarium,
164
                                'class' => array('summary_row_cell')
165
                            ),
166
                            array(
167
                                'data' => $derivateHierarchy->hasType? $checked_box_icon:"",
168
                                'class' => array('summary_row_cell', 'summary_row_icon')
169
                            ),
170
                            array(
171
                                'data' => $derivateHierarchy->hasSpecimenScan? $checked_box_icon:"",
172
                                'class' => array('summary_row_cell', 'summary_row_icon')
173
                            ),
174
                            array(
175
                                'data' => ($derivateHierarchy->hasDna? $sequence_icon :"")." "
176
                                    .($derivateHierarchy->hasDetailImage?$detail_image_icon:"")." "
177
                                    .($derivateHierarchy->hasCharacterData?$character_data_icon:""),
178
                                'class' => array('summary_row_cell', 'summary_row_icon')
179
                            )
144
        $rowcount = 0;
145
        foreach ($field_unit_uuids as $field_unit_uuid) {
146
            //get derivate hierarchy for the FieldUnit
147
            $derivateHierarchy = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, array($field_unit_uuid, 'derivateHierarchy'));
148
            if($derivateHierarchy){
149
                //summary row
150
                $rows[] = array(
151
                    'data' => array(
152
                        array(
153
                            'data' => $expand_icon . $collapse_icon,
154
                            'class' => array('summary_row_cell', 'summary_row_icon', 'expand_column')
180 155
                        ),
181
                        'id' => ('derivate_summary' . $rowcount), // summary row id
182
                        'class' => array('summary_row'),
183
                    );
156
                        array(
157
                            'data' => $derivateHierarchy->country,
158
                            'class' => array('summary_row_cell')
159
                        ),
160
                        array(
161
                            'data' => $derivateHierarchy->date,
162
                            'class' => array('summary_row_cell')
163
                        ),
164
                        array(
165
                            'data' => $derivateHierarchy->collection,
166
                            'class' => array('summary_row_cell')
167
                        ),
168
                        array(
169
                            'data' => $derivateHierarchy->herbarium,
170
                            'class' => array('summary_row_cell')
171
                        ),
172
                        array(
173
                            'data' => $derivateHierarchy->hasType? $checked_box_icon:"",
174
                            'class' => array('summary_row_cell', 'summary_row_icon')
175
                        ),
176
                        array(
177
                            'data' => $derivateHierarchy->hasSpecimenScan? $checked_box_icon:"",
178
                            'class' => array('summary_row_cell', 'summary_row_icon')
179
                        ),
180
                        array(
181
                            'data' => ($derivateHierarchy->hasDna? $sequence_icon :"")." "
182
                                .($derivateHierarchy->hasDetailImage?$detail_image_icon:"")." "
183
                                .($derivateHierarchy->hasCharacterData?$character_data_icon:""),
184
                            'class' => array('summary_row_cell', 'summary_row_icon')
185
                        )
186
                    ),
187
                    'id' => ('derivate_summary' . $rowcount), // summary row id
188
                    'class' => array('summary_row'),
189
                );
184 190

  
185
                    //assemble field unit details
186
                    $detail_html = "";
187
                    // - taxon name
188
                    if (variable_get('cdm_dataportal_compressed_specimen_derivate_table_show_determined_as') && $derivateHierarchy->taxonName) {
189
                        $detail_html .= create_label("Associated with") . $derivateHierarchy->taxonName . "<br>";
190
                    }
191
                    // - protologue
192
                    if ($derivateHierarchy->protologue) {
193
                        //$detail_html .= "<strong>Protologue:</strong> " . $derivateHierarchy->protologue . "<br>"
194
                    }
195
                    // - citation
196
                    if ($derivateHierarchy->citation) {
197
                        $detail_html .= create_label("Citation") . $derivateHierarchy->citation . "<br>";
198
                    }
199
                    //assemble specimen details
200
                    if($derivateHierarchy->preservedSpecimenDTOs){
201
                        foreach($derivateHierarchy->preservedSpecimenDTOs as $preservedSpecimenDTO) {
202
                            $detail_html .= "<br>";
203
                            $detail_html .= render_cdm_specimen_page($preservedSpecimenDTO);
204
                        }
191
                //assemble field unit details
192
                $detail_html = "";
193
                // - citation
194
                if ($derivateHierarchy->citation) {
195
                    $detail_html .= create_label("Citation") . $derivateHierarchy->citation . "<br>";
196
                }
197
                //assemble specimen details
198
                if($derivateHierarchy->preservedSpecimenDTOs){
199
                    foreach($derivateHierarchy->preservedSpecimenDTOs as $preservedSpecimenDTO) {
200
                        $detail_html .= "<br>";
201
                        $detail_html .= render_cdm_specimen_page($preservedSpecimenDTO);
205 202
                    }
206
                    $detail_html .= "<br>";
207
                    //detail row resp. one BIG detail cell
208
                    $rows[] = array(
209
                        'data' => array(
210
                            array(
211
                                'data' => "", //empty first column
212
                                'class' => array('expand_column')
213
                            ),
214
                            array(
215
                                'data' => $detail_html,
216
                                'colspan' => 7,
217
                            ),
203
                }
204
                $detail_html .= "<br>";
205
                //detail row resp. one BIG detail cell
206
                $rows[] = array(
207
                    'data' => array(
208
                        array(
209
                            'data' => "", //empty first column
210
                            'class' => array('expand_column')
218 211
                        ),
219
                        'id' => ('derivate_details' . $rowcount),//details row ID
220
                        'class' => array('detail_row'),
221
                    );
222
                    $rowcount++;
212
                        array(
213
                            'data' => $detail_html,
214
                            'colspan' => 7,
215
                        ),
216
                    ),
217
                    'id' => ('derivate_details' . $rowcount),//details row ID
218
                    'class' => array('detail_row'),
219
                );
220
                $rowcount++;
223 221
                }
224 222
            }
225 223

  
......
246 244
            $render_array['derivate_hierarchy_table'] = $derivateHierarchyTable;
247 245
            $render_array['pager'] = markup_to_render_array(
248 246
                theme('cdm_pager', array(
249
                    'pager' => $pagerFieldUnits,
247
                    'pager' => $pager_field_units,
250 248
                    'path' => $_REQUEST['q'],
251 249
                    'parameters' => $_REQUEST
252 250
                )),
modules/cdm_dataportal/settings.php
2540 2540
    a collection and it can be expanded to get an overview of the specimens and their derivates.'),
2541 2541
  );
2542 2542

  
2543
    $form['taxon_specimens']['cdm_dataportal_compressed_specimen_derivate_table_page_size'] = array(
2544
        '#type' => 'textfield',
2545
        '#title' => t('Number of records per page') . ':',
2546
        '#default_value' => variable_get('cdm_dataportal_compressed_specimen_derivate_table_page_size', CDM_DATAPORTAL_COMPRESSED_SPECIMEN_DERIVATE_TABLE_PAGE_SIZE),
2547
    );
2548

  
2549
  $form['taxon_specimens']['cdm_dataportal_compressed_specimen_derivate_table_show_determined_as'] = array(
2550
    '#type' => 'checkbox',
2551
    '#title' => t('Show "Associated with" in specimen table.'),
2552
    '#default_value' => variable_get('cdm_dataportal_compressed_specimen_derivate_table_show_determined_as', CDM_DATAPORTAL_COMPRESSED_SPECIMEN_DERIVATE_TABLE_SHOW_DETERMINED_AS)
2543
  $form['taxon_specimens']['cdm_dataportal_compressed_specimen_derivate_table_page_size'] = array(
2544
      '#type' => 'textfield',
2545
      '#title' => t('Number of records per page') . ':',
2546
      '#default_value' => variable_get('cdm_dataportal_compressed_specimen_derivate_table_page_size', CDM_DATAPORTAL_COMPRESSED_SPECIMEN_DERIVATE_TABLE_PAGE_SIZE),
2553 2547
  );
2554 2548

  
2555 2549
  $featureTrees = cdm_get_featureTrees_as_options(TRUE);

Also available in: Unified diff