Duplicates in Update

schnils

New member
Hi to all!

First of all, thank you for a great product.
I'm using a rather old version of Dadabik from 2012. I guess it is 4.6 (or something like that...couldn't figure out what it is exactly).

When I "insert" something in my database the "check for duplicate"-function works well. But I did not find out, if it is possible to use this function during the "update"-process.

This is now my question: Is there a way to check for duplicates during updates of datasets?

Greetings from Germany

Schnils
 

eugenio

Administrator
Staff member
Hello Schnils and thanks for your appreciation,
at the moment the answer is no, there isn't any duplication checking during UPDATE operations; the idea is that the check is important when you crate a new entry (because maybe you don't know that the same entry is already in your db) but not very useful when you modify an existing entry. Do you have any use case where using the duplication check for UPDATE would be important?

If you want, you can modify the code looking for the function build_select_duplicated_query(), which is called when an insert operation is performed.

Greetings from Italy.
 

schnils

New member
Dear Eugenio,

thank you for your fast support...

we are using Dadabik to plan the time of some of our activities. Therefore we make once in a half year a table with a basic structure of the planned activities for the following months. Every person of our group can edit this table and everyone can fill in some times he or she wants the activity to be startet. For example: The given activity is: Playing Football. I decide to manage the Footballgroup in the following time. So I edit the table, put my Name into one field. Then I have to put two times into the dataset. For example Monday 14-16 h and Thursday 13-14 h.
It would be great if Databik would check during the update/edit, if there is one of my collegues, who reserved the time before. If Dadabik could tell me this, it would be nice.

Well, I tried to get through the code, it seems that the duplicate-function in buisiness-logic.php could be suitable for my needs but I didn't get the point where the updating starts. After hitting the "edit"-Button (after editing the data) I have to check if there are duplicates. But I do not find the edit-function...or the querey to update the database...but still the search goes on :) Any hints?

Greetings
Schnils
 

schnils

New member
...addition...probably I have a "simple" solution for me. If I find out where the "Edit"-Button before the updating-process is, I can replace him with a "Check-Button". With this one I can direct the user to another function, which checks, if the time is used by another person. If this is not the case, the button "Edit" appears...

well, I need to find out where this button is :)
 

eugenio

Administrator
Staff member
Hi,
nice use o DaDaBIK :)
Are you sure the duplication check covers your need? Do all the people strictly respect a string format when the enter time data like Monday 14-16 h?

Anyway, if you look for build_select_duplicated_query in index.php you should find it under the case "insert", what you want to do is adding that part to the case "update" as well, I don't think it is so trivial to implement, though.
 
Top