Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
numbering plugin in/with bureaucracy-plugin
Page:  1  2  next 
Avatar
virk #1
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Subject: numbering plugin in/with bureaucracy-plugin
- We make use of the attached bureaucracy-form (with corresponding template) to insert information.
- The first "variable" documentnr defines the page-name. This number "we get" from the numbering plugin.
- Currently we get this number by editing a beliebige page, once clicking the numbering icon, remember the number, leave the page unsaved and insert the number in the bureaucracy-form.
- I think there should be a possiblitly to have this integrated into the bureaucracy-form:

====== Rückkühlung ======
++ Template (nur HV!) | [[wiki:templates:cooling_tpl| ... bearbeiten]] ++
++++
Rückkühler eintragen|<form>

action template wiki:templates:cooling_tpl "ep:cooling::@@documentnr@@"
submit "Create Rückkühler"

textbox  "documentnr"
date    "date" !
number  "project" !
hidden  "type" ="quotation"
select  "brand" "Neu (Ändern)|BAC|EVAPCO|RAFFEL"
select  "equipment" "Neu (Ändern)|Flüssigkeitskühler|Kühlturm|Verdunster"
textbox "spec" !
textbox "capacity" !
textbox "wbt" !
textbox "cooling-supply" !
textbox "cooling-return" !
textbox "fans" !
textbox "price" !
select  "Note" "No|Yes"
fieldset "Notice" "Note" "Yes"
textbox "Notice" !
</form>++++

I already experimented a little bit with the code; if I for example replace @@documentnr@@ by @@~~GetNextNumber~~@@ it "works", but only once, because ~~GetNextNumber~~ will be overwritten by the next number :-)

Has anybody got an idea how this can be done?

In other words: I would like to create a page with bureaucracy-plugin (based on a template) and the created page should be named after the next number of the numbering-plugin.
The author has attached one file to this post:
numbering.png 79.4 kBytes
You have no permission to open this file.
Avatar
Aleksandr #2
Member since Mar 2010 · 587 posts · Location: Volgograd, Russia
Group memberships: Members
Show profile · Link to this post
Just an idea: https://forum.dokuwiki.org/thread/16656
ru: Пожалуйста, избегайте избыточного цитирования.
en: Don’t use an overquoting, please.
Avatar
pop (Moderator) #3
Member since Nov 2016 · 237 posts · Location: near Basel. Switzerland
Group memberships: Global Moderators, Members
Show profile · Link to this post
In reply to post #1
Is there a particular reason for not using the autoincement feature or the automatically incrementing number fields of the bureaucracy plugin?
Avatar
virk #4
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Yes! The reason for not using the autoincrement feature... is, that we use the numbering-plugin for providing numbers for emails, invoices and in future also for incoming quotations. Our number scheme is 50345/3034, while first five digits are incremented numbers (by numbering plugin) and only given once, while the four digit number forms the project number. "All" our documents are provided with these numbers and in our dokuwiki these are referred to for proper tracing of projects.
I do not mind which counter to take, but we should always use the same, otherwise numbers will no longer remain unique. Up to now everything works pretty will with the numbering-plugin*1, so I would like to stick to this.


(*1: bureaucracy-autoincrement we also use but if two users use the same bureaucracy-form at same time, same number will be given twice. As far as I remember I once opened a thread concerning this matter but there was no solution, so I instructed staff)
Avatar
virk #5
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Hi Aleksandr: Thank you for the link. I had a look at it and also tried to start to apply "something" but the requirements exceed my current skills:-)
Avatar
turnermm (Moderator) #6
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
I am not very familiar with the bureaucracy plugin, but I am guessing that the problem occurs because the number is not embedded in the page but re-assigns it with each new page access.   Could you either send me or attach a copy of a page with the completed form? I'll see what I can do to solve the problem.  And a complete copy of your form.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
This post was edited on 2020-02-14, 16:36 by turnermm.
Avatar
virk #7
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
The result of the form

---- dataentry  ----
documentnr     : 50862 #
project        : 3016 #
date_dt        : 2020-02-11 #
type           : quotation
brand          : RFID #
equipment      : KT #
spec           : KT 3A12-4N54
capacity       : 7.170,85 #
wbt            : 28,0 #
cooling-supply : 31,0 #
cooling-return : 35,0 #
fans           : 3*30 #
price          : 13.999,00 € #
note           :  #
----

The form itself:

Rückkühler eintragen|<form>

action template wiki:templates:cooling_tpl "ep:cooling::@@documentnr@@"
submit "Create Rückkühler"

textbox  "documentnr"
date    "date" !
number  "project" !
hidden  "type" ="quotation"
select  "brand" "Neu (Ändern)|BAC|EVAPCO|RAFFEL"
select  "equipment" "Neu (Ändern)|FK|KT|VK"
textbox "spec" !
textbox "capacity" !
textbox "wbt" !
textbox "cooling-supply" !
textbox "cooling-return" !
textbox "fans" !
textbox "pumps" !
textbox "price" !
select  "Note" "No|Yes"
fieldset "Notice" "Note" "Yes"
textbox "Notice" !
</form>++++

...and the template

---- dataentry  ----
documentnr     : @@documentnr|@@ #
project        : @@project|@@ #
date_dt        : @@date|@@ #
type           : @@type|@@ #
brand          : @@brand|@@ #
equipment      : @@equipment|@@ #
spec           : @@spec|@@ #
capacity       : @@capacity|@@ #
wbt            : @@wbt|@@ #
cooling-supply : @@cooling-supply|@@ #
cooling-return : @@cooling-return|@@ #
fans           : @@fans|@@ #
pumps          : @@pumps|@@ #
price          : @@price|@@ #
note           : @@note|@@ #
notice         : @@notice|@@ #
----

The working is as follows: With the form of the bureaucracy-plugin the template is filled with data from the form and this new page is saved. "documentnr" needs to be the next number of the numbering-plugin and is the pagename.

I already replaced @@documentnr@@ with @@~~GetNextNumber~~@@, but unfortunately when I save the page with the form, ~~GetNextNumber ~~ will be immediately replaced with the next number :-)

(Currently I do not remember why I need to work with a template and if bureaucracy perhaps would be sufficient, but that's another topic, which I will investigate right now :-) )
Avatar
turnermm (Moderator) #8
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Not the result of the form but the actual page as saved to the server.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
virk #9
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Yes, it is the page as saved on the server. The content of this page will be "collected" by the "structured data plugin". And the file name of this page is f.e. "50562.txt" on the server (or without the suffix in dokuwiki)
Avatar
turnermm (Moderator) #10
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
action template wiki:templates:cooling_tpl "ep:cooling::@@documentnr@@"
How do the double colons function here?  Is ep a page id?  I don't have the time to (or interest)to learn the bureaucracy plugin, so I'll need some help.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
virk #11
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Quote by turnermm:
action template wiki:templates:cooling_tpl "ep:cooling::@@documentnr@@"
How do the double colons function here?  Is ep a page id?  I don't have the time to (or interest)to learn the bureaucracy plugin, so I'll need some help.

1) Perhaps the double colon is just a typo of mine; I just checked it; it also seems to work with single colon.
2) The line "action ...." works as follows:
a) with "template" bureaucracy is told what is has to do.
b) With "wiki:templates:cooling_tpl" bureaucracy is told which template to take for to fill in the data from the form
c) With "ep:cooling::@@documentnr@@" the destination of the new page is told. In this case the final file/page would be :ep:cooling:50786
So "ep" is a page id or namespace like f.e. "wiki" or like any other page ids. (Sorry, if I do not use the correct names/denominations for this)
Avatar
turnermm (Moderator) #12
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #7
I have added support for bureaucracy to the numbering plugin.  It includes a new configuration option: bureaucracy.  This is the name of  the bureaucracy field where you want the numbering plugin to insert its number.  The number is inserted when the bureaucracy form loads.   This numbering is independent of the bureaucracy's auto-increment, and there will never be number duplication, which you found can occur in the bureaucracy's auto-increment function. 

For your form, in the numbering plugin's bureaucracy setting you will insert "doumentnr".  Here is a temporary link to the update:

https://github.com/turnermm/numbering/archive/bureaucracy.….

Please let me know if it works for you.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
virk #13
Member since Aug 2008 · 670 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
I just installed it and checked it. It provides the next number at proper and desired location :-) I have one comment: It could be an idea not to already provide the number, when only the form loads. If the user later decides NOT to submit the form, this number is lost. (Sometimes this form-page remains open for quite a time, because also other information is displayed beneath the form.)
- Idea: To provide a button (like) "#1", which is accessible (via tools or whatever) when the form is displayed; you just put the cursor into the form and hit the #1-button and the next number is inserted into the form. Problem with this is perhaps, that the page in this case is not in "edit-mode", but I do not have enough skills to judge this.

In any case this is already a step ahead. (After a 3-days business trip starting tonight I will continue with the real work tests and come up with comments, if any.)

One little question: How much code did you need to change for making this work? 10 lines, 100 lines, 1000 lines?
Avatar
turnermm (Moderator) #14
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Number of lines was not what took time; what was time consuming was working out how to do it and testing different solutions (and familiarizing myself with the bureaucracy plugin).

I realize the problem you point out, that the number is pre-inserted into the textbox. But I haven't figured out a way around this yet, but I'll try a few things.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
This post was edited on 2020-02-16, 18:04 by turnermm.
Avatar
turnermm (Moderator) #15
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #13
See Update.  Clicking on number textbox inserts new number
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-06, 04:21:46 (UTC +02:00)