Skip to content

Commit

Permalink
Sync thirdparties addressbook
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfox committed Mar 15, 2022
1 parent ae328e6 commit 2ce255d
Show file tree
Hide file tree
Showing 6 changed files with 721 additions and 254 deletions.
17 changes: 17 additions & 0 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
'3' => $langs->trans("Sync as calendar events and todo tasks"),
);

$thirdsync_method=array(
'0' => $langs->trans("Not synchonized"),
'1' => $langs->trans("Only thirdparties without contact"),
'2' => $langs->trans("All thirdparties"),
);

$form = new Form($db);
/*
* Actions
Expand All @@ -85,6 +91,10 @@
$db, "CDAV_CONTACT_TAG",
GETPOST('CDAV_CONTACT_TAG', 'text'), 'chaine', 0, '', $conf->entity
);
dolibarr_set_const(
$db, "CDAV_THIRD_SYNC",
GETPOST('CDAV_THIRD_SYNC', 'text'), 'chaine', 0, '', $conf->entity
);
dolibarr_set_const(
$db, "CDAV_SYNC_PAST",
GETPOST('CDAV_SYNC_PAST', 'text'), 'chaine', 0, '', $conf->entity
Expand Down Expand Up @@ -166,6 +176,7 @@

$CDAV_URI_KEY=substr($conf->global->CDAV_URI_KEY,0,8);
$CDAV_CONTACT_TAG=$conf->global->CDAV_CONTACT_TAG;
$CDAV_THIRD_SYNC=$conf->global->CDAV_THIRD_SYNC;
$CDAV_SYNC_PAST=$conf->global->CDAV_SYNC_PAST;
$CDAV_SYNC_FUTURE=$conf->global->CDAV_SYNC_FUTURE;
$CDAV_TASK_SYNC=$conf->global->CDAV_TASK_SYNC;
Expand Down Expand Up @@ -209,6 +220,12 @@
print $form->select_all_categories("contact", $CDAV_CONTACT_TAG, 'CDAV_CONTACT_TAG', 0);
print '</td></tr>'."\n";

print '<tr >';
print '<td align=left><strong>'.$langs->trans("Enable thirdparties sync").'</strong><br/>'.$langs->trans("How to synchronize thirparties").'</td>';
print '<td align=left>';
print $form->selectarray('CDAV_THIRD_SYNC', $thirdsync_method, $CDAV_THIRD_SYNC);
print '</td></tr>'."\n";

print '<tr >';
print '<td align=left><strong>'.$langs->trans("Period to sync").'</strong><br/>'.$langs->trans("Number of days to sync before and after today").'</td>';
print '<td align=left>';
Expand Down
Loading

0 comments on commit 2ce255d

Please sign in to comment.