Skip to content

Commit

Permalink
Inventory for books
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno De Bel authored and Bruno De Bel committed Feb 7, 2018
1 parent 6357f2d commit 851f6d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions namalysator/bookModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ QVariant bookModelInventory::data(const QModelIndex &index, int role ) const{
}

QVariant bookModel::headerData ( int section, Qt::Orientation orientation, int role ) const{
//static char* table[]={"ID","PATH","METS", " ","Page","BIBREC_245a","BIBREC_245b","BIBREC_100a-1","BIBREC_100a-2","BIBREC_008-35-37","BIBREC_260b","BIBREC_260c","ITEMbarCode","BIBREC_SYS_NUM"};
//static char* table[]={"ID","PATH","METS", " ","Page","UNIQKEY","BIBREC_245b","BIBREC_100a-1","BIBREC_100a-2","BIBREC_008-35-37","BIBREC_260b","BIBREC_260c","ITEMbarCode","BIBREC_SYS_NUM"};
static char* table[]={"PROGRESS","ID","PATH","METS", " ","BIBREC_245a",
"BIBREC_100a","BIBREC_260b","ITEMbarCode","BIBREC_SYS_NUM","CHECKED","R","N","D"};
"BIBREC_100a","BIBREC_260b","TITLE","BIBREC_SYS_NUM","CHECKED","R","N","D"};

QVariant ret=QVariant();
if ( role == Qt::DisplayRole && section < 12 && section >= 0 ) {
Expand All @@ -86,8 +86,8 @@ QVariant bookModel::headerData ( int section, Qt::Orientation orientation, int r


QVariant bookModelInventory::headerData ( int section, Qt::Orientation orientation, int role ) const{
static char* table[]={"CHECKED","BATCH","language", "BIBREC_SYS_NUM","ITEMbarCode","BIBREC_245a",
"BIBREC_100a","BIBREC_260b","BIBREC_008_7_10","N","D"};
static char* table[]={"CHECKED","BATCH","language", "UNIQKEY","TITLE","TYPE",
"FORMALDATE","BIBREC_260b","BIBREC_008_7_10","N","D"};

QVariant ret=QVariant();
if ( role == Qt::DisplayRole && section < 9 && section >= 0 ) {
Expand Down
9 changes: 4 additions & 5 deletions namalysator/dbrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ std::vector<std::vector<QVariant> > dbrequest::getAllMets(int id_testset,bool sa

//std::string selectSql = "SELECT a.ID_METS, a.PATH, a.FILENAME, b.PAGENB FROM METS a LEFT JOIN STRUCTUREERROR b ON a.ID_METS = b.ID_METS WHERE a.ID_TESTSET=?";
std::string selectSql = "SELECT ll.LABEL, a.ID_METS, a.PATH, a.FILENAME, c.UNIQUEBUILDKEY,"
" c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a"
" c.TITLE,c.TYPE,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a"
" LEFT JOIN (SELECT * FROM INVENTORY h, METSINVENTORY b WHERE b.UNIQUEBUILDKEY = h.UNIQUEBUILDKEY) c "
" ON a.ID_METS = c.ID_METS"
" LEFT JOIN PROGRESSION_STATE aa"
Expand All @@ -1952,7 +1952,7 @@ std::vector<std::vector<QVariant> > dbrequest::getAllMets(int id_testset,bool sa
if ( sampling ) {

selectSql = "SELECT ll.LABEL, a.ID_METS, a.PATH, a.FILENAME, c.UNIQUEBUILDKEY,"
" c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a, SAMPLING_STRUCTURE ss"
" c.TITLE,c.TYPE,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY/*,c.CHECKED*/ FROM METS a, SAMPLING_STRUCTURE ss"
" LEFT JOIN (SELECT * FROM INVENTORY h, METSINVENTORY b WHERE b.UNIQUEBUILDKEY = h.UNIQUEBUILDKEY) c "
" ON a.ID_METS = c.ID_METS"
" LEFT JOIN PROGRESSION_STATE aa"
Expand Down Expand Up @@ -2017,9 +2017,8 @@ std::vector<std::vector<QVariant> > dbrequest::getAllBooks(int id_testset){
const char *zErrMsg= 0;


//std::string selectSql = "SELECT a.ID_METS, a.PATH, a.FILENAME, b.PAGENB FROM METS a LEFT JOIN STRUCTUREERROR b ON a.ID_METS = b.ID_METS WHERE a.ID_TESTSET=?";
static std::string selectSql = "SELECT c.CHECKED, a.ID_TESTSET, c.LANGUAGES, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY,"
" c.UNIQUEBUILDKEY, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY FROM "
static std::string selectSql = "SELECT c.CHECKED, a.ID_TESTSET, c.LANGUAGES, c.UNIQUEBUILDKEY,c.TITLE, c.TYPE,"
" c.FORMALDATE, c.UNIQUEBUILDKEY,c.UNIQUEBUILDKEY FROM "
" INVENTORY c"
" LEFT JOIN ( SELECT ID_TESTSET, UNIQUEBUILDKEY FROM METS a, METSINVENTORY b WHERE a.ID_METS = b.ID_METS AND a.ID_TESTSET=? ) a"
" ON a.UNIQUEBUILDKEY = c.UNIQUEBUILDKEY";
Expand Down
4 changes: 3 additions & 1 deletion project/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ void inventoryMapping::setCurrentInventory(std::string type){
void inventoryMapping::setCurrentInventoryValue(std::string field, std::string value){
if ( currentInventory == 0) return;

if ( field.compare("recordIdentifier")==0 ) currentInventory->uniquebuildkey=value;

if ( field.compare("identifier")==0 ) currentInventory->uniquebuildkey=value; // Attention alimenter pour les monographies
if ( field.compare("recordIdentifier")==0 ) currentInventory->uniquebuildkey=value; // overloader pour les issues

if ( field.compare("title")==0 ) currentInventory->title=value;
if ( field.compare("subtitle")==0 ) currentInventory->subtitle=value;
Expand Down

0 comments on commit 851f6d5

Please sign in to comment.