0 votes

One of my customer want to add an information into the attachement list
Via the left menu I want to add a new entry like archive this file. Then the document will be marked as archived like into this picture.

I didn't find where implement this. Any ideas ?

enter image description here

asked in Efficy/ Client side by (281 points)
edited by

2 Answers

+1 vote

Yes you can create a field on FILES tables, for that use DBEditor, find a boolean field and duplicate the line for the FILES table :

For instance : in DB Editor I did the query :
Fields to Select :

K_TABLE, K_FIELD, NAME, ISCUSTOM, DATATYPE, DATALENGTH, DBDEFAULT, DBALLOWNULL, PANEL, USAGE, DEFAULTVALUE, ALLOWNULL, K_LABEL, EDITSTYLE, K_LOOKUPTABLE, K_LOOKUPFIELD, LOOKUPASSOCIATE, SEARCH, QUERY, RULETEXT, LABELPOS, POSX, POSY, POSW, POSH, TABORDER

select From Table :

SYS_FIELDS

where Clouse:

K_TABLE=2000

Order by Clause :

K_TABLE, K_FIELD

Then I added a line like this :

K_TABLE = 2000 <== this is the FILES table Key
K_FIELD = 100 <== check the max key_field in SYS_KEYGEN for K_FIELD
NAME = F_ARCHIVED
ISCUSTOM = 1
DATATYPE = L
DATALENGTH = 
DBDEFAULT = 0
DBALLOWNULL = 1
PANEL = 
USAGE = 
DEFAULTVALUE = 0
ALLOWNULL = 1
K_LABEL = 2100 <== You will need to create also a Label Manually in SYS_LABEL
EDITSTYLE = 
K_LOOKUPTABLE =
K_LOOKUPFIELD = 
LOOKUPASSOCIATE = 
SEARCH = 0
QUERY = 1
RULETEXT =
LABELPOS = 
POSX =
POSY =
POSW =
POSH =
TABORDER =

Once the line saved in DB Editor, connect to Conficy and update de database structure.

The field should now be available in the efficy Document

So now you have to Override the file pages/grid/DocuFile.htm and add the following code, insert it after the div containing "<%Macro('FilesMenu'" :

<div class="float-start">
    <a href="#" class="button icon dropdown no-pip <#I=F_ARCHIVED;1=i-folder-in;#ELSE=i-folder;#EMPTY=i-folder;>" data-args="$K_FILE$_$VERSION$"></a>
</div>

Now you have to create the menu, this menu is in MacroEdit.txt, macro "FilesPopupMenu.Docu" ... You then only have to create a command that will update the FILES.F_ARCHIVED fields from a Serverscript

And voilà :)

answered by (1.9k points)
0 votes

Because you can't add field form the designer to the Files table I would recommand you to create a lookup called LKARCHIVEDFILES that will have the KFIle, the KVErsion and a status field (like 1 = Archived)

then override the Grid/DocuFile.htm to add your column
since you are in a custom template page you can freely add some serverscripts call here and match with your lookup table.

answered by (986 points)
1,226 questions
1,495 answers
1,831 comments
328 users