I am in the process of creating a order tracker using Wordpress, ACF, and a yet to be decided form plugin for use on the front-end.
The back-end is working just fine but now I'm working on the front-end. What I am trying to accomplish is a visual progress bar for the user (Author) to view status on individual orders (posts).
In my field groups I have 6 stages. To open the next stage a option (radio) must be ticked to conditionally open the next stage.
These stages are what I want to represent on the front end.
Example: Order 123 is a new order. On the back end the new order information would be added (create New Post). Creating the new post would trigger the first step, or a 1, on the front end visual progress bar. When an employee saves step 2 (Edit post) the progress bar would reflect step 2, or a 2. And so on through to completed.
A little more clarity; I realize that Edit Post won't create the next step or the next progress. What I meant was that in the post form the post would be edited and the next tick, or trigger, would conditionally open the next status level or stage (i.e. Step 3, or a 3).
I am not sure if I need to somehow turn a word (label|value) into a number, make the Label=Step 1|Value=1?
I've tried a number of sliders, event trackers, range plugins but they all seem to want a numeric value and I can't connect and acf field to them. Any idea on how to either pass a radio/select/checkbox text value as a number and how to turn that step/value into a visual representation?
Or, any suggestions for plugins, or scripts, that might work for this?
Optimally, I would like each step to be a gradient color from the next. But, of course that's after I figure out the progress bar.
Thank you so much.
You can use PHP intval to change a string to a number, so your ACF data will always be a number you can work with. Then create a <progress> bar (or your progress bar of choice) with that ACF field because you know the number of steps will always be 6, and your returned ACF field will be a number between 1-6.
<label for="post_step">Post Step:</label>
<progress id="post_step" value="2" max="6"> 2 </progress>
Related
I would like to have the user enter order items on my order form as a table where they input the Qty and Prod #. I've not programmed with that type of field so a blank line would initially display for a new order. They would type a Qty and an item number in the fields and hit enter. When they hit enter from either field, what do I program to check the validity of the two fields. Plus I need the item number to be a drop down/type ahead field. Does anyone have an example of this type of thing they could send me? It would be looking at a view in the product catalog db. Also, after they enter an item to order, that "doc" should get stored/saved and a new blank line should open up.
What type of control do I need to use and should these items be stored in their own form or on the main order document? Could use some guidance here. Thanks.
The question you have is a little broad but I will make a couple suggestions if I can.
You have the main order doc. Then a repeat control with each item. Filter each item by a uniqueID that allows you to join the main doc to the child docs. Each item should be a separate document. You then need to make the items in the repeat control editable.
There is a lot of things going on here and I think you need to get started somewhere. I think the first step is to do a repeat control with response documents.Xpages, Inherited documents in view panel by using #Unique
Front end application will use firebase.com as database.
Application should work like blog:
Admin add / remove posts.
There are "home" page which show several articles per page with "Next" and "Prev" buttons and page which show single article.
Also I need deep linking.
I.e. when user enter URL http://mysite.com/page/2/ I need that application show last articles from 10 to 20, when user enter URL http://mysite.com/page/20/ application show last articles from 200 to 210. Usual pagination.
Main question - is it possible to achieve this if use firebase.com.
I read docs at firebase.com, I read posts here. "offset()" and "count()" will be in the future, use priority, in order to know count of items and not load all of them use additional counter.
Based on this I suppose this:
ADD POST action:
get value of posts counter
set priority for new post data equals to value of posts counter
increase value of posts counter
DELETE POST action
get value of priority for post data
query posts data which have value of priority more than priority for post data which will be deleted and decrease their value
decrease value for posts counter
GET POSTS FROM x TO y
postsRef.startAt(null, x).endAt(null, y).on(... and so on)
Thing which I not like in this way are actions for DELETE POST. Because index of posts will be from 0 to infinity and post with less priority is considered as post which was created earlier so if I have 100000000 posts and if I need to delete 1st post then I need to load data for 99999999 next posts and update their priority (index).
Is there any another way?
Thanks in advance, Konstantin
As you mentioned, offset() will be coming, which makes your job easier.
In the meantime, rather than using startAt and endAt in combination, you could use startAt and limit in combination to ensure you always get N results. That way, deleted items will be skipped. You then need to check the last id of each page before moving to the next to find the proper id to start on.
I am trying to create a food menu for a boarding school. The idea is to let the students view what they have on menu for the whole day. That is, breakfast, lunch and dinner. This menu would be prepopulated weekly by a user.
My problem are as follows:
1) How do i use view module to just display items for one day?
2) Do i need like a date field, and calender module?
I would recommend using the Date module.
Add a date field to your 'boardingschoolmenu' content type.
Then in views you would add the fields you want visible (breakfast, lunch, dinner, etc)
Add a filter on content type 'boardingschoolmenu'
Add an argument for the date field. In the settings of the argument, under "Action to take if argument is not present", select: Provide default argument followed by: Current date (or can use php code if you want another date).
I have a form in which I am attaching a workflow to. The form has a number that will be auto-generated. For example the first number will be 1, the next time the form is opened the number should be 2, so on and so forth. The issue I am having is: in the Default Value under the Text Box Properties I have the Value as: count(mynumber QuoteNumber) +1. When the form is generated the first and only number is 2 the number begins at 2 and never increases. Can someone help me with this or explain what I may be doing wrong? Thank You. I'm not using visual studio.
Rachel: I have fought with this problem since InfoPath 2007. Here is how I do it.
Since you say you are attaching a workflow, I assume you are using the from in SharePoint.
1 - create your form library in SharePoint
2 - use InfoPath to design the form. When you publish the form to SP, make sure you promote AT LEAST the ID field you want to auto-inc. (I usually promote every field in my forms, 'cause I like to use them like SP lists.)
3 - In SP, create one new form and manually set the ID field to the starting number for your form series.
4 - return to InfoPath designer and re-open your form template.
5 - create a new data source to receive data from your SP form library and specify your form library as the source, and the ID field as a data element. Name the data source something like “ID Lookup”.
6 - open the properties of the field you want to auto-inc on your form and, in the default value box, select function, then choose the MAX function.
And add “+1” after the function to increment by 1.
Now, double-click in the field are of the Max function. You will see a dialog showing your form fields. Notice the drop-down at the top of the dialog – here you can choose the data source (notice I named mine “sales Contracts” in this example). If you select the data source you created in step 5, you will see a dialog showing you a couple of data branches.
Expand the ‘dataFields’ branch until you see the field you want to auto-inc. Click on this.
Your formula dialog will look something like:
max(ID_X0020) + 1
With your field name instead of the 'ID' in the Max function – the function will now return the Maximum value of the field IN THE FORM LIBRARY, plus 1.
Save the form in InfoPath and try previewing it. You will probably get a security warning – your InfoPath form is grabbing data from your SharePoint library on the fly. You may even get asked to re-enter your password (I usually do). When the new, blank form is displayed in InfoPath preview, you should see you ID field filled in with a value one greater that the number in that field of your SP library.
There is one huge Gothca with this method - if users re-open a completed form to edit it, the formula will probably try to replace the ID number. If your users don't edit the forms after they are submitted, the this will work for you.
Hope this makes sense.
You aren't doing anything wrong - you just have to change how you think about "forms" a bit. Remember a form is just like a word document template. Suppose you save a word document on your hard drive with a blank spot to fill in your name. Later you open the template, type your name, and save a copy as V1.doc. When you go back and open the template again - your name is not there because it was saved in V1.doc. Everytime you open the template you start again from scratch.
Infopath forms that you design and that the user fills out are templates (.xsn files). When the user fills it out and saves it they are really saving a copy which is only data (.xml files). The .xsn template doesn't change when users interact with it.
So to answer your question - there is no way directly in InfoPath to cleanly keep track of an auto incrementing ID. You will need to tap into some code (webservice, sharepoint, etc) to do that. You could also consider making the ID a GUID (which infopath does support) but it won't be auto incrementing and it won't look "clean" if it has to be displayed/used by real people.
Currently if you create a product in UberCart, you have to first create the product before accessing the stock tab to set stock levels. I want to be able to set the stock levels when I create the product. I.e. Right below where I set the "list price". How would I do this?
Well, that's going to involve a little work.
You're going to have to create a hook_form_alter implementation to add the new form fields to the node_add/node_edit form.
You're going to want to add a hook_nodeapi() implementation for $op=='validate' to make sure you're getting valid information.
You're then going to want to extend that hook_nodeapi() implementation for $op=='insert' and 'update' to grab the field value (which should be stuck to the $node object) and write it to the stock levels table, whose name I'm too lazy to look up right now.
Alternately, instead of 2 and 3, you could mess around with creating a validation and submit function, and append them to the #validate and #submit arrays of the form.
For people looking for a module-based solution to this problem in Drupal 7, the latest dev version of the "Ubercart Product Power Tools" module has an excellent per-product setting to make stock-tracking active on creation, as well as set default stock quantity and threshold for the product.
Ubercart Product Power Tools