'."\n");
diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php
index 3b38aba3159..d60d370172d 100644
--- a/htdocs/cashdesk/tpl/validation1.tpl.php
+++ b/htdocs/cashdesk/tpl/validation1.tpl.php
@@ -41,8 +41,7 @@ $langs->loadLangs(array("main", "bills", "banks"));
if ($obj_facturation->montantTva()) {
echo ('
'.$langs->trans("VAT").' '.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).' ');
}
-else
-{
+else {
echo ('
'.$langs->trans("VAT").' '.$langs->trans("NoVAT").' ');
}
?>
diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php
index bc67350bbf1..a7a938fd828 100644
--- a/htdocs/cashdesk/validation_verif.php
+++ b/htdocs/cashdesk/validation_verif.php
@@ -97,8 +97,7 @@ switch ($action)
$obj_facturation->montantRendu($encaisse - $total);
}
- else
- {
+ else {
//$txtDatePaiement=$_POST['txtDatePaiement'];
$datePaiement = dol_mktime(0, 0, 0, $_POST['txtDatePaiementmonth'], $_POST['txtDatePaiementday'], $_POST['txtDatePaiementyear']);
$txtDatePaiement = dol_print_date($datePaiement, 'dayrfc');
@@ -253,16 +252,14 @@ switch ($action)
}
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
$id = $invoice->id;
}
- else
- {
+ else {
$resultcreate = $invoice->create($user, 0, 0);
if ($resultcreate > 0)
{
@@ -331,14 +328,12 @@ switch ($action)
}
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
}
- else
- {
+ else {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;
}
@@ -350,8 +345,7 @@ switch ($action)
$db->commit();
$redirection = 'affIndex.php?menutpl=validation_ok&facid='.$id; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
}
- else
- {
+ else {
$db->rollback();
$redirection = 'affIndex.php?facid='.$id.'&error=1&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr
}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 716e02ae678..8a4018a5458 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -173,8 +173,7 @@ if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes')
{
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
}
- else
- {
+ else {
if ($id > 0) {
//$object->fetch($id);
if (!empty($object->socpeopleassigned)) {
@@ -243,8 +242,7 @@ if (empty($reshook) && $action == 'add')
$action = 'create';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
- else
- {
+ else {
$object->type_code = GETPOST('actioncode', 'aZ09');
}
@@ -263,8 +261,7 @@ if (empty($reshook) && $action == 'add')
{
$object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs));
}
- else
- {
+ else {
if ($langs->trans("Action".$object->type_code) != "Action".$object->type_code)
{
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
@@ -394,14 +391,12 @@ if (empty($reshook) && $action == 'add')
{
header("Location: ".DOL_URL_ROOT.'/comm/action/card.php?id='.$idaction.($moreparam ? '&'.$moreparam : ''));
}
- else
- {
+ else {
header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'.($moreparam ? '?'.$moreparam : ''));
}
exit;
}
- else
- {
+ else {
// If error
$db->rollback();
$langs->load("errors");
@@ -410,8 +405,7 @@ if (empty($reshook) && $action == 'add')
$action = 'create'; $donotclearsession = 1;
}
}
- else
- {
+ else {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create'; $donotclearsession = 1;
@@ -517,8 +511,7 @@ if (empty($reshook) && $action == 'update')
$action = 'edit';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
- else
- {
+ else {
$result = $cactioncomm->fetch(GETPOST('actioncode', 'aZ09'));
}
if (empty($object->userownerid))
@@ -607,8 +600,7 @@ if (empty($reshook) && $action == 'update')
$db->commit();
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
}
@@ -646,8 +638,7 @@ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes
header("Location: index.php");
exit;
}
- else
- {
+ else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -756,8 +747,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
header("Location: ".$backtopage);
exit;
}
- else
- {
+ else {
$action = '';
}
}
@@ -957,8 +947,7 @@ if ($action == 'create')
$percent = -1;
if (isset($_GET['status']) || isset($_POST['status'])) $percent = GETPOST('status');
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent = GETPOST('percentage');
- else
- {
+ else {
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent = '0';
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent = 100;
}
@@ -981,8 +970,7 @@ if ($action == 'create')
$listofuserid[$user->id]['transparency'] = GETPOSTISSET('transparency') ?GETPOST('transparency', 'alpha') : 1; // 1 by default at first init
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1035,8 +1023,7 @@ if ($action == 'create')
print $societe->getNomUrl(1);
print '
';
}
- else
- {
+ else {
$events = array();
$events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company
@@ -1266,8 +1253,7 @@ if ($id > 0)
{
$formactions->select_type_actions(GETPOST("actioncode", 'aZ09') ?GETPOST("actioncode", 'aZ09') : $object->type_code, "actioncode", "systemauto");
}
- else
- {
+ else {
print '
'.$langs->trans("Action".$object->type_code);
}
print '';
@@ -1398,8 +1384,7 @@ if ($id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1523,8 +1508,7 @@ if ($id > 0)
print '';
}
- else
- {
+ else {
print '
';
print dolGetElementUrl($object->fk_element, $object->elementtype, 1);
print ' ';
@@ -1564,8 +1548,7 @@ if ($id > 0)
print '';
}
- else
- {
+ else {
dol_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action');
@@ -1709,8 +1692,7 @@ if ($id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -1797,8 +1779,7 @@ if ($id > 0)
}
}
}
- else
- {
+ else {
print ''.$langs->trans("None").' ';
}
print ' ';
@@ -1856,8 +1837,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
@@ -1866,8 +1846,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
@@ -1876,8 +1855,7 @@ if ($id > 0)
{
print '
';
}
- else
- {
+ else {
print '
';
}
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 3c060ffdc39..2c21f311e5d 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -423,8 +423,7 @@ class ActionComm extends CommonObject
$this->error = 'Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
return -1;
}
- else
- {
+ else {
$this->error = $cactioncomm->error;
return -1;
}
@@ -579,14 +578,12 @@ class ActionComm extends CommonObject
$this->db->commit();
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -651,8 +648,7 @@ class ActionComm extends CommonObject
$this->db->commit();
return $this->id;
}
- else
- {
+ else {
$this->db->rollback();
return -1;
}
@@ -767,8 +763,7 @@ class ActionComm extends CommonObject
}
$this->db->free($resql);
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -814,8 +809,7 @@ class ActionComm extends CommonObject
return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
return -1;
}
@@ -869,8 +863,7 @@ class ActionComm extends CommonObject
return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
return -1;
}
@@ -953,14 +946,12 @@ class ActionComm extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
return -2;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -1107,15 +1098,13 @@ class ActionComm extends CommonObject
$this->db->commit();
return 1;
}
- else
- {
+ else {
$this->db->rollback();
dol_syslog(get_class($this)."::update ".join(',', $this->errors), LOG_ERR);
return -2;
}
}
- else
- {
+ else {
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
@@ -1175,8 +1164,7 @@ class ActionComm extends CommonObject
$db->free($resql);
return $resarray;
}
- else
- {
+ else {
return $db->lasterror();
}
}
@@ -1236,8 +1224,7 @@ class ActionComm extends CommonObject
if (empty($load_state_board)) return $response;
else return 1;
}
- else
- {
+ else {
dol_print_error($this->db);
$this->error = $this->db->error();
return -1;
@@ -1288,8 +1275,7 @@ class ActionComm extends CommonObject
}
$this->db->free($result);
}
- else
- {
+ else {
dol_print_error($this->db);
}
}
@@ -1426,8 +1412,7 @@ class ActionComm extends CommonObject
$url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id;
elseif ($option == 'holiday')
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
- else
- $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
+ else $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
@@ -1451,8 +1436,7 @@ class ActionComm extends CommonObject
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle = $labeltype;
$libelleshort = '';
}
- else
- {
+ else {
$libelle = (empty($this->libelle) ? $label : $this->libelle.(($label && $label != $this->libelle) ? ' '.$label : ''));
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle = $labeltype;
if ($maxlength < 0) $libelleshort = $this->ref;
@@ -1694,8 +1678,7 @@ class ActionComm extends CommonObject
$dateend = $this->db->jdate($obj->datep2)
- (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
}
- else
- {
+ else {
// use start date as fall-back to avoid import erros on empty end date
$dateend = $datestart;
}
@@ -1752,8 +1735,7 @@ class ActionComm extends CommonObject
$eventarray = $hookmanager->resArray;
}
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
@@ -1794,8 +1776,7 @@ class ActionComm extends CommonObject
$timestampStart = dol_stringtotime($obj->date_start." 12:00:00", 0);
$timestampEnd = dol_stringtotime($obj->date_end." 23:59:59", 0);
}
- else
- {
+ else {
$event['fulldayevent'] = true;
$timestampStart = dol_stringtotime($obj->date_start." 00:00:00", 0);
@@ -1830,8 +1811,7 @@ class ActionComm extends CommonObject
// 2 = leave wait for approval
$event['summary'] = $title." - ".$obj->lastname." (wait for approval)";
}
- else
- {
+ else {
// 3 = leave approved
$event['summary'] = $title." - ".$obj->lastname;
}
@@ -1857,8 +1837,7 @@ class ActionComm extends CommonObject
$desc = $more;
$desc .= ' ('.$mysoc->name.' - built by Dolibarr)';
}
- else
- {
+ else {
$title = 'Dolibarr actions '.$mysoc->name;
$desc = $langs->transnoentities('ListOfActions');
$desc .= ' ('.$mysoc->name.' - built by Dolibarr)';
@@ -1876,16 +1855,14 @@ class ActionComm extends CommonObject
if ($result >= 0)
{
if (dol_move($outputfiletmp, $outputfile, 0, 1)) $result = 1;
- else
- {
+ else {
$this->error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
dol_syslog(get_class($this)."::build_exportfile ".$this->error, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$result = -1;
}
}
- else
- {
+ else {
dol_syslog(get_class($this)."::build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
dol_delete_file($outputfiletmp, 0, 1);
$langs->load("errors");
diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index c8041c4ea16..d3e4f93b5f7 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -105,14 +105,12 @@ class CActionComm
$this->db->free($resql);
return 1;
}
- else
- {
+ else {
$this->db->free($resql);
return 0;
}
}
- else
- {
+ else {
$this->error = $this->db->error();
return -1;
}
@@ -209,8 +207,7 @@ class CActionComm
if ($idorcode == 'code') $this->liste_array = $repcode;
return $this->liste_array;
}
- else
- {
+ else {
$this->error = $this->db->lasterror();
return -1;
}
diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php
index e985b8ea09e..2b74c4793d9 100644
--- a/htdocs/comm/action/class/ical.class.php
+++ b/htdocs/comm/action/class/ical.class.php
@@ -187,8 +187,7 @@ class ICal
$tmpkey = $key;
$tmpvalue = $tmpvalue.preg_replace('/=$/', "", $value); // We must wait to have next line to have complete message
}
- else
- {
+ else {
$value = quotedPrintDecode(preg_replace('/^ENCODING=QUOTED-PRINTABLE:/i', '', $tmpvalue.$value));
}
} //$value=quotedPrintDecode($tmpvalue.$value);
@@ -237,8 +236,7 @@ class ICal
{
list($key, $value) = array($key, $value);
}
- else
- {
+ else {
list($key, $value) = $this->ical_dt_date($key, $value);
}
}
@@ -378,8 +376,7 @@ class ICal
usort($temp, array(&$this, "ical_dtstart_compare"));
return $temp;
}
- else
- {
+ else {
return false;
}
}
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 9e770f70a93..3bd141ca964 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -216,8 +216,7 @@ if ($object->id > 0)
}
$_SESSION['assignedtouser'] = json_encode($listofuserid);
}
- else
- {
+ else {
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid = json_decode($_SESSION['assignedtouser'], true);
@@ -264,8 +263,7 @@ if ($object->id > 0)
$param = '&id='.$object->id;
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
}
-else
-{
+else {
print $langs->trans("ErrorUnknown");
}
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index b480586bc6a..7b45b3f6ceb 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -96,8 +96,7 @@ if (GETPOST('search_actioncode', 'array'))
$actioncode = GETPOST('search_actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -466,7 +465,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$s = $hookmanager->resPrint;
}
}
-else // If javascript off
+else // If javascript off
{
$newparam = $param; // newparam is for birthday links
$newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday='.(empty($showbirthday) ? 1 : 0), $newparam);
@@ -512,24 +511,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND ca.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -554,8 +549,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7))."'"; // Start 7 days before
@@ -652,8 +646,7 @@ if ($resql)
{
// This record is out of visible range
}
- else
- {
+ else {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar = $firstdaytoshow;
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar = ($lastdaytoshow - 1);
@@ -666,8 +659,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -684,8 +676,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -702,8 +693,7 @@ if ($showbirthday)
$sql .= ' AND MONTH(birthday) = '.$month;
$sql .= ' AND DAY(birthday) = '.$day;
}
- else
- {
+ else {
$sql .= ' AND MONTH(birthday) = '.$month;
}
$sql .= ' ORDER BY birthday';
@@ -741,8 +731,7 @@ if ($showbirthday)
$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
@@ -751,8 +740,7 @@ if ($showbirthday)
$i++;
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -822,8 +810,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
}
- else
- {
+ else {
$event->label = $obj->lastname;
}
@@ -832,8 +819,7 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
$jour = date('d', $event->date_start_in_calendar);
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
@@ -903,8 +889,7 @@ if (count($listofextcals))
// datecurstart and datecurend are now GMT date
//var_dump($datecurstart); var_dump($datecurend); exit;
}
- else
- {
+ else {
// Not a recongized record
dol_syslog("Found a not recognized repeatable record with unknown date start", LOG_ERR);
continue;
@@ -929,8 +914,7 @@ if (count($listofextcals))
$newevent['DTSTART;VALUE=DATE'] = dol_print_date($datecurstart, '%Y%m%d');
$newevent['DTEND;VALUE=DATE'] = dol_print_date($datecurend + 1, '%Y%m%d');
}
- else
- {
+ else {
$newevent['DTSTART'] = $datecurstart;
$newevent['DTEND'] = $datecurend;
}
@@ -1067,8 +1051,7 @@ if (count($listofextcals))
//print 'x'.$datestart.'-'.$dateend;exit;
// This record is out of visible range
}
- else
- {
+ else {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar = $firstdaytoshow;
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar = ($lastdaytoshow - 1);
@@ -1083,8 +1066,7 @@ if (count($listofextcals))
// daykey must be date that represent day box in calendar so must be a user time
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, true, 0);
- do
- {
+ do {
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24; $daykeygmt += 60 * 60 * 24; // Add one day
@@ -1201,8 +1183,7 @@ if (empty($action) || $action == 'show_month') // View by month
echo " \n";
}
/* Show days after the current month (next month) */
- else
- {
+ else {
$style = 'cal_other_month';
if ($iter_day == 6) $style .= ' cal_other_month_right';
echo '
';
@@ -1275,7 +1256,7 @@ elseif ($action == 'show_week') // View by week
echo ' ';
echo ' ';
}
-else // View by day
+else // View by day
{
$newparam = $param; // newparam is for birthday links
$newparam = preg_replace('/action=show_month&?/i', '', $newparam);
@@ -1350,8 +1331,7 @@ else // View by day
print '';
}
- else
- {
+ else {
print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0);
@@ -1490,8 +1470,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unmovable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
@@ -1516,8 +1495,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -1580,8 +1558,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
print 'border: 2px solid #'.$colortouse.';';
}
- else
- {
+ else {
print 'background: #'.$colortouse.';';
print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($colortouse, -3).'), to(#'.dol_color_minus($colortouse, -1).'));';
}
@@ -1649,8 +1626,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange .= dol_print_date($event->date_end_in_calendar, '%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
}
}
- else
- {
+ else {
if ($showinfo)
{
print $langs->trans("EventOnFullDay")." \n";
@@ -1755,8 +1731,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '
'."\n";
$i++;
}
- else
- {
+ else {
print 'global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -279,24 +278,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND c.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND c.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND c.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND c.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND c.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -699,8 +694,7 @@ if ($resql)
$contactstatic->country_id = $obj->country_id;
print $contactstatic->getNomUrl(1, '', 0);
}
- else
- {
+ else {
print " ";
}
print ' ';
@@ -751,8 +745,7 @@ if ($resql)
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 6dfbc6c7f9c..bc859ba6d2d 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -94,8 +94,7 @@ if (GETPOST('actioncode', 'array'))
$actioncode = GETPOST('actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -372,18 +371,15 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -407,8 +403,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7))."'"; // Start 7 days before
@@ -491,8 +486,7 @@ if ($resql)
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
}
- else
- {
+ else {
$event->date_start_in_calendar = $datep;
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
@@ -510,8 +504,7 @@ if ($resql)
// This record is out of visible range
unset($event);
}
- else
- {
+ else {
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n";
$event->fetch_userassigned(); // This load $event->userassigned
@@ -527,8 +520,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -545,8 +537,7 @@ if ($resql)
$i++;
}
}
-else
-{
+else {
dol_print_error($db);
}
@@ -827,8 +818,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unsortable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++; $cssclass = 'family_other';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color = $event->type_color;
}
@@ -841,8 +831,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -961,8 +950,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
}
}
}
- else
- {
+ else {
$busy = $event->transparency;
$cases1[$h][$event->id]['busy'] = $busy;
$cases2[$h][$event->id]['busy'] = $busy;
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index f2cce5c8023..da5020cef39 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -95,8 +95,7 @@ if (GETPOST('search_actioncode', 'array'))
$actioncode = GETPOST('search_actioncode', 'array', 3);
if (!count($actioncode)) $actioncode = '0';
}
-else
-{
+else {
$actioncode = GETPOST("search_actioncode", "alpha", 3) ?GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode = (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE);
@@ -431,24 +430,20 @@ if (!empty($actioncode))
{
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if ($actioncode == 'AC_OTH') $sql .= " AND ca.type != 'systemauto'";
if ($actioncode == 'AC_OTH_AUTO') $sql .= " AND ca.type = 'systemauto'";
}
}
- else
- {
+ else {
if ($actioncode == 'AC_NON_AUTO') $sql .= " AND ca.type != 'systemauto'";
elseif ($actioncode == 'AC_ALL_AUTO') $sql .= " AND ca.type = 'systemauto'";
- else
- {
+ else {
if (is_array($actioncode))
{
$sql .= " AND ca.code IN ('".implode("','", $actioncode)."')";
}
- else
- {
+ else {
$sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
@@ -473,8 +468,7 @@ if ($action == 'show_day')
$sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
$sql .= ')';
}
-else
-{
+else {
// To limit array
$sql .= " AND (";
$sql .= " (a.datep BETWEEN '".$db->idate($firstdaytoshow - (60 * 60 * 24 * 2))."'"; // Start 2 day before $firstdaytoshow
@@ -558,8 +552,7 @@ if ($resql)
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
}
- else
- {
+ else {
$event->date_start_in_calendar = $datep;
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar = $datep2;
else $event->date_end_in_calendar = $datep;
@@ -577,8 +570,7 @@ if ($resql)
// This record is out of visible range
unset($event);
}
- else
- {
+ else {
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'
'."\n";
$event->fetch_userassigned(); // This load $event->userassigned
@@ -594,8 +586,7 @@ if ($resql)
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
- do
- {
+ do {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'
';
$eventarray[$daykey][] = $event;
@@ -613,8 +604,7 @@ if ($resql)
}
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
@@ -721,8 +711,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
}
}
/* Use this list to have for all users */
- else
- {
+ else {
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
if ($usergroup > 0) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
@@ -1011,8 +1000,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unsortable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
- else
- {
+ else {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
@@ -1039,8 +1027,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$colorindex = $colorindexused[$idusertouse]; // Color already assigned to this user
}
- else
- {
+ else {
$colorindex = $nextindextouse;
$colorindexused[$idusertouse] = $colorindex;
if (!empty($theme_datacolor[$nextindextouse + 1])) $nextindextouse++; // Prepare to use next color
@@ -1159,8 +1146,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
}
}
- else
- {
+ else {
$busy = $event->transparency;
$cases1[$h][$event->id]['busy'] = $busy;
$cases2[$h][$event->id]['busy'] = $busy;
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 82477d307fc..c3192f2286e 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -203,8 +203,7 @@ if ($resql)
$db->free($resql);
}
-else
-{
+else {
dol_print_error($db);
}
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index 4ff16cd7c03..17eae67eb2e 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -331,8 +331,7 @@ if ($object->id > 0)
{
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 1);
}
- else
- {
+ else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none');
}
print "";
@@ -350,8 +349,7 @@ if ($object->id > 0)
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
}
- else
- {
+ else {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'none');
}
print "";
@@ -371,8 +369,7 @@ if ($object->id > 0)
{
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'fk_account', 1);
}
- else
- {
+ else {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'none');
}
print "";
@@ -479,8 +476,7 @@ if ($object->id > 0)
{
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
}
- else
- {
+ else {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'none');
}
print "";
@@ -518,8 +514,7 @@ if ($object->id > 0)
$adh->ref = $adh->getFullName($langs);
print $adh->getNomUrl(1);
}
- else
- {
+ else {
print '
'.$langs->trans("ThirdpartyNotLinkedToMember").' ';
}
print '';
@@ -547,8 +542,7 @@ if ($object->id > 0)
{
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_prospectlevel, 'prospect_level_id', 1);
}
- else
- {
+ else {
print $object->getLibProspLevel();
}
print "";
@@ -732,8 +726,7 @@ if ($object->id > 0)
print '
';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -818,8 +811,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -961,8 +953,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1022,8 +1013,7 @@ if ($object->id > 0)
print '';
}
}
- else
- {
+ else {
dol_print_error($db);
}
}
@@ -1093,14 +1083,12 @@ if ($object->id > 0)
{
print '