diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-04-06 08:30:07 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-04-06 08:30:07 +0000 |
commit | 711591a6ea0d4c0040fff734066435f2cb93e127 (patch) | |
tree | 5cd5e41e694179bdaa30f3adb5cf40c69370de6f | |
parent | 112370057c87f105865a31968969a6a8feceb320 (diff) | |
download | acf-did-711591a6ea0d4c0040fff734066435f2cb93e127.tar.bz2 acf-did-711591a6ea0d4c0040fff734066435f2cb93e127.tar.xz |
Cleaned up description for creating did and sped up listdefinitions by removing extensions unless searched for.
-rw-r--r-- | did-model.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/did-model.lua b/did-model.lua index 1a2db96..cbf9fc8 100644 --- a/did-model.lua +++ b/did-model.lua @@ -678,15 +678,17 @@ function getdefinitionlist(did, extension, identification, description, departme --def.value.extension = nil local res, err = pcall(function() local connected = databaseconnect(DatabaseUser) - --def.value.definitions.value = listdefinitions(did, identification, description, department) - def.value.definitions.value = listuseddefinitions(stripdash(did), extension, identification, description, department) if def.value.extension.value == "" then - local tmp = listunuseddefinitions(stripdash(did), identification, description, department) + def.value.definitions.value = listdefinitions(did, identification, description, department) + else + def.value.definitions.value = listuseddefinitions(stripdash(did), extension, identification, description, department) +--[[ local tmp = listunuseddefinitions(stripdash(did), identification, description, department) for i,val in ipairs(tmp) do val.extension = "" table.insert(def.value.definitions.value, val) end table.sort(def.value.definitions.value, function (a,b) return (a.did < b.did) end ) +--]] end if connected then databasedisconnect() end end) @@ -786,24 +788,27 @@ function savedefinition(defin, exists) local descr = {} descr[#descr+1] = describechange(def[1], definition) if exists then + defin.descr = "Updated DID "..definition.did.." " updatedefinitionentry(definition) else + defin.descr = "Created DID "..definition.did.." " insertdefinitionentry(definition) end local oldrules = listrules(definition.did) updaterules(defin.value.did.value, rules) descr[#descr+1] = describeruleschange(oldrules, listrules(definition.did)) if #descr > 0 then - defin.descr = "Updated DID "..definition.did.." "..table.concat(descr, " ") + defin.descr = defin.descr..table.concat(descr, " ") logme(defin.descr) - else - defin.descr = "Updated DID "..definition.did.." no change" + elseif exists then + defin.descr = defin.descr.." no change" end defin.errtxt = nil end if connected then databasedisconnect() end end) if not res and err then + defin.descr = nil defin.errtxt = defin.errtxt .. "\n" .. err end end |