Skip to content

Commit

Permalink
Fix php warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 3, 2025
1 parent a2372c5 commit e3abab2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions htdocs/google/admin/google_calsync.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
$error=0;
$nbdeleted=0;

$userlogin = empty($conf->global->GOOGLE_LOGIN)?'':$conf->global->GOOGLE_LOGIN;
$userlogin = getDolGlobalString('GOOGLE_LOGIN');

// Create client/token object
$key_file_location = $conf->google->multidir_output[$conf->entity]."/" . getDolGlobalString('GOOGLE_API_SERVICEACCOUNT_P12KEY');
Expand Down Expand Up @@ -285,7 +285,7 @@
$error=0;
$nbinserted=0;

$userlogin = empty($conf->global->GOOGLE_LOGIN)?'':$conf->global->GOOGLE_LOGIN;
$userlogin = getDolGlobalString('GOOGLE_LOGIN');

// Create client/token object
$key_file_location = $conf->google->multidir_output[$conf->entity]."/" . getDolGlobalString('GOOGLE_API_SERVICEACCOUNT_P12KEY');
Expand Down Expand Up @@ -369,7 +369,7 @@

if ($action == 'syncfromgoogle') {
$fuser = $user; // $fuser = user for synch
$userlogin = empty($conf->global->GOOGLE_LOGIN)?'':$conf->global->GOOGLE_LOGIN;
$userlogin = getDolGlobalString('GOOGLE_LOGIN');

if (empty($dateminsync)) {
setEventMessage($langs->trans("ErrorBadValueForDate"), 'errors');
Expand Down Expand Up @@ -668,7 +668,7 @@ function initfields()
print '<input type="hidden" name="action" value="syncfromgoogle">';
print $langs->trans("ImportEventsFromGoogle", $max, getDolGlobalString('GOOGLE_LOGIN'))." ";
$now = dol_now() - ($notolderforsync * 24 * 3600);
print $form->selectDate($dateminsync ? $dateminsync : $now, 'sync', 1, 1, 0, '', 1, 0, empty($conf->global->GOOGLE_LOGIN)?1:0);
print $form->selectDate($dateminsync ? $dateminsync : $now, 'sync', 1, 1, 0, '', 1, 0, getDolGlobalString('GOOGLE_LOGIN') ? 0 : 1);
print '<input type="submit" name="getall" class="button small" value="'.$langs->trans("Run").'"';
if (!getDolGlobalString('GOOGLE_LOGIN')) print ' disabled="disabled"';
print '>';
Expand Down
18 changes: 11 additions & 7 deletions htdocs/google/admin/google_calsync_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@

// Liste des zone de recherche permanentes supportees
$searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
$searchformconst=array($object->conf->MAIN_SEARCHFORM_SOCIETE,$object->conf->MAIN_SEARCHFORM_CONTACT,$object->conf->MAIN_SEARCHFORM_PRODUITSERVICE);
$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
$searchformconst=array(
empty($object->conf->MAIN_SEARCHFORM_SOCIETE) ? '' : $object->conf->MAIN_SEARCHFORM_SOCIETE,
empty($object->conf->MAIN_SEARCHFORM_CONTACT) ? '' : $object->conf->MAIN_SEARCHFORM_CONTACT,
empty($object->conf->MAIN_SEARCHFORM_PRODUITSERVICE) ? '' : $object->conf->MAIN_SEARCHFORM_PRODUITSERVICE,
);
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"));

$form = new Form($db);
$formadmin=new FormAdmin($db);
Expand Down Expand Up @@ -184,7 +188,7 @@
$error=0;
$nbdeleted=0;

$userlogin = empty($object->conf->GOOGLE_LOGIN)?'':$object->conf->GOOGLE_LOGIN;
$userlogin = empty($object->conf->GOOGLE_LOGIN) ? '' : $object->conf->GOOGLE_LOGIN;

// Create client/token object
$key_file_location = $conf->google->multidir_output[$conf->entity]."/" . getDolGlobalString('GOOGLE_API_SERVICEACCOUNT_P12KEY');
Expand Down Expand Up @@ -518,7 +522,7 @@

print '<input type="hidden" name="action" value="pushallevents">';
print '<input type="hidden" name="id" value="'.$id.'">';
print $langs->trans("ExportEventsToGoogle", $max, $object->conf->GOOGLE_LOGIN)." ";
print $langs->trans("ExportEventsToGoogle", $max, empty($object->conf->GOOGLE_LOGIN) ? '': $object->conf->GOOGLE_LOGIN)." ";
print '<input type="submit" name="pushall" class="button" value="'.$langs->trans("Run").'"';
if (empty($object->conf->GOOGLE_LOGIN)) print ' disabled="disabled"';
print '>';
Expand All @@ -529,7 +533,7 @@
print '<form name="googleconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="deleteallevents">';
print '<input type="hidden" name="id" value="'.$id.'">';
print $langs->trans("DeleteAllGoogleEvents", $object->conf->GOOGLE_LOGIN)." ";
print $langs->trans("DeleteAllGoogleEvents", empty($object->conf->GOOGLE_LOGIN) ? '' : $object->conf->GOOGLE_LOGIN)." ";
print '('.$langs->trans("OperationMayBeLong").') ';
print '<input type="submit" name="cleanup" class="button" value="'.$langs->trans("Run").'"';
if (empty($object->conf->GOOGLE_LOGIN)) print ' disabled="disabled"';
Expand All @@ -543,9 +547,9 @@
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="syncfromgoogle">';
print '<input type="hidden" name="id" value="'.$id.'">';
print $langs->trans("ImportEventsFromGoogle", $max, $object->conf->GOOGLE_LOGIN)." ";
print $langs->trans("ImportEventsFromGoogle", $max, empty($object->conf->GOOGLE_LOGIN) ? '' : $object->conf->GOOGLE_LOGIN)." ";
$now = dol_now() - ($notolderforsync * 24 * 3600);
print $form->selectDate($dateminsync ? $dateminsync : $now, 'sync', 1, 1, 0, '', 1, 0, empty($object->conf->GOOGLE_LOGIN)?1:0);
print $form->selectDate($dateminsync ? $dateminsync : $now, 'sync', 1, 1, 0, '', 1, 0, empty($object->conf->GOOGLE_LOGIN) ? 1 : 0);
print '<input type="submit" name="getall" class="button" value="'.$langs->trans("Run").'"';
if (empty($object->conf->GOOGLE_LOGIN)) print ' disabled="disabled"';
print '>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/google/lib/google_calendar.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function createEvent($client, $object, $login = 'primary')
$urlicon=$urlwithroot.'/favicon.ico';

$source=new Google_Service_Calendar_EventSource();
$source->setTitle($conf->global->MAIN_APPLICATION_TITLE);
$source->setTitle(getDolGlobalString('MAIN_APPLICATION_TITLE'));
$source->setUrl($urlevent);

$event->setSource($source);
Expand Down

0 comments on commit e3abab2

Please sign in to comment.