Changeset 12226


Ignore:
Timestamp:
Sep 25, 2011, 7:56:05 PM (9 years ago)
Author:
grum
Message:

bug:2029 - metadata tab is hidden when a tab name is not specified for certain language

Location:
extensions/AMetaData
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/amd_pip.class.inc.php

    r12224 r12226  
    113113      'values' => array(),
    114114    );
    115     $sql="(SELECT st.tagId, gn.name as gName, ut.numId, ut.name, 'y' AS displayStatus, st.order AS tOrder, gr.order as gOrder
     115    $sql="(SELECT st.tagId, gn.name as gName, ut.numId, ut.name, 'y' AS displayStatus, st.order AS tOrder, gr.order as gOrder, gr.groupId
    116116          FROM ((".$this->tables['selected_tags']." st
    117117            LEFT JOIN ".$this->tables['groups']." gr
     
    126126          UNION
    127127
    128           (SELECT DISTINCT ut3.tagId, '', pautd.value, '', 'n', -1, -1
     128          (SELECT DISTINCT ut3.tagId, '', pautd.value, '', 'n', -1, -1, -1
    129129          FROM ((".$this->tables['selected_tags']." st2
    130130            LEFT JOIN ".$this->tables['used_tags']." ut2 ON ut2.tagId = st2.tagId)
     
    139139    if($result)
    140140    {
     141      $numMD=0;
     142
    141143      while($row=pwg_db_fetch_assoc($result))
    142144      {
     145        if(trim($row['gName'])=='')
     146        {
     147          $sql2="SELECT gn0.name
     148                 FROM ".$this->tables['groups_names']." gn0
     149                 WHERE gn0.lang='en_UK' AND gn0.name <> '' AND groupId=".$row['groupId']."
     150
     151                 UNION
     152
     153                 SELECT gn0.name
     154                 FROM ".$this->tables['groups_names']." gn0
     155                 WHERE gn0.lang<>'".$user['language']."' AND gn0.name <> ''  AND groupId=".$row['groupId']."
     156
     157                 LIMIT 0,1;";
     158          $result2=pwg_query($sql2);
     159          if($result2)
     160          {
     161            $row2=pwg_db_fetch_assoc($result2);
     162            if($row2['name']!='') $row['gName']=$row2['name'];
     163          }
     164        }
     165
     166        if($row['gName']=='')
     167        {
     168          $row['gName']='Metadatas #'.$numMD;
     169          $numMD++;
     170        }
     171
    143172        $tagsList[$row['tagId']]=$row;
    144173        if(preg_match('/^userDefined\./i', $row['tagId']))
  • extensions/AMetaData/main.inc.php

    r12225 r12226  
    220220|         |            |   . metadata tabs are messed up when adding certain
    221221|         |            |     of xmp:dc tags
     222|         |            |
     223|         |            | * mantis bug:2029
     224|         |            |   . metadata tab is hidden when a tab name is not
     225|         |            |     specified for certain language
     226|         |            |
    222227|         |            |
    223228|         |            |
Note: See TracChangeset for help on using the changeset viewer.