Fix: Minor fixes on xcal export
This commit is contained in:
parent
40b2b3550f
commit
b7679aa5f3
@ -45,7 +45,7 @@ if ($actionsave)
|
||||
|
||||
$db->begin();
|
||||
|
||||
$i+=dolibarr_set_const($db,'MAIN_PASSWORD_VCALEXPORT',trim($_POST["MAIN_PASSWORD_VCALEXPORT"]),'chaine',0);
|
||||
$i+=dolibarr_set_const($db,'MAIN_AGENDA_XCAL_EXPORTKEY',trim($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]),'chaine',0);
|
||||
|
||||
if ($i > 0)
|
||||
{
|
||||
@ -91,7 +91,7 @@ print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print "<td>".$langs->trans("PasswordTogetVCalExport")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_PASSWORD_VCALEXPORT\" value=\"". ($_POST["MAIN_PASSWORD_VCALEXPORT"]?$_POST["MAIN_PASSWORD_VCALEXPORT"]:$conf->global->MAIN_PASSWORD_VCALEXPORT) . "\" size=\"40\"></td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY\" value=\"". ($_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]?$_POST["MAIN_AGENDA_XCAL_EXPORTKEY"]:$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\"></td>";
|
||||
print "<td> </td>";
|
||||
print "</tr>";
|
||||
|
||||
@ -113,10 +113,10 @@ print "<br>";
|
||||
// Show message
|
||||
$message='';
|
||||
$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root);
|
||||
$urlvcal='<a href="'.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').'</a>';
|
||||
$urlvcal='<a href="'.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||
$message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal);
|
||||
$message.='<br>';
|
||||
$urlical='<a href="'.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_PASSWORD_VCALEXPORT?urlencode($conf->global->MAIN_PASSWORD_VCALEXPORT):'...').'</a>';
|
||||
$urlical='<a href="'.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||
$message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical);
|
||||
print info_admin($message);
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ $action=$_POST["action"];
|
||||
// List of all events supported by triggers
|
||||
$eventstolog=array(
|
||||
array('id'=>'USER_LOGIN', 'test'=>1),
|
||||
array('id'=>'USER_LOGIN_FAILED', 'test'=>1),
|
||||
array('id'=>'USER_CREATE', 'test'=>1),
|
||||
array('id'=>'USER_MODIFY', 'test'=>1),
|
||||
array('id'=>'USER_NEW_PASSWORD', 'test'=>1),
|
||||
|
||||
@ -55,6 +55,7 @@ if ($actionsave)
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_DBNAME',trim($_POST["phpwebcalendar_dbname"]),'chaine',0);
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_USER',trim($_POST["phpwebcalendar_user"]),'chaine',0);
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_PASS',trim($_POST["phpwebcalendar_pass"]),'chaine',0);
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_PASSWORD_VCALEXPORT',trim($_POST["PHPWEBCALENDAR_PASSWORD_VCALEXPORT"]),'chaine',0);
|
||||
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_SYNCRO',trim($_POST["phpwebcalendar_syncro"]),'chaine',0);
|
||||
$i+=dolibarr_set_const($db,'PHPWEBCALENDAR_COMPANYCREATE',trim($_POST["phpwebcalendar_companycreate"]),'chaine',0);
|
||||
@ -204,7 +205,7 @@ print '<td>';
|
||||
print ' </td>';
|
||||
print "</tr>";
|
||||
|
||||
print "<tr class=\"impair\">";
|
||||
print "<tr class=\"pair\">";
|
||||
print "<td>".$langs->trans("PasswordTogetVCalExport")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"PHPWEBCALENDAR_PASSWORD_VCALEXPORT\" value=\"". ($_POST["PHPWEBCALENDAR_PASSWORD_VCALEXPORT"]?$_POST["PHPWEBCALENDAR_PASSWORD_VCALEXPORT"]:$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT) . "\" size=\"40\"></td>";
|
||||
print "<td> </td>";
|
||||
@ -312,10 +313,10 @@ print "<br>";
|
||||
// Show message
|
||||
$message='';
|
||||
$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root);
|
||||
$urlvcal='<a href="'.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey=..." target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey=...'.'</a>';
|
||||
$urlvcal='<a href="'.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.'</a>';
|
||||
$message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal);
|
||||
$message.='<br>';
|
||||
$urlical='<a href="'.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey=..." target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey=...'.'</a>';
|
||||
$urlical='<a href="'.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=ical&type=event&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.'</a>';
|
||||
$message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical);
|
||||
print info_admin($message);
|
||||
|
||||
|
||||
@ -33,9 +33,12 @@ require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php');
|
||||
function llxHeader() { print '<html><title>Export agenda cal</title><body>'; }
|
||||
function llxFooter() { print '</body></html>'; }
|
||||
|
||||
// Security check
|
||||
if (! $conf->agenda->enabled)
|
||||
accessforbidden();
|
||||
|
||||
// Check config
|
||||
if (! $conf->agenda->enabled && empty($conf->global->MAIN_PASSWORD_VCALEXPORT))
|
||||
if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY))
|
||||
{
|
||||
$user->getrights();
|
||||
|
||||
|
||||
@ -23,5 +23,6 @@ ViewList=View list
|
||||
ViewCal=View calendar
|
||||
ViewWithPredefinedFilters=View with predefined filters
|
||||
AutoActions=Automatic creation of actions
|
||||
AgendaAutoActionDesc=Define here, actions for which you want Dolibarr to creat automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda.
|
||||
AgendaSetupOtherDesc=This page allows to configure other parameters.
|
||||
AgendaAutoActionDesc=Define here events for which you want Dolibarr to create automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda.
|
||||
AgendaSetupOtherDesc=This page allows to configure other parameters of agenda module.
|
||||
ActionsEvents=Events for which create an action
|
||||
@ -23,5 +23,6 @@ ViewList=Voir liste
|
||||
ViewCal=Voir calendrier
|
||||
ViewWithPredefinedFilters=Vues avec filtres prédéfinis
|
||||
AutoActions=Création automatiques des actions
|
||||
AgendaAutoActionDesc=Définissez dans cet onglet, les actions pour lesquels dolibarr créera automatiquement une tache dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda.
|
||||
AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres.
|
||||
AgendaAutoActionDesc=Définissez dans cet onglet les évènements pour lesquels dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda.
|
||||
AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres du module agenda.
|
||||
ActionsEvents=Evènements pour lesquels creer une action
|
||||
@ -37,7 +37,7 @@ if (! $conf->webcal->enabled)
|
||||
accessforbidden();
|
||||
|
||||
// Check config
|
||||
if (empty($conf->global->PHPWEBCALENDAR_URL))
|
||||
if (empty($conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT))
|
||||
{
|
||||
$user->getrights();
|
||||
|
||||
@ -55,16 +55,14 @@ if (! $webcal->localdb->connected || ! $webcal->localdb->database_selected)
|
||||
llxHeader();
|
||||
if ($webcal->localdb->connected == 1 && $webcal->localdb->database_selected != 1)
|
||||
{
|
||||
print '<div class="error">'.$langs->trans("WebCalTestKo1",$conf->webcal->db->host,$conf->webcal->db->name);
|
||||
print '<br>'.$webcal->localdb->error();
|
||||
print $webcal->localdb->error();
|
||||
print '<br>'.$langs->trans("WebCalCheckWebcalSetup");
|
||||
print "</div>";
|
||||
//$webcal->localdb->close(); Ne pas fermer car la conn de webcal est la meme que dolibarr si parametre host/user/pass identique
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<div class=\"error\">".$langs->trans("WebCalTestKo2",$conf->webcal->db->host,$conf->webcal->db->user);
|
||||
print "<br>".$webcal->localdb->error();
|
||||
print $webcal->localdb->error();
|
||||
print '<br>'.$langs->trans("WebCalCheckWebcalSetup");
|
||||
print "</div>";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user