Is there a way to do concurrent editing in Magento? - magento

Is there a MediaWiki-like method for supporting concurrent editing of text bodies/ or even product data in Magento? (in the admin)
If i want to implement this function, what should be the concerns?
Can anyone suggest some approach & situation that i should consider?
I have considered few function:
when admin user enter product edit page, he must click the "start edit" button
after clicked, the screen will show the concurrent user in this page(who also click "start edit")
if one of them has submitted the saving, the other one cannot save it and an error will be displayed as " The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved." It will validate in every content saving.

Magento doesn't support this feature, but it is not hard to implement this with a little customization.
Firstly you need add lock entity in Magento, better to add a sperated lock resource model(which it at least has asset type, asset id, lockUserId, lockStartTime..etc ). Thus every time if merchandiser want to change something , it will insert one lock record into this resouce model if there's no exist lock record.
You can find the corresponding event in Magento and add one new observer event appended to that. So the lock merchanism can be done following this way.

Related

Popup the message on Oracle APEX based on the check oracle table

Here is my scenario:
Entering some values on the forms.
enter image description here
On clicking Create, I want to check if the same data exists on the table.
If exists, I want to popup the message as this value is already exists with Yes/No option.
If the user clicking on Yes, then I wanted to Proceed the transaction which means I wanted to submit a page.
If user selected No, then I wanted to STOP the transaction means I don't want to submit a page.
Please advise the solution to achieve the same.
This is the incorrect way for thinking about web technologies.
There's a significant time difference between 3 + 4, enough for another transaction to have occurred.
You should be applying constraints to the table, and responding to a key violation. At best, a warning could be present onChange of your item. But this should be re-validated on page submit.

Why is my Oracle APEX DML Form stuck in edit mode and not going back to create mode?

I have created a page based on "Form & Report" template. So there is the Report page on which there is the create button. That create button leads to the form page which contains.
It is pretty simple. I don't know if there is a cache memory not emptying itself or if there is a setting that I have not properly set.
When I want to create a new database record, Oracle Apex behaves as if I asked it to update a record (though it still presents me with empty text fields).
Below the image of what's happening.
Create button of the Report
Buttons for edit are shown when I click the create button
Those edit buttons are shown instead of the buttons below => This means that the Apex software is behaving like I asked to edit a record not to insert a record.
Why is this happening?
You need to take a look at your create button. Is it passing a value to the form? If so, you probably don't want that. Is it clearing the cache of the form? If not, you probably want to clear it.
Also, on the form page take a look at your processes.. specifically the Automated Row Fetch (ARF) process.. what's the primary key that this process is using?
Also, take a look at the conditions for each button on your form. For the delete/save buttons you likely want a condition type of "value of item / column in expression 1 Is NOT NULL".
For your create button you would want the opposite.. "value of item /... IS NULL".
In both cases for the expression 1 you'd want to use the item that your ARF is leveraging.
#Bloomberg58 if you used the wizard that should not have anyway try to validate the create button in report page and the server-side validation of create and save button in form page

HowTo: stay on account view while opening a contact on a column

I am using a simple tree view on the left side for a company to see linked entities like opportunities, contacts, etc.,
When I click on a contact, my browser gets redirected to the contact, but I want to stay on the company view and load the contact details into the second or third column or just any sector on that company view.
Getting redirected to each record every time I click a link is annoying because I lose my track and sometimes I want to see the parent details while I see the details of a child record. In this case I want to keep the company view while I can load one contact on the same view without any page load or redirection.
Note: I am using a demo access to Dynamics CRM 2015 online and installed a plugin from a third party to get a tree view. The above is not dependent on my tree view. This can also be done for activities for example which is listed on right column by default. By clicking on an activity, I would like to see the activity details loaded in some panel on the middle column or anywhere I want, without being redirected.
You probably can make do with a Quick View.
Let's say you want to do this trick with Accounts and Contacts, to display info for contacts inside an Account. It goes like this:
Create a lookup inside Account, to Contact entity. Put it on the form (you can make it not visible, doesn't matter).
Create a "Quick View" form inside Contact. They are built similar to normal forms. Include all the info you want to display.
Go back to Account form, INSERT -> Quick View. Select the lookup you made in point 1, and the quick view you just created.
The quick view will display on the Account form, grabbing info from the Contact selected inside the lookup. If you left the new lookup visible, you can play with it and see how it works.
4b. You probably will now need to "link" the treeview with the lookup somehow (since it's third-party I'm unable to offer any insight about it). It will require a bit of javascript for sure.
For more details, as usual, refer to MSDN
Ps: If you want to try it out fast, skip #1 and pick "Primary contact" as field in #3 (it's standad, and most likely already on the form)

Shopping cart - preventing back button

I have a site with a shopping cart system, the issue is that we are having some members hit the remove item button, which updates the line item with a "removed" flag - then hitting the browser back button, which then shows the cart in the previous state - with the line item intact.
If they pay in this state we are getting all sorts of issues when the sales is processed as one of more of the items that they pay for don't get processed. which means we manually have to pick up the pieces at a later date.
Is there any standard way to handle this situation - ie I know we can provide an "undo" button - but the user is not always going to use it.
You have to use filter for this situation. And ya... You can also prevent user to go back by disabling back button using simple java script.
http://www.viralpatel.net
visit this one.
This will become helpful for you.
I am going to detail the solution that I am ending up with, in case other people have a similar issue.
Our payment gateway provides a way to pass custom information on to our payment process system, we are planning to pass along the id's of all items that are in the cart, and when we get them back we will use this to un-remove the removed items.
This works using the same process that is causing the issue in the first place, as the cart page does not reload on a browser back.
This is assuming that by pressing the back is the user trying to undo his action, as the payment value is confirmed prior to the sale we can be reasonably sure that the cart is how the user wanted it if its is pushed though.
we are also providing a undo system as well as having the javascript back protection in order to prevent it from being needed, 10 solutions are better than one in these situations.

Joomla handling multiple ajax forms on the same page

I'm using Joomla to develop a user profile management component with AJAX.
The goal is to allow the user to edit his own user information. There is a lot of information so instead of having one massive form, I decided to make "subforms" or sections. And for the whole thing to be user-friendly I want to send the forms and refresh the user information with AJAX.
Here's an example :
There are two sections, "Basic user info" which displays the first name, the last name and the age of the person and "Extended user info" which displays the occupation, the company and the skills of the person. Each section has an "edit" link (or button) which turns the content into a form (AJAX) allowing the user to modify the presented information. You can only edit one section's information at a time. When the user has finished modifying the data, he sends the form with a "send" link (or button) and the section gets back to simply displaying the information of the section (with the updates that were just made).
So I need to know what is the most efficient way to develop such a component. I thought of two approaches :
1) In the "tmpl" directory of the main component view we the following files :
default_basic.php (displays the basic user information),
default_basic_edit.php (displays the form which allows the user to edit the basic information)
default_extended.php (displays the extended user information),
default_extended_edit.php (displays the form which allows the user to edit the extended info)
default.php (loads each of the display subtemplates with calls to JView::loadTemplate($subtemplate))
When the user clicks on an edit link, an AJAX call is made to the following URI index.php?option=com_userinfo&view=userinfo&subview=basic_edit&format=ajax, which causes the view class to call $this->loadTemplate('basic_edit') after assigning the user information to it.
If the user clicks cancel the same process is used to load the 'basic' template again. And if the user modifies the information and clicks the send link, the form is sent and then the 'basic' template is loaded too.
2) There is only a "default.php" file in the "tmpl" directory which holds the edit version and the display version of each section. But all the edit versions are hidden at first. And when the user clicks on the edit link the display version of the section becomes hidden and the edit version is displayed (using display:none and display:block). Then, if the user clicks the cancel button we do the opposite. And if the user clicks the send button we send an AJAX request to update the data in the database and return the updated user info which will be loaded into the display version of the section. And we finally replace the edit version of the section with its display version.
I know there's a lot of text but in the end it goes down to choosing between refreshing full HTML blocks with AJAX, or just sending the updated info and modifying the content of hidden blocks and then make them appear. So what do you think is the most logical approach, knowing that we are in a Joomla 1.5 environment ? How would you procede ? (maybe there are other ways to create such a component ?)
(I tried both ways and I couldn't entirely make it work so I decided to ask to see if it is a matter of conception...)
Thank you for taking the time to read all the text.
My answer is: why even refresh parts when it can be done without it?
For example when we are talking about basic form elements like text fields and check/radio buttons I would prefer the following: on a successful save/send simply display a nice message like "Profile saved" for some seconds and the user is sure that the changes are save and sound.
In case I msissed somthing let me know.
I have tried both solutions and #2 is the only one that worked for me.

Resources