Changeset 1282

Show
Ignore:
Timestamp:
03/19/10 08:04:03 (4 months ago)
Author:
Gary
Message:

unxsVZ tGlossary functionality work in progress.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/mainfunc.h

    r1126 r1282  
    921921        unsigned uJobContainerIndex=0; 
    922922        unsigned uTemplateLabelIndex=0; 
     923        unsigned uGlossaryLabelIndex=0; 
    923924 
    924925        printf("UpdateSchema(): Start\n"); 
     
    10021003        mysql_free_result(res); 
    10031004 
     1005        sprintf(gcQuery,"SHOW INDEX IN tGlossary"); 
     1006        mysql_query(&gMysql,gcQuery); 
     1007        if(mysql_errno(&gMysql)) 
     1008                printf("%s\n",mysql_error(&gMysql)); 
     1009        mysql_query(&gMysql,gcQuery); 
     1010        res=mysql_store_result(&gMysql); 
     1011        while((field=mysql_fetch_row(res))) 
     1012        { 
     1013                if(!strcmp(field[2],"cLabel")) uGlossaryLabelIndex=1; 
     1014        } 
     1015        mysql_free_result(res); 
     1016 
    10041017        if(uIncorrectVeth) 
    10051018        { 
     
    11721185                else 
    11731186                        printf("Added INDEX cLabel tTemplate\n"); 
     1187        } 
     1188 
     1189        if(!uGlossaryLabelIndex) 
     1190        { 
     1191                sprintf(gcQuery,"ALTER TABLE tGlossary ADD INDEX (cLabel)"); 
     1192                mysql_query(&gMysql,gcQuery); 
     1193                if(mysql_errno(&gMysql)) 
     1194                        printf("%s\n",mysql_error(&gMysql)); 
     1195                else 
     1196                        printf("Added INDEX cLabel tGlossary\n"); 
    11741197        } 
    11751198 
  • trunk/tglossary.c

    r166 r1282  
    557557void CreatetGlossary(void) 
    558558{ 
    559         sprintf(gcQuery,"CREATE TABLE IF NOT EXISTS tGlossary ( uGlossary INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, cLabel VARCHAR(32) NOT NULL DEFAULT '', uOwner INT UNSIGNED NOT NULL DEFAULT 0,index (uOwner), uCreatedBy INT UNSIGNED NOT NULL DEFAULT 0, uCreatedDate INT UNSIGNED NOT NULL DEFAULT 0, uModBy INT UNSIGNED NOT NULL DEFAULT 0, uModDate INT UNSIGNED NOT NULL DEFAULT 0, cText TEXT NOT NULL DEFAULT '' )"); 
     559        sprintf(gcQuery,"CREATE TABLE IF NOT EXISTS tGlossary ( uGlossary INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, cLabel VARCHAR(32) NOT NULL DEFAULT '',INDEX (cLabel), uOwner INT UNSIGNED NOT NULL DEFAULT 0,INDEX (uOwner), uCreatedBy INT UNSIGNED NOT NULL DEFAULT 0, uCreatedDate INT UNSIGNED NOT NULL DEFAULT 0, uModBy INT UNSIGNED NOT NULL DEFAULT 0, uModDate INT UNSIGNED NOT NULL DEFAULT 0, cText TEXT NOT NULL DEFAULT '' )"); 
    560560        MYSQL_RUN; 
    561561 
  • trunk/tglossaryfunc.h

    r1280 r1282  
    285285                        printf("<a class=darkLink href=unxsVZ.cgi?gcFunction=tGlossary&uGlossary=%s>%s</a>", 
    286286                                        field[0],field[1]); 
    287                         printf(" <a class=darkLink href=# onClick=\"open_popup('?gcFunction=Glossary&cLabel=%s')\">" 
    288                                         "Popup</a><br>",field[1]); 
     287                        printf(" (<a class=darkLink href=# onClick=\"open_popup('?gcFunction=Glossary&cLabel=%s')\">" 
     288                                        "preview</a>)<br>",field[1]); 
    289289                } 
    290290        }