dragging and dropping in the calendar application does not leave a trace in the log table, nor does it allow the data of the new date to be captured in any event.
I have been using scriptcase since 2018 and have not seen any solutions to this in the forums I have consulted.
I would appreciate some help from someone who has been able to solve this problem.
Sorry for the text translated with google …
You can log the info in the log yourself with sc_log_add
Drag and Drop case on calendar.
When dragging an event from one date to another, it only records, automatically in the log, two records that report access, but the modification made to the dates due to the dragging effect is recorded.
The only thing I am looking for is to register the event of automatic modification of the dates in the calendar event without the need to edit the event and press the update registration button …
Finally:
Where can I verify that the start and end dates have been modified by the dragging of the event?
$day_delta and $time_delta will contain the time and date variation. $id contain the calendar event id
/onScriptInit
if (isset($_POST['nmgp_opcao'])) {
if ($_POST['nmgp_opcao'] == 'calendar_drop' or $_POST['nmgp_opcao'] == 'calendar_resize') {
$id = $_POST['sc_event_id'];
$day_delta = $_POST['sc_day_delta']; //+ or - days
$time_delta = $_POST['sc_time_delta']; //+ or - minutes
$all_day = $_POST['sc_all_day'];
$description = 'whatever you want put in your log';
sc_exec_sql("INSERT INTO sc_log (inserted_date, username, application, creator, ip_user, action, description) VALUES (NOW(), 'username', 'calendar', 'Scriptcase', 'user IP if needed', 'update', '" . str_replace("'","''",$description) . "'));
}
}
hi I have a similar question with i slight change
we work with a standarized time table called SBU the time difference between the start and end time is calculated as SBU let’s say 11:00 till 12:00 is 1 SBU. 11:00 till 12:30 is 1,5 SBU. and 11:00 till 13:00 is 2 SBU
// onbeforeupdate
//i use this code to calculate the SBU when a user changes the time
{sbu_var} = 60; // this varies on system is now defined to skip the rest of the code
{aantal_uur} = sc_time_diff({wk_tijd_e_gesprek}, “hh:ii:ss”, {wk_tijd_s_gesprek}, “hh:ii:ss”);
// calculate SBU
// eerst de uren
{uur_omzetten} = ({aantal_uur[0]}/({sbu_var}/60));
{min_omzetten} = (1/({sbu_var}/{aantal_uur[1]}));
{wk_sbu} = {uur_omzetten}+{min_omzetten};
so far so good
i used your script and alter it to get the same result when a user dragges the calendar item. i tried everyrhing, no result. any suggestions?
If I understood you well:
$time_delta / 60 = 1 SBU and $day_delta = 24 SBU
So the number of SBU should be ($day_delta * 24) + ($time_delta / 60)