diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 67adb031427..dcd3d48d323 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -36,10 +36,10 @@ $hookmanager = new HookManager($db); $hookmanager->initHooks(array('membersindex')); // Load translation files required by the page -$langs->loadLangs(array("companies","members")); +$langs->loadLangs(array("companies", "members")); // Security check -$result=restrictedArea($user, 'adherent'); +$result = restrictedArea($user, 'adherent'); /* @@ -117,7 +117,7 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $MemberUpToDate[$objp->fk_adherent_type]=$objp->somme; + $MemberUpToDate[$objp->fk_adherent_type] = $objp->somme; $i++; } $db->free(); @@ -128,12 +128,12 @@ if ($result) print '
'; -if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { // Search contact/address - if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) + if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { - $listofsearchfields['search_member']=array('text'=>'Member'); + $listofsearchfields['search_member'] = array('text'=>'Member'); } if (count($listofsearchfields)) @@ -142,8 +142,8 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print '
'; print ''; - $i=0; - foreach($listofsearchfields as $key => $value) + $i = 0; + foreach ($listofsearchfields as $key => $value) { if ($i == 0) print ''; print ''; @@ -171,33 +171,33 @@ if ($conf->use_javascript_ajax) print ''; print ''; print ''; print '
'.$langs->trans("Search").'
'.$langs->trans("Statistics").'
'; - $SommeA=0; - $SommeB=0; - $SommeC=0; - $SommeD=0; - $total=0; - $dataval=array(); - $datalabels=array(); - $i=0; + $SommeA = 0; + $SommeB = 0; + $SommeC = 0; + $SommeD = 0; + $total = 0; + $dataval = array(); + $datalabels = array(); + $i = 0; foreach ($AdherentType as $key => $adhtype) { - $datalabels[]=array($i,$adhtype->getNomUrl(0, dol_size(16))); - $dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0); - $dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0); - $dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0); - $dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0); - $SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0; - $SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0; - $SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0; - $SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0; + $datalabels[] = array($i, $adhtype->getNomUrl(0, dol_size(16))); + $dataval['draft'][] = array($i, isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0); + $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0); + $dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0); + $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); + $SommeA += isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0; + $SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0; + $SommeC += isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0; + $SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } $total = $SommeA + $SommeB + $SommeC + $SommeD; - $dataseries=array(); - $dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB)); - $dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC)); - $dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD)); - $dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA)); + $dataseries = array(); + $dataseries[] = array($langs->trans("MenuMembersNotUpToDate"), round($SommeB)); + $dataseries[] = array($langs->trans("MenuMembersUpToDate"), round($SommeC)); + $dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD)); + $dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA)); include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); @@ -207,11 +207,11 @@ if ($conf->use_javascript_ajax) $dolgraph->SetType(array('pie')); $dolgraph->setWidth('100%'); $dolgraph->draw('idgraphstatus'); - print $dolgraph->show($total?0:1); + print $dolgraph->show($total ? 0 : 1); print '
'.$langs->trans("Total").''; - print $SommeA+$SommeB+$SommeC+$SommeD; + print $SommeA + $SommeB + $SommeC + $SommeD; print '
'; print '
'; @@ -239,11 +239,11 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - $year=dol_print_date($db->jdate($objp->dateh), "%Y"); - $Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->subscription; - $Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1; - $tot+=$objp->subscription; - $numb+=1; + $year = dol_print_date($db->jdate($objp->dateh), "%Y"); + $Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription; + $Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1; + $tot += $objp->subscription; + $numb += 1; $i++; } } @@ -275,7 +275,7 @@ foreach ($Total as $key=>$value) print "$key"; print "".$Number[$key].""; print "".price($value).""; - print "".price(price2num($value/$Number[$key], 'MT')).""; + print "".price(price2num($value / $Number[$key], 'MT')).""; print "\n"; $i++; } @@ -285,7 +285,7 @@ print ''; print ''.$langs->trans("Total").''; print "".$numb.""; print ''.price($tot).""; -print "".price(price2num($numb>0?($tot/$numb):0, 'MT')).""; +print "".price(price2num($numb > 0 ? ($tot / $numb) : 0, 'MT')).""; print "\n"; print "
"; print "
\n"; @@ -296,18 +296,18 @@ print '
'; /* * Latest modified members */ -$max=5; +$max = 5; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; -$sql.= " a.tms as datem, datefin as date_end_subscription,"; -$sql.= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; -$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; -$sql.= " WHERE a.entity IN (".getEntity('adherent').")"; -$sql.= " AND a.fk_adherent_type = ta.rowid"; -$sql.= $db->order("a.tms", "DESC"); -$sql.= $db->plimit($max, 0); +$sql .= " a.tms as datem, datefin as date_end_subscription,"; +$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; +$sql .= " WHERE a.entity IN (".getEntity('adherent').")"; +$sql .= " AND a.fk_adherent_type = ta.rowid"; +$sql .= $db->order("a.tms", "DESC"); +$sql .= $db->plimit($max, 0); -$resql=$db->query($sql); +$resql = $db->query($sql); if ($resql) { print '
'; @@ -359,18 +359,18 @@ else /* * Last modified subscriptions */ -$max=5; +$max = 5; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; -$sql.= " datefin as date_end_subscription,"; -$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; -$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; -$sql.= " WHERE a.entity IN (".getEntity('adherent').")"; -$sql.= " AND c.fk_adherent = a.rowid"; -$sql.= $db->order("c.tms", "DESC"); -$sql.= $db->plimit($max, 0); +$sql .= " datefin as date_end_subscription,"; +$sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; +$sql .= " WHERE a.entity IN (".getEntity('adherent').")"; +$sql .= " AND c.fk_adherent = a.rowid"; +$sql .= $db->order("c.tms", "DESC"); +$sql .= $db->plimit($max, 0); -$resql=$db->query($sql); +$resql = $db->query($sql); if ($resql) { print '
'; @@ -386,25 +386,25 @@ if ($resql) { $obj = $db->fetch_object($resql); print ''; - $subscriptionstatic->id=$obj->cid; - $subscriptionstatic->ref=$obj->cid; - $staticmember->id=$obj->rowid; - $staticmember->lastname=$obj->lastname; - $staticmember->firstname=$obj->firstname; - if (! empty($obj->fk_soc)) { + $subscriptionstatic->id = $obj->cid; + $subscriptionstatic->ref = $obj->cid; + $staticmember->id = $obj->rowid; + $staticmember->lastname = $obj->lastname; + $staticmember->firstname = $obj->firstname; + if (!empty($obj->fk_soc)) { $staticmember->fk_soc = $obj->fk_soc; $staticmember->fetch_thirdparty(); - $staticmember->name=$staticmember->thirdparty->name; + $staticmember->name = $staticmember->thirdparty->name; } else { - $staticmember->name=$obj->company; + $staticmember->name = $obj->company; } - $staticmember->ref=$staticmember->getFullName($langs); + $staticmember->ref = $staticmember->getFullName($langs); print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(1, 32, 'subscription').''; print ''.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).''; print ''.price($obj->subscription).''; //print ''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; - print ''.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec), 'dayhour').''; + print ''.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').''; print ''; $i++; } @@ -433,10 +433,10 @@ foreach ($AdherentType as $key => $adhtype) { print ''; print ''.$adhtype->getNomUrl(1, dol_size(32)).''; - print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; - print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; - print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; - print ''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; + print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0 ? $MemberToValidate[$key] : '').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; + print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; + print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; + print ''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key] > 0 ? $MembersResiliated[$key] : '').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; print "\n"; } print ''; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 2e1915f780e..477f925f534 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -101,14 +101,14 @@ if ($result) $num = $db->num_rows($result); $i = 0; - $urladd= "&statut=".$statut; + $urladd = "&statut=".$statut; - $selectedfields=''; + $selectedfields = ''; - $newcardbutton=''; + $newcardbutton = ''; if ($user->rights->prelevement->bons->creer) { - $newcardbutton.= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'); + $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php'); } // Lines of title fields @@ -124,18 +124,18 @@ if ($result) print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit); - $moreforfilter=''; + $moreforfilter = ''; print '
'; - print ''."\n"; + print '
'."\n"; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index c016f1e6c02..2aaca08e69b 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -46,8 +46,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="p.datec"; +if (!$sortorder) $sortorder = "DESC"; +if (!$sortfield) $sortfield = "p.datec"; $search_line = GETPOST('search_line', 'alpha'); $search_bon = GETPOST('search_bon', 'alpha'); @@ -55,8 +55,8 @@ $search_code = GETPOST('search_code', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $statut = GETPOST('statut', 'int'); -$bon=new BonPrelevement($db, ""); -$ligne=new LignePrelevement($db, $user); +$bon = new BonPrelevement($db, ""); +$ligne = new LignePrelevement($db, $user); /* @@ -65,11 +65,11 @@ $ligne=new LignePrelevement($db, $user); if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { - $search_line=""; - $search_bon=""; - $search_code=""; - $search_company=""; - $statut=""; + $search_line = ""; + $search_bon = ""; + $search_code = ""; + $search_company = ""; + $statut = ""; } @@ -77,31 +77,31 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' * View */ -$form=new Form($db); +$form = new Form($db); llxHeader('', $langs->trans("WithdrawalsLines")); $sql = "SELECT p.rowid, p.ref, p.statut, p.datec"; -$sql.= " ,f.rowid as facid, f.ref, f.total_ttc"; -$sql.= " , s.rowid as socid, s.nom as name, s.code_client"; -$sql.= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; -$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; -$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; -$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; -$sql.= " , ".MAIN_DB_PREFIX."facture as f"; -$sql.= " , ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE pl.fk_prelevement_bons = p.rowid"; -$sql.= " AND pf.fk_prelevement_lignes = pl.rowid"; -$sql.= " AND pf.fk_facture = f.rowid"; -$sql.= " AND f.fk_soc = s.rowid"; -$sql.= " AND f.entity IN (".getEntity('invoice').")"; -if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($search_line) $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; -if ($search_bon) $sql.= natural_search("p.ref", $search_bon); -if ($search_code) $sql.= natural_search("s.code_client", $search_code); -if ($search_company) $sql.= natural_search("s.nom", $search_company); +$sql .= " ,f.rowid as facid, f.ref, f.total_ttc"; +$sql .= " , s.rowid as socid, s.nom as name, s.code_client"; +$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; +$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; +$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; +$sql .= " , ".MAIN_DB_PREFIX."facture as f"; +$sql .= " , ".MAIN_DB_PREFIX."societe as s"; +$sql .= " WHERE pl.fk_prelevement_bons = p.rowid"; +$sql .= " AND pf.fk_prelevement_lignes = pl.rowid"; +$sql .= " AND pf.fk_facture = f.rowid"; +$sql .= " AND f.fk_soc = s.rowid"; +$sql .= " AND f.entity IN (".getEntity('invoice').")"; +if ($socid) $sql .= " AND s.rowid = ".$socid; +if ($search_line) $sql .= " AND pl.rowid = '".$db->escape($search_line)."'"; +if ($search_bon) $sql .= natural_search("p.ref", $search_bon); +if ($search_code) $sql .= natural_search("s.code_client", $search_code); +if ($search_company) $sql .= natural_search("s.nom", $search_company); -$sql.= $db->order($sortfield, $sortorder); +$sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -116,7 +116,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) } } -$sql.= $db->plimit($limit + 1, $offset); +$sql .= $db->plimit($limit + 1, $offset); $result = $db->query($sql); if ($result) @@ -126,28 +126,28 @@ if ($result) $urladd = "&statut=".$statut; $urladd .= "&search_bon=".$search_bon; - if ($limit > 0 && $limit != $conf->liste_limit) $urladd.='&limit='.urlencode($limit); + if ($limit > 0 && $limit != $conf->liste_limit) $urladd .= '&limit='.urlencode($limit); print"\n\n"; print ''; print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); - $moreforfilter=''; + $moreforfilter = ''; print '
'; - print '
  '; - $searchpicto=$form->showFilterButtons(); + $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'."\n"; + print '
'."\n"; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/core/tools.php b/htdocs/core/tools.php index f598bd31d83..4fe0bb92f2c 100644 --- a/htdocs/core/tools.php +++ b/htdocs/core/tools.php @@ -37,11 +37,11 @@ if ($user->socid > 0) $socid=$user->socid; * View */ -$socstatic=new Societe($db); +$socstatic = new Societe($db); llxHeader("", $langs->trans("Tools"), ""); -$text=$langs->trans("Tools"); +$text = $langs->trans("Tools"); print load_fiche_titre($text, '', 'wrench'); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 281a573353b..24c9b827117 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -62,7 +62,7 @@ $max=3; */ // Update sold -if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete)) +if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { $result = $holiday->updateBalance(); } @@ -73,18 +73,18 @@ if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete)) */ $childids = $user->getAllChildIds(); -$childids[]=$user->id; +$childids[] = $user->id; llxHeader('', $langs->trans('HRMArea')); print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm'); -if (! empty($setupcompanynotcomplete)) +if (!empty($setupcompanynotcomplete)) { $langs->load("errors"); - $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); - print '
'; + $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); + print '
'; llxFooter(); exit; @@ -134,7 +134,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele } -if (! empty($conf->holiday->enabled)) +if (!empty($conf->holiday->enabled)) { if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) { @@ -146,13 +146,13 @@ if (! empty($conf->holiday->enabled)) print ''; print ''; print '
   '; - $searchpicto=$form->showFilterButtons(); + $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; - $out=''; - $typeleaves=$holiday->getTypes(1, 1); - foreach($typeleaves as $key => $val) + $out = ''; + $typeleaves = $holiday->getTypes(1, 1); + foreach ($typeleaves as $key => $val) { $nb_type = $holiday->getCPforUser($user->id, $val['rowid']); $nb_holiday += $nb_type; - $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; + $out .= ' - '.$val['label'].': '.($nb_type ?price2num($nb_type) : 0).'
'; } print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'
'; print $out; @@ -161,7 +161,7 @@ if (! empty($conf->holiday->enabled)) print '

'; } - elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) + elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) { print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'
'; } @@ -287,22 +287,22 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire { $total_ttc = $totalam = $total = 0; - $expensereportstatic=new ExpenseReport($db); - $userstatic=new User($db); + $expensereportstatic = new ExpenseReport($db); + $userstatic = new User($db); while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); - $expensereportstatic->id=$obj->rowid; - $expensereportstatic->ref=$obj->ref; + $expensereportstatic->id = $obj->rowid; + $expensereportstatic->ref = $obj->ref; - $userstatic->id=$obj->uid; - $userstatic->lastname=$obj->lastname; - $userstatic->firstname=$obj->firstname; - $userstatic->email=$obj->email; - $userstatic->login=$obj->login; - $userstatic->statut=$obj->statut; - $userstatic->photo=$obj->photo; + $userstatic->id = $obj->uid; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->email; + $userstatic->login = $obj->login; + $userstatic->statut = $obj->statut; + $userstatic->photo = $obj->photo; print ''; print ''.$expensereportstatic->getNomUrl(1).''; diff --git a/htdocs/index.php b/htdocs/index.php index 37ea818817a..ad4412ad746 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -24,14 +24,14 @@ * \brief Dolibarr home page */ -define('NOCSRFCHECK', 1); // This is main home and login page. We must be able to go on it from another web site. +define('NOCSRFCHECK', 1); // This is main home and login page. We must be able to go on it from another web site. require 'main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // If not defined, we select menu "home" -$_GET['mainmenu']=GETPOST('mainmenu', 'aZ09')?GETPOST('mainmenu', 'aZ09'):'home'; -$action=GETPOST('action', 'aZ09'); +$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ?GETPOST('mainmenu', 'aZ09') : 'home'; +$action = GETPOST('action', 'aZ09'); $hookmanager->initHooks(array('index')); @@ -46,7 +46,7 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete"); exit; } -if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled +if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete"); exit; @@ -54,12 +54,12 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FO if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled) { require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone=GETPOST('areacode', 'aZ09'); - $userid=GETPOST('userid', 'int'); - $boxorder=GETPOST('boxorder', 'aZ09'); - $boxorder.=GETPOST('boxcombo', 'aZ09'); + $zone = GETPOST('areacode', 'aZ09'); + $userid = GETPOST('userid', 'int'); + $boxorder = GETPOST('boxorder', 'aZ09'); + $boxorder .= GETPOST('boxcombo', 'aZ09'); - $result=InfoBox::saveboxorder($db, $zone, $boxorder, $userid); + $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); if ($result > 0) setEventMessages($langs->trans("BoxAdded"), null); } @@ -68,26 +68,26 @@ if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax dis * View */ -if (! is_object($form)) $form=new Form($db); +if (!is_object($form)) $form = new Form($db); // Title -$title=$langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION; -if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE; +$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION; +if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE; llxHeader('', $title); -$resultboxes=FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) +$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) print load_fiche_titre($langs->trans("HomeArea"), $resultboxes['selectboxlist'], 'home'); -if (! empty($conf->global->MAIN_MOTD)) +if (!empty($conf->global->MAIN_MOTD)) { - $conf->global->MAIN_MOTD=preg_replace('//i', '
', $conf->global->MAIN_MOTD); - if (! empty($conf->global->MAIN_MOTD)) + $conf->global->MAIN_MOTD = preg_replace('//i', '
', $conf->global->MAIN_MOTD); + if (!empty($conf->global->MAIN_MOTD)) { - $substitutionarray=getCommonSubstitutionArray($langs); + $substitutionarray = getCommonSubstitutionArray($langs); complete_substitutions_array($substitutionarray, $langs); $texttoshow = make_substitutions($conf->global->MAIN_MOTD, $substitutionarray, $langs); @@ -117,39 +117,39 @@ $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { - $object=new stdClass(); - $parameters=array(); - $action=''; - $reshook=$hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - $boxstatFromHook=$hookmanager->resPrint; + $object = new stdClass(); + $parameters = array(); + $action = ''; + $reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + $boxstatFromHook = $hookmanager->resPrint; if (empty($reshook)) { // Condition to be checked for each display line dashboard - $conditions=array( + $conditions = array( $user->rights->user->user->lire, - ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), - ! empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), - ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), - ! empty($conf->societe->enabled) && $user->rights->societe->contact->lire, - ! empty($conf->adherent->enabled) && $user->rights->adherent->lire, - ! empty($conf->product->enabled) && $user->rights->produit->lire, - ! empty($conf->service->enabled) && $user->rights->service->lire, - ! empty($conf->propal->enabled) && $user->rights->propale->lire, - ! empty($conf->commande->enabled) && $user->rights->commande->lire, - ! empty($conf->facture->enabled) && $user->rights->facture->lire, - ! empty($conf->contrat->enabled) && $user->rights->contrat->lire, - ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, - ! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), - ! empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), - ! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - ! empty($conf->projet->enabled) && $user->rights->projet->lire, - ! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, - ! empty($conf->holiday->enabled) && $user->rights->holiday->read, - ! empty($conf->don->enabled) && $user->rights->don->lire + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS), + !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS), + !empty($conf->societe->enabled) && $user->rights->societe->contact->lire, + !empty($conf->adherent->enabled) && $user->rights->adherent->lire, + !empty($conf->product->enabled) && $user->rights->produit->lire, + !empty($conf->service->enabled) && $user->rights->service->lire, + !empty($conf->propal->enabled) && $user->rights->propale->lire, + !empty($conf->commande->enabled) && $user->rights->commande->lire, + !empty($conf->facture->enabled) && $user->rights->facture->lire, + !empty($conf->contrat->enabled) && $user->rights->contrat->lire, + !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire, + !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), + !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), + !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), + !empty($conf->projet->enabled) && $user->rights->projet->lire, + !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, + !empty($conf->holiday->enabled) && $user->rights->holiday->read, + !empty($conf->don->enabled) && $user->rights->don->lire ); // Class file containing the method load_state_board for each line - $includes=array( + $includes = array( DOL_DOCUMENT_ROOT."/user/class/user.class.php", DOL_DOCUMENT_ROOT."/societe/class/client.class.php", DOL_DOCUMENT_ROOT."/societe/class/client.class.php", @@ -172,7 +172,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) DOL_DOCUMENT_ROOT."/don/class/don.class.php" ); // Name class containing the method load_state_board for each line - $classes=array('User', + $classes = array('User', 'Client', 'Client', 'Fournisseur', @@ -194,7 +194,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'Don' ); // Cle array returned by the method load_state_board for each line - $keys=array('users', + $keys = array('users', 'customers', 'prospects', 'suppliers', @@ -216,7 +216,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'donations' ); // Dashboard Icon lines - $icons=array('user', + $icons = array('user', 'company', 'company', 'company', @@ -238,7 +238,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) 'generic' ); // Translation keyword - $titres=array("Users", + $titres = array("Users", "ThirdPartyCustomersStats", "ThirdPartyProspectsStats", "Suppliers", @@ -260,7 +260,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) "Donations" ); // Dashboard Link lines - $links=array( + $links = array( DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/societe/list.php?type=c&mainmenu=companies', DOL_URL_ROOT.'/societe/list.php?type=p&mainmenu=companies', @@ -308,36 +308,36 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) // Loop and displays each line of table - $boardloaded=array(); + $boardloaded = array(); foreach ($keys as $key=>$val) { if ($conditions[$key]) { $boxstatItem = ''; - $classe=$classes[$key]; + $classe = $classes[$key]; // Search in cache if load_state_board is already realized - if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe])) + if (!isset($boardloaded[$classe]) || !is_object($boardloaded[$classe])) { - include_once $includes[$key]; // Loading a class cost around 1Mb + include_once $includes[$key]; // Loading a class cost around 1Mb - $board=new $classe($db); + $board = new $classe($db); $board->load_state_board($user); - $boardloaded[$classe]=$board; + $boardloaded[$classe] = $board; } else { - $board=$boardloaded[$classe]; + $board = $boardloaded[$classe]; } if (!empty($langfile[$key])) $langs->load($langfile[$key]); - $text=$langs->trans($titres[$key]); - $boxstatItem.=''; - $boxstatItem.='
'; - $boxstatItem.=''.$text.'
'; - $boxstatItem.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; - $boxstatItem.='
'; - $boxstatItem.='
'; + $text = $langs->trans($titres[$key]); + $boxstatItem .= ''; + $boxstatItem .= '
'; + $boxstatItem .= ''.$text.'
'; + $boxstatItem .= ''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).''; + $boxstatItem .= '
'; + $boxstatItem .= '
'; $boxstatItems[$val] = $boxstatItem; } @@ -485,7 +485,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $parameters = array(); $action = ''; $reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray); } @@ -586,7 +586,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { 'dashboardgroup' => $dashboardgroup ); $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, - $action); // Note that $action and $object may have been modified by some hooks + $action); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); } @@ -628,23 +628,23 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $boxwork = ''; $boxwork .= '
'; - $boxwork .= '' . "\n"; + $boxwork .= '
'."\n"; $boxwork .= ''; - $boxwork .= ''; - $boxwork .= '' . "\n"; + $boxwork .= ''."\n"; // Show dashboard $nbworkboardempty = 0; @@ -673,21 +673,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // global stats $globalStatsKey = false; - if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])){ // can be filled by hook + if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])) { // can be filled by hook $globalStatsKey = $groupElement['globalStatsKey']; $groupElement['globalStats'] = array(); - if(in_array($globalStatsKey, $keys)) + if (in_array($globalStatsKey, $keys)) { // get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links $keyIndex = array_search($globalStatsKey, $keys); - $classe=$classes[$keyIndex]; + $classe = $classes[$keyIndex]; if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) { - $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey]?$boardloaded[$classe]->nb[$globalStatsKey]:0; + $groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0; $nbTotal = doubleval($groupElement['globalStats']['total']); - if($nbTotal>=10000){ $nbTotal = round($nbTotal/1000, 2) .'k'; } + if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).'k'; } $groupElement['globalStats']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')'; $groupElement['globalStats']['total'] = $nbTotal; $groupElement['globalStats']['link'] = $links[$keyIndex]; @@ -696,35 +696,35 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } - $openedDashBoard.= '
' . "\n"; - $openedDashBoard.= '
' . "\n"; - $openedDashBoard.= ' '."\n"; - $openedDashBoard.= ' '."\n"; + $openedDashBoard .= '
'."\n"; + $openedDashBoard .= '
'."\n"; + $openedDashBoard .= ' '."\n"; + $openedDashBoard .= ' '."\n"; - if(!empty($groupElement['globalStats'])){ + if (!empty($groupElement['globalStats'])) { $globalStatInTopOpenedDashBoard[] = $globalStatsKey; - $openedDashBoard.= ' '.$nbTotal.''."\n"; + $openedDashBoard .= ' '.$nbTotal.''."\n"; } - $openedDashBoard.= ' '."\n"; - $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= ' '."\n"; + $openedDashBoard .= '
'."\n"; - $openedDashBoard .= ' '.$groupName.'' . "\n"; + $openedDashBoard .= ' '.$groupName.''."\n"; foreach ($boards as $board) { if (!empty($board->labelShort)) { - $infoName = '' . $board->labelShort . ''; + $infoName = ''.$board->labelShort.''; } else { $infoName = $board->label; } $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); - $textLateTitle .= ' (' . $langs->trans("Late") . ' = ' . $langs->trans("DateReference") . ' > ' . $langs->trans("DateToday") . ' ' . (ceil($board->warning_delay) >= 0 ? '+' : '') . ceil($board->warning_delay) . ' ' . $langs->trans("days") . ')'; + $textLateTitle .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; $textLate = ''; if ($board->nbtodolate > 0) { - $textLate .= ' '; - $textLate .= ' ' . $board->nbtodolate; + $textLate .= ' '; + $textLate .= ' '.$board->nbtodolate; $textLate .= ''; } @@ -733,16 +733,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $nbtodClass = 'badge badge-info'; } - $openedDashBoard .= ' ' . $infoName . ' : ' . $board->nbtodo . '' . $textLate . '' . "\n"; + $openedDashBoard .= ' '.$infoName.' : '.$board->nbtodo.''.$textLate.''."\n"; if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { - $openedDashBoard .= '' . $langs->trans('Total') . ' : ' . price($board->total) . ''; + $openedDashBoard .= ''.$langs->trans('Total').' : '.price($board->total).''; } } - $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= '
' . "\n"; - $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= '
'."\n"; + $openedDashBoard .= '
'."\n"; + $openedDashBoard .= '
'."\n"; $openedDashBoard .= "\n"; } } @@ -753,41 +753,41 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $text = ''; if ($totallate > 0) { - $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate", - $totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')'; + $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", + $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; } else { $text = $langs->transnoentitiesnoconv("NoItemLate"); } - $text .= '. ' . $langs->transnoentitiesnoconv("LateDesc"); + $text .= '. '.$langs->transnoentitiesnoconv("LateDesc"); - $weatherDashBoard = '
' . "\n"; - $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard = '
'."\n"; + $weatherDashBoard .= '
'."\n"; $weatherDashBoard .= ' '; $weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50'); - $weatherDashBoard .= ' ' . "\n"; - $weatherDashBoard .= '
' . "\n"; - $weatherDashBoard .= ' ' . $langs->trans('GlobalOpenedElemView') . '' . "\n"; + $weatherDashBoard .= ' '."\n"; + $weatherDashBoard .= '
'."\n"; + $weatherDashBoard .= ' '.$langs->trans('GlobalOpenedElemView').''."\n"; if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { - $weatherDashBoard .= ' ' . $langs->transnoentitiesnoconv("NActionsLate", - price($totallatePercentage) . '%') . '' . "\n"; - $weatherDashBoard .= ' ' . $langs->trans('NActionsLate', - $totalLateNumber) . '' . "\n"; + $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv("NActionsLate", + price($totallatePercentage).'%').''."\n"; + $weatherDashBoard .= ' '.$langs->trans('NActionsLate', + $totalLateNumber).''."\n"; } else { - $weatherDashBoard .= ' ' . $langs->transnoentitiesnoconv("NActionsLate", - $totalLateNumber) . '' . "\n"; + $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv("NActionsLate", + $totalLateNumber).''."\n"; if ($totallatePercentage > 0) { - $weatherDashBoard .= ' ' . $langs->trans('NActionsLate', - price($totallatePercentage) . '%') . '' . "\n"; + $weatherDashBoard .= ' '.$langs->trans('NActionsLate', + price($totallatePercentage).'%').''."\n"; } } - $weatherDashBoard .= '
' . "\n"; - $weatherDashBoard .= '
' . "\n"; - $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= '
'."\n"; + $weatherDashBoard .= '
'."\n"; + $weatherDashBoard .= '
'."\n"; $weatherDashBoard .= "\n"; - $openedDashBoard = $weatherDashBoard . $openedDashBoard; + $openedDashBoard = $weatherDashBoard.$openedDashBoard; } if (!empty($isIntopOpenedDashBoard)) { @@ -810,24 +810,24 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $textlate = $langs->trans("NActionsLate", $board->nbtodolate); - $textlate .= ' (' . $langs->trans("Late") . ' = ' . $langs->trans("DateReference") . ' > ' . $langs->trans("DateToday") . ' ' . (ceil($board->warning_delay) >= 0 ? '+' : '') . ceil($board->warning_delay) . ' ' . $langs->trans("days") . ')'; + $textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; $boxwork .= '
'; $boxwork .= '
'; - $boxwork .= '' . $board->img . ' ' . $board->label . '
'; - $boxwork .= '' . $board->nbtodo . ''; + $boxwork .= ''.$board->img.' '.$board->label.'
'; + $boxwork .= ''.$board->nbtodo.''; if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { - $boxwork .= ' / ' . price($board->total) . ''; + $boxwork .= ' / '.price($board->total).''; } $boxwork .= '
'; if ($board->nbtodolate > 0) { $boxwork .= '
' . $langs->trans("DolibarrWorkBoard") . '
'; + $boxwork .= '
'.$langs->trans("DolibarrWorkBoard").'
'; if ($showweather) { if ($totallate > 0) { - $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate", - $totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')'; + $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", + $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; } else { $text = $langs->transnoentitiesnoconv("NoItemLate"); } - $text .= '. ' . $langs->transnoentitiesnoconv("LateDesc"); + $text .= '. '.$langs->transnoentitiesnoconv("LateDesc"); //$text.=$form->textwithpicto('',$langs->trans("LateDesc")); $options = 'height="24px" style="float: right"'; $boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle'); } $boxwork .= '
'; // End table array of working board + $boxwork .= ''; // End table array of working board $boxwork .= '
'; if (!empty($isIntopOpenedDashBoard)) { print '
'; - print '
' . $openedDashBoard . '
'; + print '
'.$openedDashBoard.'
'; print '
'; } } @@ -898,47 +898,47 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) } } - if(!empty($boxstatFromHook) || !empty($boxstatItems)){ - $boxstat.='
'; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; - $boxstat.=''; + $boxstat .= '
'; - $boxstat.='
'.$langs->trans("DolibarrStateBoard").'
'; - $boxstat.='
'; + if (!empty($boxstatFromHook) || !empty($boxstatItems)) { + $boxstat .= '
'; + $boxstat .= ''; + $boxstat .= ''; + $boxstat .= ''; + $boxstat .= ''; + $boxstat .= ''; - $boxstat.='
'; + $boxstat .= '
'.$langs->trans("DolibarrStateBoard").'
'; + $boxstat .= '
'; - $boxstat.=$boxstatFromHook; + $boxstat .= $boxstatFromHook; - if(is_array($boxstatItems) && count($boxstatItems) > 0) + if (is_array($boxstatItems) && count($boxstatItems) > 0) { - $boxstat.= implode('', $boxstatItems); + $boxstat .= implode('', $boxstatItems); } - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; - $boxstat.='
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; + $boxstat .= '
'; - $boxstat.='
'; - $boxstat.='
'; + $boxstat .= '
'; + $boxstat .= '
'; } } -$boxlist.= '
'; +$boxlist .= '
'; -$boxlist.=$boxstat; -$boxlist.=$resultboxes['boxlistb']; +$boxlist .= $boxstat; +$boxlist .= $resultboxes['boxlistb']; -$boxlist.= '
'; -$boxlist.= "\n"; +$boxlist .= '
'; +$boxlist .= "\n"; -$boxlist.='
'; +$boxlist .= '
'; print $boxlist; @@ -953,15 +953,15 @@ print '
'; // Security warning repertoire install existe (si utilisateur admin) if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { - $message=''; + $message = ''; // Check if install lock file is present - $lockfile=DOL_DATA_ROOT.'/install.lock'; - if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) + $lockfile = DOL_DATA_ROOT.'/install.lock'; + if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) { $langs->load("errors"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); + $message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } // Conf files must be in read only mode @@ -970,7 +970,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) $langs->load("errors"); //$langs->load("other"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); + $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } if ($message) @@ -1021,48 +1021,48 @@ function getWeatherStatus($totallate) $weather = new stdClass(); $weather->picto = ''; - $offset=0; - $factor=10; // By default + $offset = 0; + $factor = 10; // By default $used_conf = !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL'; - $level0=$offset; - $weather->level=0; - if (! empty($conf->global->{$used_conf.'0'})) { - $level0=$conf->global->{$used_conf.'0'}; + $level0 = $offset; + $weather->level = 0; + if (!empty($conf->global->{$used_conf.'0'})) { + $level0 = $conf->global->{$used_conf.'0'}; } - $level1=$offset+1*$factor; - if (! empty($conf->global->{$used_conf.'1'})) { - $level1=$conf->global->{$used_conf.'1'}; + $level1 = $offset + 1 * $factor; + if (!empty($conf->global->{$used_conf.'1'})) { + $level1 = $conf->global->{$used_conf.'1'}; } - $level2=$offset+2*$factor; - if (! empty($conf->global->{$used_conf.'2'})) { - $level2=$conf->global->{$used_conf.'2'}; + $level2 = $offset + 2 * $factor; + if (!empty($conf->global->{$used_conf.'2'})) { + $level2 = $conf->global->{$used_conf.'2'}; } - $level3=$offset+3*$factor; - if (! empty($conf->global->{$used_conf.'3'})) { - $level3=$conf->global->{$used_conf.'3'}; + $level3 = $offset + 3 * $factor; + if (!empty($conf->global->{$used_conf.'3'})) { + $level3 = $conf->global->{$used_conf.'3'}; } - if ($totallate <= $level0){ + if ($totallate <= $level0) { $weather->picto = 'weather-clear.png'; - $weather->level=0; + $weather->level = 0; } - elseif ($totallate <= $level1){ + elseif ($totallate <= $level1) { $weather->picto = 'weather-few-clouds.png'; - $weather->level=1; + $weather->level = 1; } - elseif ($totallate <= $level2){ + elseif ($totallate <= $level2) { $weather->picto = 'weather-clouds.png'; - $weather->level=2; + $weather->level = 2; } - elseif ($totallate <= $level3){ + elseif ($totallate <= $level3) { $weather->picto = 'weather-many-clouds.png'; - $weather->level=3; + $weather->level = 3; } - else{ + else { $weather->picto = 'weather-storm.png'; - $weather->level=4; + $weather->level = 4; } return $weather; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 15c98b4d1fc..cd82f25d4d8 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -95,18 +95,18 @@ print '
'; if ($mine) print $langs->trans("MyProjectsDesc").'

'; else { - if (! empty($user->rights->projet->all->lire) && ! $socid) print $langs->trans("ProjectsDesc").'

'; + if (!empty($user->rights->projet->all->lire) && !$socid) print $langs->trans("ProjectsDesc").'

'; else print $langs->trans("ProjectsPublicDesc").'

'; } print '
'; // Get list of ponderated percent for each status -$listofoppstatus=array(); $listofopplabel=array(); $listofoppcode=array(); +$listofoppstatus = array(); $listofopplabel = array(); $listofoppcode = array(); $sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label"; -$sql.= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls"; -$sql.= " WHERE active=1"; +$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls"; +$sql .= " WHERE active=1"; $resql = $db->query($sql); -if ( $resql ) +if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -114,9 +114,9 @@ if ( $resql ) while ($i < $num) { $objp = $db->fetch_object($resql); - $listofoppstatus[$objp->rowid]=$objp->percent; - $listofopplabel[$objp->rowid]=$objp->label; - $listofoppcode[$objp->rowid]=$objp->code; + $listofoppstatus[$objp->rowid] = $objp->percent; + $listofopplabel[$objp->rowid] = $objp->label; + $listofoppcode[$objp->rowid] = $objp->code; $i++; } } @@ -127,12 +127,12 @@ else dol_print_error($db); print '
'; -if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo { // Search project - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) + if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { - $listofsearchfields['search_project']=array('text'=>'Project'); + $listofsearchfields['search_project'] = array('text'=>'Project'); } if (count($listofsearchfields)) @@ -141,8 +141,8 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print '
'; print ''; - $i=0; - foreach($listofsearchfields as $key => $value) + $i = 0; + foreach ($listofsearchfields as $key => $value) { if ($i == 0) print ''; print ''; @@ -173,16 +173,16 @@ print '
'; // Latest modified projects $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,"; -$sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas"; -$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; -$sql.= " WHERE p.entity IN (".getEntity('project').")"; -if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 -if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; -$sql.= " ORDER BY p.tms DESC"; -$sql.= $db->plimit($max, 0); +$sql .= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.canvas"; +$sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; +$sql .= " WHERE p.entity IN (".getEntity('project').")"; +if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 +if ($socid) $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; +$sql .= " ORDER BY p.tms DESC"; +$sql .= $db->plimit($max, 0); -$resql=$db->query($sql); +$resql = $db->query($sql); if ($resql) { print '
'; @@ -202,21 +202,21 @@ if ($resql) print '
'; print '\n"; $sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)"; -$sql.= ", s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; -$sql.= " WHERE p.entity IN (".getEntity('project').")"; -$sql.= " AND p.fk_statut = 1"; -if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 -if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; -$sql.= " GROUP BY s.nom, s.rowid"; -$sql.= $db->order($sortfield, $sortorder); +$sql .= ", s.nom as name, s.rowid as socid"; +$sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; +$sql .= " WHERE p.entity IN (".getEntity('project').")"; +$sql .= " AND p.fk_statut = 1"; +if ($mine || empty($user->rights->projet->all->lire)) $sql .= " AND p.rowid IN (".$projectsListId.")"; // If we have this test true, it also means projectset is not 2 +if ($socid) $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; +$sql .= " GROUP BY s.nom, s.rowid"; +$sql .= $db->order($sortfield, $sortorder); $resql = $db->query($sql); -if ( $resql ) +if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -289,8 +289,8 @@ if ( $resql ) print '
'.$langs->trans("Search").'
'; - $projectstatic->id=$obj->rowid; - $projectstatic->ref=$obj->ref; - $projectstatic->title=$obj->title; - $projectstatic->dateo=$obj->dateo; - $projectstatic->datep=$obj->datep; - $projectstatic->thirdparty_name=$obj->name; + $projectstatic->id = $obj->rowid; + $projectstatic->ref = $obj->ref; + $projectstatic->title = $obj->title; + $projectstatic->dateo = $obj->dateo; + $projectstatic->datep = $obj->datep; + $projectstatic->thirdparty_name = $obj->name; - $companystatic->id=$obj->socid; - $companystatic->name=$obj->name; - $companystatic->email=$obj->email; - $companystatic->client=$obj->client; - $companystatic->fournisseur=$obj->fournisseur; - $companystatic->code_client=$obj->code_client; - $companystatic->code_fournisseur=$obj->code_fournisseur; - $companystatic->canvas=$obj->canvas; + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->email = $obj->email; + $companystatic->client = $obj->client; + $companystatic->fournisseur = $obj->fournisseur; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->canvas = $obj->canvas; print ''; print ''; print '
'; @@ -228,9 +228,9 @@ if ($resql) print ''; - $filename=dol_sanitizeFileName($obj->ref); - $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($projectstatic->element, $filename, $filedir); print '
'; @@ -253,7 +253,7 @@ if ($resql) else dol_print_error($db); -$companystatic=new Societe($db); // We need a clean new object for next loop because current one has some properties set. +$companystatic = new Societe($db); // We need a clean new object for next loop because current one has some properties set. // Open project per thirdparty @@ -265,18 +265,18 @@ print_liste_field_titre("NbOfProjects", "", "", "", "", '', $sortfield, $sortord print "
'; if ($obj->socid) { - $companystatic->id=$obj->socid; - $companystatic->name=$obj->name; + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; print $companystatic->getNomUrl(1); } else @@ -316,7 +316,7 @@ else print "
"; print '
'; -if (! empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA)) +if (!empty($conf->global->PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA)) { // This list can be very long, so we don't show it by default on task area. We prefer to use the list page. // Add constant PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA to show this list diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index ee936015352..d1a0c3775a0 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -23,7 +23,7 @@ * \brief Setup page for TakePos module */ -require '../../main.inc.php'; // Load $user and permissions +require '../../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -49,9 +49,9 @@ if (GETPOST('action', 'alpha') == 'set') dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); - if (! $res > 0) $error++; + if (!$res > 0) $error++; - if (! $error) + if (!$error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -68,12 +68,12 @@ if (GETPOST('action', 'alpha') == 'set') * View */ -$form=new Form($db); -$formproduct=new FormProduct($db); +$form = new Form($db); +$formproduct = new FormProduct($db); llxHeader('', $langs->trans("CashDeskSetup")); -$linkback=''.$langs->trans("BackToModuleList").''; +$linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); $head = takepos_prepare_head(); dol_fiche_head($head, 'receipt', 'TakePOS', -1); @@ -81,7 +81,7 @@ print '
'; // Mode -print ''; +print ''; print ''; print ''; @@ -90,16 +90,16 @@ print ''; print ''.$langs->trans("Parameters").''.$langs->trans("Value").''; print "\n"; -$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); -$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2); +$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); $htmltext = ''.$langs->trans("AvailableVariables").':
'; -foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; -$htmltext.='
'; +foreach ($substitutionarray as $key => $val) $htmltext .= $key.'
'; +$htmltext .= ''; print ''; print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; print ''; -$variablename='TAKEPOS_HEADER'; +$variablename = 'TAKEPOS_HEADER'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; @@ -107,7 +107,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print "\n"; @@ -115,7 +115,7 @@ print "\n"; print ''; print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; print ''; -$variablename='TAKEPOS_FOOTER'; +$variablename = 'TAKEPOS_FOOTER'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { print ''; @@ -123,13 +123,13 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print "\n"; print ''; -print ''; +print ''; print ''; // Customer information diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 947cee547b0..5995489184d 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -22,7 +22,7 @@ * \brief Setup page for TakePos module */ -require '../../main.inc.php'; // Load $user and permissions +require '../../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php"; // If socid provided by ajax company selector -if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) +if (!empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) { $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); @@ -62,7 +62,7 @@ if ($resql) { if (GETPOST('action', 'alpha') == 'set') { $db->begin(); - if (GETPOST('socid', 'int') < 0) $_POST["socid"]=''; + if (GETPOST('socid', 'int') < 0) $_POST["socid"] = ''; $res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity); @@ -135,12 +135,12 @@ print "\n"; print ''; print $langs->trans("NumberOfTerminals"); print ''; -$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9"); -print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS)?'0':$conf->global->TAKEPOS_NUM_TERMINALS), 0); +$array = array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9"); +print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '0' : $conf->global->TAKEPOS_NUM_TERMINALS), 0); print "\n"; // Services -if (! empty($conf->service->enabled)) +if (!empty($conf->service->enabled)) { print ''; print $langs->trans("CashdeskShowServices"); @@ -230,8 +230,8 @@ print "\n"; print ''; print $langs->trans("Paymentnumpad"); print ''; -$array=array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad")); -print $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD)?'0':$conf->global->TAKEPOS_NUMPAD), 0); +$array = array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad")); +print $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD) ? '0' : $conf->global->TAKEPOS_NUMPAD), 0); print "\n"; // Direct Payment diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index bdf38c2bafe..462f9a830b0 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -25,14 +25,14 @@ * \brief Page to show a receipt. */ -require '../main.inc.php'; // Load $user and permissions +require '../main.inc.php'; // Load $user and permissions include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk", "companies")); -$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant -$facid=GETPOST('facid', 'int'); +$facid = GETPOST('facid', 'int'); /* @@ -43,20 +43,20 @@ top_httphead('text/html'); if ($place > 0) { - $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) { - $facid=$obj->rowid; + $facid = $obj->rowid; } } -$object=new Facture($db); +$object = new Facture($db); $object->fetch($facid); // Call to external receipt modules if exist $hookmanager->initHooks(array('takeposfrontend'), $facid); -$reshook=$hookmanager->executeHooks('TakeposReceipt', $parameters, $object); +$reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; exit; @@ -79,7 +79,7 @@ if (!empty($hookmanager->resPrint)) {
-'.$mysoc->name.'';?> +'.$mysoc->name.''; ?>

@@ -87,10 +87,10 @@ if (!empty($hookmanager->resPrint)) { global->TAKEPOS_CUSTOM_RECEIPT) { - $substitutionarray=getCommonSubstitutionArray($langs); - if (! empty($conf->global->TAKEPOS_HEADER)) + $substitutionarray = getCommonSubstitutionArray($langs); + if (!empty($conf->global->TAKEPOS_HEADER)) { - $newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray); + $newfreetext = make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray); echo $newfreetext; } } @@ -185,9 +185,9 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME global->TAKEPOS_CUSTOM_RECEIPT) { - $substitutionarray=getCommonSubstitutionArray($langs); - if (! empty($conf->global->TAKEPOS_FOOTER)){ - $newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray); + $substitutionarray = getCommonSubstitutionArray($langs); + if (!empty($conf->global->TAKEPOS_FOOTER)) { + $newfreetext = make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray); echo $newfreetext; } } diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 59c015b6245..edf40cf2b52 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -1,5 +1,5 @@ +if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> /*