Feature Requests #2908: async call to boupdate.update - possible with small changes

Ticket modified by camel camel at 2011/07/12 23:58
Tracking SystemFeature Requests
CategoryAPI
VersionTrunk
StatusOpen
Completed0%
Priority5 - medium
Created bycamel camel
Created on2011/03/23 13:02
Assigned toRalf Becker
Summary#2908 - async call to boupdate.update - possible with small changes …
hi, i want to add via async cron job an event:

so there are few changes neccesary - or maybe i don’t know how to do it in better form …

i insert a new line in db egw_async like this:

NEUER EINTRAG id mit 0
cal:3992:0 1300827660 i:1300827660; calendar.calendar_boupdate.update a:6:{s:2:“id”;i:0;s:3:“uid”;s:15:“uid-CAMEL-test1”;s:5:“start”;i:1300827660;s:3:“end”;i:1300831260;s:5:“owner”;i:5018;s:5:“title”;s:25:“CAMELTEST5678901234567890”;};b:1;b:1;b:1;b:1;a:0{} 5018

EDIT von id 14828
cal:3992:0 1300827660 i:1300827660; calendar.calendar_boupdate.update a:6:{s:2:“id”;i:14828;s:3:“uid”;s:15:“uid-CAMEL-test1”;s:5:“start”;i:1300827660;s:3:“end”;i:1300831260;s:5:“owner”;i:5018;s:5:“title”;s:25:“CAMELTEST5678901234567890”;};b:1;b:1;b:1;b:1;a:0{} 5018

EDIT INKL: modifier auf 999999
cal:3992:0 1300827660 i:1300827660; calendar.calendar_boupdate.update a:7:{s:2:“id”;i:14828;s:3:“uid”;s:15:“uid-CAMEL-test1”;s:5:“start”;i:1300827660;s:3:“end”;i:1300831260;s:5:“owner”;i:5018;s:5:“title”;s:25:“TEST1TEST5678901234567890”;s:8:“modifier”;i:999999;} 5018

now i need only a call so i call the API -> calendar.calendar_boupdate.update
but, the parameter for call_userfunc() seems to be then not correct.
so, i made few changes to API

(@devels, maybe you can do this in a clean way ?)
##############################################################
//(here my very dirty simply changes)

common_functions.inc.php [----] 0 L:[872+14 886/1571] *(22776/43896b) 0101 0x065
{
$GLOBALS[$classname] = CreateObject($appname.’.’.$classname);
}
}

    if (!method_exists($GLOBALS[$classname],$functionname))
    {
        echo "".function_backtrace().": no methode '$functionname' in class '$classname'\n";
        return False;
    }
    $method = array($GLOBALS[$classname],$functionname);
}
if (is_callable($method))
{
  •    if (($classname.$functionname  == "calendar_boupdateupdate"))
    
  •    {
    
  •        return $GLOBALS[$classname]->$functionname($functionparam,true,true,true,true);
    
  •    }
    

######################################
// i like to change the modifier, if it will be done via async, so i want to use my own, but this is not possible yet, because this will always set to “this->user”.
(devel: maybe this can be changed in api code ?

class.calendar_boupdate.inc.php [----] 0 L:[361+31 392/2414] *(14674/77827b) 0009 0x009
$this->debug_message(‘calendar_boupdate::update() %1 conflicts found %2’,false,count($conf
}
return $conflicts;
}
}

    // save the event to the database
    if ($touch_modified)
    {
        $event['modified'] = $this->now_su; // we are still in user-time
  •        if (!$event['modifier'])
    
  •        {
    
  •            $event['modifier'] = $this->user;
    
  •        }
      }
      //echo "saving $event[id]="; _debug_array($event);
      $event2save = $event;
    

Comment by camel camel at 2011/07/12 23:58:
is there another way ?
Comment by camel camel at 2011/03/30 04:24:
FYI:
well, now with my small modification it is possible to insert an calendar item … (BUT alarms, don’T know why it doesn’T work …)

i use this format…

if i create an event with alarm i can see (via array2string) this one:

Array([view] => [hide_delete] => [edit_single] => [reference] => [recurrence] => [actual_date] => [no_popup] => [tabs] => calendar.edit.alarms[template] => calendar.edit[participants] => Array([12029] => ACHAIR)[participant_types] => Array([u] => Array([12029] => ACHAIR))[owner] => 12029[start] => 1302076800[end] => 1302080400[tzid] => Europe/Vienna[priority] => 2[public] => 1[alarm] => Array([1] => Array([offset] => 1800[time] => 1302075000[all] => 1[owner] => 12029[id] => 1))[whole_day] => [link_to] => Array([to_id] => [to_app] => calendar[title] => [anz_links] => 0[app] => addressbook[link_type] => [query] => [file] => Array()[comment] => 0[id] => [remark] => [button] => )[msg] => [title] => Test mit Termin[location] => [non_blocking] => [category] => [description] => [recur_type] => 0[recur_interval] => [recur_enddate] =>
[recur_data] => 0[before_after] => 0),ignoreconflict=

Array(
[view] =>
[hide_delete] =>
[edit_single] =>
[reference] =>
[recurrence] =>
[actual_date] =>
[no_popup] =>
[tabs] => calendar.edit.alarms
[template] => calendar.edit
[participants] => Array(
[12029] => ACHAIR
)
[participant_types] => Array(
[u] => Array(
[12029] => ACHAIR
)
)
[owner] => 12029
[start] => 1302076800
[end] => 1302080400
[tzid] => Europe/Vienna
[priority] => 2
[public] => 1
[alarm] => Array(
[1] => Array(
[offset] => 1800
[time] => 1302075000
[all] => 1
[owner] => 12029
[id] => 1
)
)
[whole_day] =>
[link_to] => Array(
[to_id] =>
[to_app] => calendar
[title] =>
[anz_links] => 0
[app] => addressbook
[link_type] =>
[query] =>
[file] => Array(
)
[comment] => 0
[id] =>
[remark] =>
[button] =>
)
[msg] =>
[title] => Test mit Termin
[location] =>
[non_blocking] =>
[category] =>
[description] =>
[recur_type] => 0
[recur_interval] =>
[recur_enddate] =>
[recur_data] => 0
[before_after] => 0
)
###########
i can do it without calendar like this form in async table:

cal:ion-22521:1301451251 1301451251 i:1301451251; calendar.calendar_boupdate.update a:11:{s:2:"id";i:0;s:3:"uid";s:34:"ion-22521-c-A001001078490000000015";s:8:"modifier";i:999999;s:5:"title";s:6:"Test Z";s:8:"location";s:0:"";s:11:"description";s:12:"Art:Beratung";s:8:"priority";i:2;s:6:"public";i:1;s:5:"owner";i:12029;s:5:"start";i:1303128900;s:3:"end";i:1303136100;} 12029

but how can i do it with alarms ?
therefore i need a double array, and i’m not sure if this is possible to translate in API ??? is it ?

normally the format for events with alarm is:

but, don’T know how to write this tripple-array in async format ?

ralf any help ?
maybe only the format is wrong ?

Sent By:Linux fpm3.farm03.stylite.de 2.6.18-238.5.1.el5.centos.plus #1 SMP Mon Apr 4 18:19:56 EDT 2011 x86_64
Linked entries:
https://community.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2908&no_popup=1