Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
f5da126cff
commit
f197196719
@ -36,10 +36,10 @@ $hookmanager = new HookManager($db);
|
|||||||
$hookmanager->initHooks(array('membersindex'));
|
$hookmanager->initHooks(array('membersindex'));
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("companies","members"));
|
$langs->loadLangs(array("companies", "members"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user, 'adherent');
|
$result = restrictedArea($user, 'adherent');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -117,7 +117,7 @@ if ($result)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$MemberUpToDate[$objp->fk_adherent_type]=$objp->somme;
|
$MemberUpToDate[$objp->fk_adherent_type] = $objp->somme;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
@ -128,12 +128,12 @@ if ($result)
|
|||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
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
|
// 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))
|
if (count($listofsearchfields))
|
||||||
@ -142,8 +142,8 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
$i=0;
|
$i = 0;
|
||||||
foreach($listofsearchfields as $key => $value)
|
foreach ($listofsearchfields as $key => $value)
|
||||||
{
|
{
|
||||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -171,33 +171,33 @@ if ($conf->use_javascript_ajax)
|
|||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||||
print '<tr><td class="center" colspan="2">';
|
print '<tr><td class="center" colspan="2">';
|
||||||
|
|
||||||
$SommeA=0;
|
$SommeA = 0;
|
||||||
$SommeB=0;
|
$SommeB = 0;
|
||||||
$SommeC=0;
|
$SommeC = 0;
|
||||||
$SommeD=0;
|
$SommeD = 0;
|
||||||
$total=0;
|
$total = 0;
|
||||||
$dataval=array();
|
$dataval = array();
|
||||||
$datalabels=array();
|
$datalabels = array();
|
||||||
$i=0;
|
$i = 0;
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
foreach ($AdherentType as $key => $adhtype)
|
||||||
{
|
{
|
||||||
$datalabels[]=array($i,$adhtype->getNomUrl(0, dol_size(16)));
|
$datalabels[] = array($i, $adhtype->getNomUrl(0, dol_size(16)));
|
||||||
$dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0);
|
$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['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['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0);
|
||||||
$dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0);
|
$dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0);
|
||||||
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
|
$SommeA += isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0;
|
||||||
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0;
|
$SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0;
|
||||||
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
|
$SommeC += isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0;
|
||||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
$SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$total = $SommeA + $SommeB + $SommeC + $SommeD;
|
$total = $SommeA + $SommeB + $SommeC + $SommeD;
|
||||||
$dataseries=array();
|
$dataseries = array();
|
||||||
$dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB));
|
$dataseries[] = array($langs->trans("MenuMembersNotUpToDate"), round($SommeB));
|
||||||
$dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC));
|
$dataseries[] = array($langs->trans("MenuMembersUpToDate"), round($SommeC));
|
||||||
$dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
$dataseries[] = array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
||||||
$dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA));
|
$dataseries[] = array($langs->trans("MembersStatusToValid"), round($SommeA));
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
@ -207,11 +207,11 @@ if ($conf->use_javascript_ajax)
|
|||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
$dolgraph->setWidth('100%');
|
$dolgraph->setWidth('100%');
|
||||||
$dolgraph->draw('idgraphstatus');
|
$dolgraph->draw('idgraphstatus');
|
||||||
print $dolgraph->show($total?0:1);
|
print $dolgraph->show($total ? 0 : 1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
|
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
|
||||||
print $SommeA+$SommeB+$SommeC+$SommeD;
|
print $SommeA + $SommeB + $SommeC + $SommeD;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -239,11 +239,11 @@ if ($result)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$year=dol_print_date($db->jdate($objp->dateh), "%Y");
|
$year = dol_print_date($db->jdate($objp->dateh), "%Y");
|
||||||
$Total[$year]=(isset($Total[$year])?$Total[$year]:0)+$objp->subscription;
|
$Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription;
|
||||||
$Number[$year]=(isset($Number[$year])?$Number[$year]:0)+1;
|
$Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1;
|
||||||
$tot+=$objp->subscription;
|
$tot += $objp->subscription;
|
||||||
$numb+=1;
|
$numb += 1;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ foreach ($Total as $key=>$value)
|
|||||||
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
print "<td><a href=\"./subscription/list.php?date_select=$key\">$key</a></td>";
|
||||||
print "<td class=\"right\">".$Number[$key]."</td>";
|
print "<td class=\"right\">".$Number[$key]."</td>";
|
||||||
print "<td class=\"right\">".price($value)."</td>";
|
print "<td class=\"right\">".price($value)."</td>";
|
||||||
print "<td class=\"right\">".price(price2num($value/$Number[$key], 'MT'))."</td>";
|
print "<td class=\"right\">".price(price2num($value / $Number[$key], 'MT'))."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ print '<tr class="liste_total">';
|
|||||||
print '<td>'.$langs->trans("Total").'</td>';
|
print '<td>'.$langs->trans("Total").'</td>';
|
||||||
print "<td class=\"right\">".$numb."</td>";
|
print "<td class=\"right\">".$numb."</td>";
|
||||||
print '<td class="right">'.price($tot)."</td>";
|
print '<td class="right">'.price($tot)."</td>";
|
||||||
print "<td class=\"right\">".price(price2num($numb>0?($tot/$numb):0, 'MT'))."</td>";
|
print "<td class=\"right\">".price(price2num($numb > 0 ? ($tot / $numb) : 0, 'MT'))."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "</table></div>";
|
print "</table></div>";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -296,18 +296,18 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
/*
|
/*
|
||||||
* Latest modified members
|
* 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 = "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 .= " a.tms as datem, datefin as date_end_subscription,";
|
||||||
$sql.= " ta.rowid as typeid, ta.libelle as label, ta.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 .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
|
||||||
$sql.= " WHERE a.entity IN (".getEntity('adherent').")";
|
$sql .= " WHERE a.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND a.fk_adherent_type = ta.rowid";
|
$sql .= " AND a.fk_adherent_type = ta.rowid";
|
||||||
$sql.= $db->order("a.tms", "DESC");
|
$sql .= $db->order("a.tms", "DESC");
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -359,18 +359,18 @@ else
|
|||||||
/*
|
/*
|
||||||
* Last modified subscriptions
|
* 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 = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||||
$sql.= " datefin as date_end_subscription,";
|
$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 .= " 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 .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c";
|
||||||
$sql.= " WHERE a.entity IN (".getEntity('adherent').")";
|
$sql .= " WHERE a.entity IN (".getEntity('adherent').")";
|
||||||
$sql.= " AND c.fk_adherent = a.rowid";
|
$sql .= " AND c.fk_adherent = a.rowid";
|
||||||
$sql.= $db->order("c.tms", "DESC");
|
$sql .= $db->order("c.tms", "DESC");
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -386,25 +386,25 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
$subscriptionstatic->id=$obj->cid;
|
$subscriptionstatic->id = $obj->cid;
|
||||||
$subscriptionstatic->ref=$obj->cid;
|
$subscriptionstatic->ref = $obj->cid;
|
||||||
$staticmember->id=$obj->rowid;
|
$staticmember->id = $obj->rowid;
|
||||||
$staticmember->lastname=$obj->lastname;
|
$staticmember->lastname = $obj->lastname;
|
||||||
$staticmember->firstname=$obj->firstname;
|
$staticmember->firstname = $obj->firstname;
|
||||||
if (! empty($obj->fk_soc)) {
|
if (!empty($obj->fk_soc)) {
|
||||||
$staticmember->fk_soc = $obj->fk_soc;
|
$staticmember->fk_soc = $obj->fk_soc;
|
||||||
$staticmember->fetch_thirdparty();
|
$staticmember->fetch_thirdparty();
|
||||||
$staticmember->name=$staticmember->thirdparty->name;
|
$staticmember->name = $staticmember->thirdparty->name;
|
||||||
} else {
|
} else {
|
||||||
$staticmember->name=$obj->company;
|
$staticmember->name = $obj->company;
|
||||||
}
|
}
|
||||||
$staticmember->ref=$staticmember->getFullName($langs);
|
$staticmember->ref = $staticmember->getFullName($langs);
|
||||||
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
|
||||||
print '<td>'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>';
|
print '<td>'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>';
|
||||||
print '<td>'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
|
print '<td>'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
|
||||||
print '<td class="right">'.price($obj->subscription).'</td>';
|
print '<td class="right">'.price($obj->subscription).'</td>';
|
||||||
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
||||||
print '<td class="right">'.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec), 'dayhour').'</td>';
|
print '<td class="right">'.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -433,10 +433,10 @@ foreach ($AdherentType as $key => $adhtype)
|
|||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
|
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
|
||||||
print '<td class="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
|
print '<td class="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0 ? $MemberToValidate[$key] : '').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).'</td>';
|
||||||
print '<td class="right">'.(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).'</td>';
|
print '<td class="right">'.(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).'</td>';
|
||||||
print '<td class="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
|
print '<td class="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).'</td>';
|
||||||
print '<td class="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'</td>';
|
print '<td class="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key] > 0 ? $MembersResiliated[$key] : '').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
|
|||||||
@ -101,14 +101,14 @@ if ($result)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$urladd= "&statut=".$statut;
|
$urladd = "&statut=".$statut;
|
||||||
|
|
||||||
$selectedfields='';
|
$selectedfields = '';
|
||||||
|
|
||||||
$newcardbutton='';
|
$newcardbutton = '';
|
||||||
if ($user->rights->prelevement->bons->creer)
|
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
|
// 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);
|
print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. dol_escape_htmltag($search_ref).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto=$form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -46,8 +46,8 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined,
|
|||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortorder) $sortorder="DESC";
|
if (!$sortorder) $sortorder = "DESC";
|
||||||
if (! $sortfield) $sortfield="p.datec";
|
if (!$sortfield) $sortfield = "p.datec";
|
||||||
|
|
||||||
$search_line = GETPOST('search_line', 'alpha');
|
$search_line = GETPOST('search_line', 'alpha');
|
||||||
$search_bon = GETPOST('search_bon', 'alpha');
|
$search_bon = GETPOST('search_bon', 'alpha');
|
||||||
@ -55,8 +55,8 @@ $search_code = GETPOST('search_code', 'alpha');
|
|||||||
$search_company = GETPOST('search_company', 'alpha');
|
$search_company = GETPOST('search_company', 'alpha');
|
||||||
$statut = GETPOST('statut', 'int');
|
$statut = GETPOST('statut', 'int');
|
||||||
|
|
||||||
$bon=new BonPrelevement($db, "");
|
$bon = new BonPrelevement($db, "");
|
||||||
$ligne=new LignePrelevement($db, $user);
|
$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
|
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_line = "";
|
||||||
$search_bon="";
|
$search_bon = "";
|
||||||
$search_code="";
|
$search_code = "";
|
||||||
$search_company="";
|
$search_company = "";
|
||||||
$statut="";
|
$statut = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -77,31 +77,31 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("WithdrawalsLines"));
|
llxHeader('', $langs->trans("WithdrawalsLines"));
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.statut, p.datec";
|
$sql = "SELECT p.rowid, p.ref, p.statut, p.datec";
|
||||||
$sql.= " ,f.rowid as facid, f.ref, f.total_ttc";
|
$sql .= " ,f.rowid as facid, f.ref, f.total_ttc";
|
||||||
$sql.= " , s.rowid as socid, s.nom as name, s.code_client";
|
$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 .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||||
$sql.= " , ".MAIN_DB_PREFIX."facture as f";
|
$sql .= " , ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= " , ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= " WHERE pl.fk_prelevement_bons = p.rowid";
|
$sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
|
||||||
$sql.= " AND pf.fk_prelevement_lignes = pl.rowid";
|
$sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
|
||||||
$sql.= " AND pf.fk_facture = f.rowid";
|
$sql .= " AND pf.fk_facture = f.rowid";
|
||||||
$sql.= " AND f.fk_soc = s.rowid";
|
$sql .= " AND f.fk_soc = s.rowid";
|
||||||
$sql.= " AND f.entity IN (".getEntity('invoice').")";
|
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql .= " AND s.rowid = ".$socid;
|
||||||
if ($search_line) $sql.= " AND pl.rowid = '".$db->escape($search_line)."'";
|
if ($search_line) $sql .= " AND pl.rowid = '".$db->escape($search_line)."'";
|
||||||
if ($search_bon) $sql.= natural_search("p.ref", $search_bon);
|
if ($search_bon) $sql .= natural_search("p.ref", $search_bon);
|
||||||
if ($search_code) $sql.= natural_search("s.code_client", $search_code);
|
if ($search_code) $sql .= natural_search("s.code_client", $search_code);
|
||||||
if ($search_company) $sql.= natural_search("s.nom", $search_company);
|
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
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$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);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -126,28 +126,28 @@ if ($result)
|
|||||||
|
|
||||||
$urladd = "&statut=".$statut;
|
$urladd = "&statut=".$statut;
|
||||||
$urladd .= "&search_bon=".$search_bon;
|
$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<!-- debut table -->\n";
|
print"\n<!-- debut table -->\n";
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||||
|
|
||||||
$moreforfilter='';
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'. dol_escape_htmltag($search_line).'" size="6"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'.dol_escape_htmltag($search_line).'" size="6"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. dol_escape_htmltag($search_bon).'" size="6"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'. dol_escape_htmltag($search_company).'" size="6"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="6"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto=$form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -37,11 +37,11 @@ if ($user->socid > 0) $socid=$user->socid;
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$socstatic=new Societe($db);
|
$socstatic = new Societe($db);
|
||||||
|
|
||||||
llxHeader("", $langs->trans("Tools"), "");
|
llxHeader("", $langs->trans("Tools"), "");
|
||||||
|
|
||||||
$text=$langs->trans("Tools");
|
$text = $langs->trans("Tools");
|
||||||
|
|
||||||
print load_fiche_titre($text, '', 'wrench');
|
print load_fiche_titre($text, '', 'wrench');
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ $max=3;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Update sold
|
// Update sold
|
||||||
if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete))
|
if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete))
|
||||||
{
|
{
|
||||||
$result = $holiday->updateBalance();
|
$result = $holiday->updateBalance();
|
||||||
}
|
}
|
||||||
@ -73,18 +73,18 @@ if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$childids = $user->getAllChildIds();
|
$childids = $user->getAllChildIds();
|
||||||
$childids[]=$user->id;
|
$childids[] = $user->id;
|
||||||
|
|
||||||
llxHeader('', $langs->trans('HRMArea'));
|
llxHeader('', $langs->trans('HRMArea'));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm');
|
print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm');
|
||||||
|
|
||||||
|
|
||||||
if (! empty($setupcompanynotcomplete))
|
if (!empty($setupcompanynotcomplete))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||||
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
print '<br><div class="warning"><a href="'.DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit').'">'.$warnpicto.' '.$langs->trans("WarningMandatorySetupNotComplete").'</a></div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
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))
|
if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||||
{
|
{
|
||||||
@ -146,13 +146,13 @@ if (! empty($conf->holiday->enabled))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
|
||||||
$out='';
|
$out = '';
|
||||||
$typeleaves=$holiday->getTypes(1, 1);
|
$typeleaves = $holiday->getTypes(1, 1);
|
||||||
foreach($typeleaves as $key => $val)
|
foreach ($typeleaves as $key => $val)
|
||||||
{
|
{
|
||||||
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
||||||
$nb_holiday += $nb_type;
|
$nb_holiday += $nb_type;
|
||||||
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
|
$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
|
||||||
}
|
}
|
||||||
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
|
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
|
||||||
print $out;
|
print $out;
|
||||||
@ -161,7 +161,7 @@ if (! empty($conf->holiday->enabled))
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table></div><br>';
|
print '</table></div><br>';
|
||||||
}
|
}
|
||||||
elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
|
elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||||
{
|
{
|
||||||
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
|
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
|
||||||
}
|
}
|
||||||
@ -287,22 +287,22 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
|
|||||||
{
|
{
|
||||||
$total_ttc = $totalam = $total = 0;
|
$total_ttc = $totalam = $total = 0;
|
||||||
|
|
||||||
$expensereportstatic=new ExpenseReport($db);
|
$expensereportstatic = new ExpenseReport($db);
|
||||||
$userstatic=new User($db);
|
$userstatic = new User($db);
|
||||||
while ($i < $num && $i < $max)
|
while ($i < $num && $i < $max)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
$expensereportstatic->id=$obj->rowid;
|
$expensereportstatic->id = $obj->rowid;
|
||||||
$expensereportstatic->ref=$obj->ref;
|
$expensereportstatic->ref = $obj->ref;
|
||||||
|
|
||||||
$userstatic->id=$obj->uid;
|
$userstatic->id = $obj->uid;
|
||||||
$userstatic->lastname=$obj->lastname;
|
$userstatic->lastname = $obj->lastname;
|
||||||
$userstatic->firstname=$obj->firstname;
|
$userstatic->firstname = $obj->firstname;
|
||||||
$userstatic->email=$obj->email;
|
$userstatic->email = $obj->email;
|
||||||
$userstatic->login=$obj->login;
|
$userstatic->login = $obj->login;
|
||||||
$userstatic->statut=$obj->statut;
|
$userstatic->statut = $obj->statut;
|
||||||
$userstatic->photo=$obj->photo;
|
$userstatic->photo = $obj->photo;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowraponall">'.$expensereportstatic->getNomUrl(1).'</td>';
|
print '<td class="nowraponall">'.$expensereportstatic->getNomUrl(1).'</td>';
|
||||||
|
|||||||
362
htdocs/index.php
362
htdocs/index.php
@ -24,14 +24,14 @@
|
|||||||
* \brief Dolibarr home page
|
* \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 'main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
// If not defined, we select menu "home"
|
// If not defined, we select menu "home"
|
||||||
$_GET['mainmenu']=GETPOST('mainmenu', 'aZ09')?GETPOST('mainmenu', 'aZ09'):'home';
|
$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ?GETPOST('mainmenu', 'aZ09') : 'home';
|
||||||
$action=GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
$hookmanager->initHooks(array('index'));
|
$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");
|
header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
|
||||||
exit;
|
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");
|
header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
|
||||||
exit;
|
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)
|
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';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||||
$zone=GETPOST('areacode', 'aZ09');
|
$zone = GETPOST('areacode', 'aZ09');
|
||||||
$userid=GETPOST('userid', 'int');
|
$userid = GETPOST('userid', 'int');
|
||||||
$boxorder=GETPOST('boxorder', 'aZ09');
|
$boxorder = GETPOST('boxorder', 'aZ09');
|
||||||
$boxorder.=GETPOST('boxcombo', '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);
|
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
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! is_object($form)) $form=new Form($db);
|
if (!is_object($form)) $form = new Form($db);
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
$title=$langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
|
$title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
|
||||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE;
|
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $langs->trans("HomeArea").' - '.$conf->global->MAIN_APPLICATION_TITLE;
|
||||||
|
|
||||||
llxHeader('', $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');
|
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('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD);
|
$conf->global->MAIN_MOTD = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD);
|
||||||
if (! empty($conf->global->MAIN_MOTD))
|
if (!empty($conf->global->MAIN_MOTD))
|
||||||
{
|
{
|
||||||
$substitutionarray=getCommonSubstitutionArray($langs);
|
$substitutionarray = getCommonSubstitutionArray($langs);
|
||||||
complete_substitutions_array($substitutionarray, $langs);
|
complete_substitutions_array($substitutionarray, $langs);
|
||||||
$texttoshow = make_substitutions($conf->global->MAIN_MOTD, $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))
|
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
||||||
{
|
{
|
||||||
$object=new stdClass();
|
$object = new stdClass();
|
||||||
$parameters=array();
|
$parameters = array();
|
||||||
$action='';
|
$action = '';
|
||||||
$reshook=$hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
$boxstatFromHook=$hookmanager->resPrint;
|
$boxstatFromHook = $hookmanager->resPrint;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
// Condition to be checked for each display line dashboard
|
// Condition to be checked for each display line dashboard
|
||||||
$conditions=array(
|
$conditions = array(
|
||||||
$user->rights->user->user->lire,
|
$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_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->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->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
|
||||||
! empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
|
!empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
|
||||||
! empty($conf->adherent->enabled) && $user->rights->adherent->lire,
|
!empty($conf->adherent->enabled) && $user->rights->adherent->lire,
|
||||||
! empty($conf->product->enabled) && $user->rights->produit->lire,
|
!empty($conf->product->enabled) && $user->rights->produit->lire,
|
||||||
! empty($conf->service->enabled) && $user->rights->service->lire,
|
!empty($conf->service->enabled) && $user->rights->service->lire,
|
||||||
! empty($conf->propal->enabled) && $user->rights->propale->lire,
|
!empty($conf->propal->enabled) && $user->rights->propale->lire,
|
||||||
! empty($conf->commande->enabled) && $user->rights->commande->lire,
|
!empty($conf->commande->enabled) && $user->rights->commande->lire,
|
||||||
! empty($conf->facture->enabled) && $user->rights->facture->lire,
|
!empty($conf->facture->enabled) && $user->rights->facture->lire,
|
||||||
! empty($conf->contrat->enabled) && $user->rights->contrat->lire,
|
!empty($conf->contrat->enabled) && $user->rights->contrat->lire,
|
||||||
! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->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_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_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->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->projet->enabled) && $user->rights->projet->lire,
|
||||||
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
|
!empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
|
||||||
! empty($conf->holiday->enabled) && $user->rights->holiday->read,
|
!empty($conf->holiday->enabled) && $user->rights->holiday->read,
|
||||||
! empty($conf->don->enabled) && $user->rights->don->lire
|
!empty($conf->don->enabled) && $user->rights->don->lire
|
||||||
);
|
);
|
||||||
// Class file containing the method load_state_board for each line
|
// 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."/user/class/user.class.php",
|
||||||
DOL_DOCUMENT_ROOT."/societe/class/client.class.php",
|
DOL_DOCUMENT_ROOT."/societe/class/client.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"
|
DOL_DOCUMENT_ROOT."/don/class/don.class.php"
|
||||||
);
|
);
|
||||||
// Name class containing the method load_state_board for each line
|
// Name class containing the method load_state_board for each line
|
||||||
$classes=array('User',
|
$classes = array('User',
|
||||||
'Client',
|
'Client',
|
||||||
'Client',
|
'Client',
|
||||||
'Fournisseur',
|
'Fournisseur',
|
||||||
@ -194,7 +194,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
'Don'
|
'Don'
|
||||||
);
|
);
|
||||||
// Cle array returned by the method load_state_board for each line
|
// Cle array returned by the method load_state_board for each line
|
||||||
$keys=array('users',
|
$keys = array('users',
|
||||||
'customers',
|
'customers',
|
||||||
'prospects',
|
'prospects',
|
||||||
'suppliers',
|
'suppliers',
|
||||||
@ -216,7 +216,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
'donations'
|
'donations'
|
||||||
);
|
);
|
||||||
// Dashboard Icon lines
|
// Dashboard Icon lines
|
||||||
$icons=array('user',
|
$icons = array('user',
|
||||||
'company',
|
'company',
|
||||||
'company',
|
'company',
|
||||||
'company',
|
'company',
|
||||||
@ -238,7 +238,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
'generic'
|
'generic'
|
||||||
);
|
);
|
||||||
// Translation keyword
|
// Translation keyword
|
||||||
$titres=array("Users",
|
$titres = array("Users",
|
||||||
"ThirdPartyCustomersStats",
|
"ThirdPartyCustomersStats",
|
||||||
"ThirdPartyProspectsStats",
|
"ThirdPartyProspectsStats",
|
||||||
"Suppliers",
|
"Suppliers",
|
||||||
@ -260,7 +260,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
"Donations"
|
"Donations"
|
||||||
);
|
);
|
||||||
// Dashboard Link lines
|
// Dashboard Link lines
|
||||||
$links=array(
|
$links = array(
|
||||||
DOL_URL_ROOT.'/user/list.php',
|
DOL_URL_ROOT.'/user/list.php',
|
||||||
DOL_URL_ROOT.'/societe/list.php?type=c&mainmenu=companies',
|
DOL_URL_ROOT.'/societe/list.php?type=c&mainmenu=companies',
|
||||||
DOL_URL_ROOT.'/societe/list.php?type=p&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
|
// Loop and displays each line of table
|
||||||
$boardloaded=array();
|
$boardloaded = array();
|
||||||
foreach ($keys as $key=>$val)
|
foreach ($keys as $key=>$val)
|
||||||
{
|
{
|
||||||
if ($conditions[$key])
|
if ($conditions[$key])
|
||||||
{
|
{
|
||||||
$boxstatItem = '';
|
$boxstatItem = '';
|
||||||
$classe=$classes[$key];
|
$classe = $classes[$key];
|
||||||
// Search in cache if load_state_board is already realized
|
// 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);
|
$board->load_state_board($user);
|
||||||
$boardloaded[$classe]=$board;
|
$boardloaded[$classe] = $board;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$board=$boardloaded[$classe];
|
$board = $boardloaded[$classe];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!empty($langfile[$key])) $langs->load($langfile[$key]);
|
if (!empty($langfile[$key])) $langs->load($langfile[$key]);
|
||||||
$text=$langs->trans($titres[$key]);
|
$text = $langs->trans($titres[$key]);
|
||||||
$boxstatItem.='<a href="'.$links[$key].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
$boxstatItem .= '<a href="'.$links[$key].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
$boxstatItem.='<div class="boxstats">';
|
$boxstatItem .= '<div class="boxstats">';
|
||||||
$boxstatItem.='<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
||||||
$boxstatItem.='<span class="boxstatsindicator">'.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).'</span>';
|
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).'</span>';
|
||||||
$boxstatItem.='</div>';
|
$boxstatItem .= '</div>';
|
||||||
$boxstatItem.='</a>';
|
$boxstatItem .= '</a>';
|
||||||
|
|
||||||
$boxstatItems[$val] = $boxstatItem;
|
$boxstatItems[$val] = $boxstatItem;
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
$parameters = array();
|
$parameters = array();
|
||||||
$action = '';
|
$action = '';
|
||||||
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object,
|
$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) {
|
if ($reshook == 0) {
|
||||||
$dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
|
$dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
|
||||||
}
|
}
|
||||||
@ -586,7 +586,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
'dashboardgroup' => $dashboardgroup
|
'dashboardgroup' => $dashboardgroup
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object,
|
$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) {
|
if ($reshook == 0) {
|
||||||
$dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
|
$dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
|
||||||
}
|
}
|
||||||
@ -628,23 +628,23 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
$boxwork = '';
|
$boxwork = '';
|
||||||
$boxwork .= '<div class="box">';
|
$boxwork .= '<div class="box">';
|
||||||
$boxwork .= '<table summary="' . dol_escape_htmltag($langs->trans("WorkingBoard")) . '" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">' . "\n";
|
$boxwork .= '<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">'."\n";
|
||||||
$boxwork .= '<tr class="liste_titre">';
|
$boxwork .= '<tr class="liste_titre">';
|
||||||
$boxwork .= '<th class="liste_titre"><div class="inline-block valignmiddle">' . $langs->trans("DolibarrWorkBoard") . '</div>';
|
$boxwork .= '<th class="liste_titre"><div class="inline-block valignmiddle">'.$langs->trans("DolibarrWorkBoard").'</div>';
|
||||||
if ($showweather) {
|
if ($showweather) {
|
||||||
if ($totallate > 0) {
|
if ($totallate > 0) {
|
||||||
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate",
|
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
|
||||||
$totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')';
|
$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
|
||||||
} else {
|
} else {
|
||||||
$text = $langs->transnoentitiesnoconv("NoItemLate");
|
$text = $langs->transnoentitiesnoconv("NoItemLate");
|
||||||
}
|
}
|
||||||
$text .= '. ' . $langs->transnoentitiesnoconv("LateDesc");
|
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
|
||||||
//$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
|
//$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
|
||||||
$options = 'height="24px" style="float: right"';
|
$options = 'height="24px" style="float: right"';
|
||||||
$boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle');
|
$boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle');
|
||||||
}
|
}
|
||||||
$boxwork .= '</th>';
|
$boxwork .= '</th>';
|
||||||
$boxwork .= '</tr>' . "\n";
|
$boxwork .= '</tr>'."\n";
|
||||||
|
|
||||||
// Show dashboard
|
// Show dashboard
|
||||||
$nbworkboardempty = 0;
|
$nbworkboardempty = 0;
|
||||||
@ -673,21 +673,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
// global stats
|
// global stats
|
||||||
$globalStatsKey = false;
|
$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'];
|
$globalStatsKey = $groupElement['globalStatsKey'];
|
||||||
$groupElement['globalStats'] = array();
|
$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
|
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
|
||||||
$keyIndex = array_search($globalStatsKey, $keys);
|
$keyIndex = array_search($globalStatsKey, $keys);
|
||||||
|
|
||||||
$classe=$classes[$keyIndex];
|
$classe = $classes[$keyIndex];
|
||||||
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
|
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']);
|
$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']['text'] = $langs->trans('Total').' : '.$langs->trans($titres[$keyIndex]).' ('.$groupElement['globalStats']['total'].')';
|
||||||
$groupElement['globalStats']['total'] = $nbTotal;
|
$groupElement['globalStats']['total'] = $nbTotal;
|
||||||
$groupElement['globalStats']['link'] = $links[$keyIndex];
|
$groupElement['globalStats']['link'] = $links[$keyIndex];
|
||||||
@ -696,35 +696,35 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$openedDashBoard.= '<div class="box-flex-item">' . "\n";
|
$openedDashBoard .= '<div class="box-flex-item">'."\n";
|
||||||
$openedDashBoard.= ' <div class="info-box ' . $openedDashBoardSize . '">' . "\n";
|
$openedDashBoard .= ' <div class="info-box '.$openedDashBoardSize.'">'."\n";
|
||||||
$openedDashBoard.= ' <span class="info-box-icon bg-infoxbox-'.$groupKeyLowerCase.'">'."\n";
|
$openedDashBoard .= ' <span class="info-box-icon bg-infoxbox-'.$groupKeyLowerCase.'">'."\n";
|
||||||
$openedDashBoard.= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n";
|
$openedDashBoard .= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n";
|
||||||
|
|
||||||
if(!empty($groupElement['globalStats'])){
|
if (!empty($groupElement['globalStats'])) {
|
||||||
$globalStatInTopOpenedDashBoard[] = $globalStatsKey;
|
$globalStatInTopOpenedDashBoard[] = $globalStatsKey;
|
||||||
$openedDashBoard.= ' <span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$nbTotal.'</span>'."\n";
|
$openedDashBoard .= ' <span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$nbTotal.'</span>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$openedDashBoard.= ' </span>'."\n";
|
$openedDashBoard .= ' </span>'."\n";
|
||||||
$openedDashBoard .= ' <div class="info-box-content">' . "\n";
|
$openedDashBoard .= ' <div class="info-box-content">'."\n";
|
||||||
|
|
||||||
$openedDashBoard .= ' <span class="info-box-title" title="'.strip_tags($groupName).'">'.$groupName.'</span>' . "\n";
|
$openedDashBoard .= ' <span class="info-box-title" title="'.strip_tags($groupName).'">'.$groupName.'</span>'."\n";
|
||||||
|
|
||||||
foreach ($boards as $board) {
|
foreach ($boards as $board) {
|
||||||
if (!empty($board->labelShort)) {
|
if (!empty($board->labelShort)) {
|
||||||
$infoName = '<span title="' . $board->label . '">' . $board->labelShort . '</span>';
|
$infoName = '<span title="'.$board->label.'">'.$board->labelShort.'</span>';
|
||||||
} else {
|
} else {
|
||||||
$infoName = $board->label;
|
$infoName = $board->label;
|
||||||
}
|
}
|
||||||
|
|
||||||
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
|
$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 = '';
|
$textLate = '';
|
||||||
if ($board->nbtodolate > 0) {
|
if ($board->nbtodolate > 0) {
|
||||||
$textLate .= ' <span title="' . dol_htmlentities($textLateTitle) . '" class="classfortooltip badge badge-danger">';
|
$textLate .= ' <span title="'.dol_htmlentities($textLateTitle).'" class="classfortooltip badge badge-danger">';
|
||||||
$textLate .= '<i class="fa fa-exclamation-triangle"></i> ' . $board->nbtodolate;
|
$textLate .= '<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
|
||||||
$textLate .= '</span>';
|
$textLate .= '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -733,16 +733,16 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
$nbtodClass = 'badge badge-info';
|
$nbtodClass = 'badge badge-info';
|
||||||
}
|
}
|
||||||
|
|
||||||
$openedDashBoard .= ' <a href="' . $board->url . '" class="info-box-text">' . $infoName . ' : <span class="' . $nbtodClass . ' classfortooltip" title="' . $board->label . '" >' . $board->nbtodo . '</span>' . $textLate . '</a>' . "\n";
|
$openedDashBoard .= ' <a href="'.$board->url.'" class="info-box-text">'.$infoName.' : <span class="'.$nbtodClass.' classfortooltip" title="'.$board->label.'" >'.$board->nbtodo.'</span>'.$textLate.'</a>'."\n";
|
||||||
|
|
||||||
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
||||||
$openedDashBoard .= '<a href="' . $board->url . '" class="info-box-text">' . $langs->trans('Total') . ' : ' . price($board->total) . '</a>';
|
$openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text">'.$langs->trans('Total').' : '.price($board->total).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$openedDashBoard .= ' </div><!-- /.info-box-content -->' . "\n";
|
$openedDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
|
||||||
$openedDashBoard .= ' </div><!-- /.info-box -->' . "\n";
|
$openedDashBoard .= ' </div><!-- /.info-box -->'."\n";
|
||||||
$openedDashBoard .= '</div><!-- /.box-flex-item -->' . "\n";
|
$openedDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
|
||||||
$openedDashBoard .= "\n";
|
$openedDashBoard .= "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -753,41 +753,41 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
if ($totallate > 0) {
|
if ($totallate > 0) {
|
||||||
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate",
|
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",
|
||||||
$totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')';
|
$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')';
|
||||||
} else {
|
} else {
|
||||||
$text = $langs->transnoentitiesnoconv("NoItemLate");
|
$text = $langs->transnoentitiesnoconv("NoItemLate");
|
||||||
}
|
}
|
||||||
$text .= '. ' . $langs->transnoentitiesnoconv("LateDesc");
|
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
|
||||||
|
|
||||||
$weatherDashBoard = '<div class="box-flex-item ' . $appendClass . '">' . "\n";
|
$weatherDashBoard = '<div class="box-flex-item '.$appendClass.'">'."\n";
|
||||||
$weatherDashBoard .= ' <div class="info-box ' . $openedDashBoardSize . ' info-box-weather info-box-weather-level' . $weather->level . '">' . "\n";
|
$weatherDashBoard .= ' <div class="info-box '.$openedDashBoardSize.' info-box-weather info-box-weather-level'.$weather->level.'">'."\n";
|
||||||
$weatherDashBoard .= ' <span class="info-box-icon">';
|
$weatherDashBoard .= ' <span class="info-box-icon">';
|
||||||
$weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
|
$weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
|
||||||
$weatherDashBoard .= ' </span>' . "\n";
|
$weatherDashBoard .= ' </span>'."\n";
|
||||||
$weatherDashBoard .= ' <div class="info-box-content">' . "\n";
|
$weatherDashBoard .= ' <div class="info-box-content">'."\n";
|
||||||
$weatherDashBoard .= ' <span class="info-box-title">' . $langs->trans('GlobalOpenedElemView') . '</span>' . "\n";
|
$weatherDashBoard .= ' <span class="info-box-title">'.$langs->trans('GlobalOpenedElemView').'</span>'."\n";
|
||||||
|
|
||||||
if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
|
if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
|
||||||
$weatherDashBoard .= ' <span class="info-box-number">' . $langs->transnoentitiesnoconv("NActionsLate",
|
$weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv("NActionsLate",
|
||||||
price($totallatePercentage) . '%') . '</span>' . "\n";
|
price($totallatePercentage).'%').'</span>'."\n";
|
||||||
$weatherDashBoard .= ' <span class="progress-description">' . $langs->trans('NActionsLate',
|
$weatherDashBoard .= ' <span class="progress-description">'.$langs->trans('NActionsLate',
|
||||||
$totalLateNumber) . '</span>' . "\n";
|
$totalLateNumber).'</span>'."\n";
|
||||||
} else {
|
} else {
|
||||||
$weatherDashBoard .= ' <span class="info-box-number">' . $langs->transnoentitiesnoconv("NActionsLate",
|
$weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv("NActionsLate",
|
||||||
$totalLateNumber) . '</span>' . "\n";
|
$totalLateNumber).'</span>'."\n";
|
||||||
if ($totallatePercentage > 0) {
|
if ($totallatePercentage > 0) {
|
||||||
$weatherDashBoard .= ' <span class="progress-description">' . $langs->trans('NActionsLate',
|
$weatherDashBoard .= ' <span class="progress-description">'.$langs->trans('NActionsLate',
|
||||||
price($totallatePercentage) . '%') . '</span>' . "\n";
|
price($totallatePercentage).'%').'</span>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$weatherDashBoard .= ' </div><!-- /.info-box-content -->' . "\n";
|
$weatherDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
|
||||||
$weatherDashBoard .= ' </div><!-- /.info-box -->' . "\n";
|
$weatherDashBoard .= ' </div><!-- /.info-box -->'."\n";
|
||||||
$weatherDashBoard .= '</div><!-- /.box-flex-item -->' . "\n";
|
$weatherDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
|
||||||
$weatherDashBoard .= "\n";
|
$weatherDashBoard .= "\n";
|
||||||
|
|
||||||
$openedDashBoard = $weatherDashBoard . $openedDashBoard;
|
$openedDashBoard = $weatherDashBoard.$openedDashBoard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($isIntopOpenedDashBoard)) {
|
if (!empty($isIntopOpenedDashBoard)) {
|
||||||
@ -810,24 +810,24 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
|
|
||||||
$textlate = $langs->trans("NActionsLate", $board->nbtodolate);
|
$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 .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
|
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
|
||||||
$boxwork .= '<div class="boxstatscontent">';
|
$boxwork .= '<div class="boxstatscontent">';
|
||||||
$boxwork .= '<span class="boxstatstext" title="' . dol_escape_htmltag($board->label) . '">' . $board->img . ' ' . $board->label . '</span><br>';
|
$boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' '.$board->label.'</span><br>';
|
||||||
$boxwork .= '<a class="valignmiddle dashboardlineindicator" href="' . $board->url . '"><span class="dashboardlineindicator' . (($board->nbtodo == 0) ? ' dashboardlineok' : '') . '">' . $board->nbtodo . '</span></a>';
|
$boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.$board->nbtodo.'</span></a>';
|
||||||
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
|
||||||
$boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="' . $board->url . '"><span class="dashboardlineindicator' . (($board->nbtodo == 0) ? ' dashboardlineok' : '') . '">' . price($board->total) . '</span></a>';
|
$boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.price($board->total).'</span></a>';
|
||||||
}
|
}
|
||||||
$boxwork .= '</div>';
|
$boxwork .= '</div>';
|
||||||
if ($board->nbtodolate > 0) {
|
if ($board->nbtodolate > 0) {
|
||||||
$boxwork .= '<div class="dashboardlinelatecoin nowrap">';
|
$boxwork .= '<div class="dashboardlinelatecoin nowrap">';
|
||||||
$boxwork .= '<a title="' . dol_escape_htmltag($textlate) . '" class="valignmiddle dashboardlineindicatorlate' . ($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok') . '" href="' . ((!$board->url_late) ? $board->url : $board->url_late) . '">';
|
$boxwork .= '<a title="'.dol_escape_htmltag($textlate).'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late).'">';
|
||||||
//$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').'';
|
//$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').'';
|
||||||
$boxwork .= img_picto($textlate, "warning_white",
|
$boxwork .= img_picto($textlate, "warning_white",
|
||||||
'class="inline-block hideonsmartphone valigntextbottom"') . '';
|
'class="inline-block hideonsmartphone valigntextbottom"').'';
|
||||||
$boxwork .= '<span class="dashboardlineindicatorlate' . ($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok') . '">';
|
$boxwork .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'">';
|
||||||
$boxwork .= $board->nbtodolate;
|
$boxwork .= $board->nbtodolate;
|
||||||
$boxwork .= '</span>';
|
$boxwork .= '</span>';
|
||||||
$boxwork .= '</a>';
|
$boxwork .= '</a>';
|
||||||
@ -854,12 +854,12 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
|
|
||||||
$boxwork .= '</td></tr>';
|
$boxwork .= '</td></tr>';
|
||||||
|
|
||||||
$boxwork .= '</table>'; // End table array of working board
|
$boxwork .= '</table>'; // End table array of working board
|
||||||
$boxwork .= '</div>';
|
$boxwork .= '</div>';
|
||||||
|
|
||||||
if (!empty($isIntopOpenedDashBoard)) {
|
if (!empty($isIntopOpenedDashBoard)) {
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="opened-dash-board-wrap"><div class="box-flex-container">' . $openedDashBoard . '</div></div>';
|
print '<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.'</div></div>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,47 +898,47 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($boxstatFromHook) || !empty($boxstatItems)){
|
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
|
||||||
$boxstat.='<div class="box">';
|
$boxstat .= '<div class="box">';
|
||||||
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover" width="100%">';
|
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover" width="100%">';
|
||||||
$boxstat.='<tr class="liste_titre">';
|
$boxstat .= '<tr class="liste_titre">';
|
||||||
$boxstat.='<th class="liste_titre">';
|
$boxstat .= '<th class="liste_titre">';
|
||||||
$boxstat.='<div class="inline-block valignmiddle">'.$langs->trans("DolibarrStateBoard").'</div>';
|
$boxstat .= '<div class="inline-block valignmiddle">'.$langs->trans("DolibarrStateBoard").'</div>';
|
||||||
$boxstat.='</th>';
|
$boxstat .= '</th>';
|
||||||
$boxstat.='</tr>';
|
$boxstat .= '</tr>';
|
||||||
$boxstat.='<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer">';
|
$boxstat .= '<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer">';
|
||||||
|
|
||||||
$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.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
$boxstat .= '<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
|
||||||
|
|
||||||
$boxstat.='</td></tr>';
|
$boxstat .= '</td></tr>';
|
||||||
$boxstat.='</table>';
|
$boxstat .= '</table>';
|
||||||
$boxstat.='</div>';
|
$boxstat .= '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$boxlist.= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
|
||||||
|
|
||||||
$boxlist.=$boxstat;
|
$boxlist .= $boxstat;
|
||||||
$boxlist.=$resultboxes['boxlistb'];
|
$boxlist .= $resultboxes['boxlistb'];
|
||||||
|
|
||||||
$boxlist.= '</div>';
|
$boxlist .= '</div>';
|
||||||
$boxlist.= "\n";
|
$boxlist .= "\n";
|
||||||
|
|
||||||
$boxlist.='</div>';
|
$boxlist .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
print $boxlist;
|
print $boxlist;
|
||||||
@ -953,15 +953,15 @@ print '</div>';
|
|||||||
// Security warning repertoire install existe (si utilisateur admin)
|
// Security warning repertoire install existe (si utilisateur admin)
|
||||||
if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
|
if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
|
||||||
{
|
{
|
||||||
$message='';
|
$message = '';
|
||||||
|
|
||||||
// Check if install lock file is present
|
// Check if install lock file is present
|
||||||
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
$lockfile = DOL_DATA_ROOT.'/install.lock';
|
||||||
if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
|
if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
//if (! empty($message)) $message.='<br>';
|
//if (! empty($message)) $message.='<br>';
|
||||||
$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
|
// 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("errors");
|
||||||
//$langs->load("other");
|
//$langs->load("other");
|
||||||
//if (! empty($message)) $message.='<br>';
|
//if (! empty($message)) $message.='<br>';
|
||||||
$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)
|
if ($message)
|
||||||
@ -1021,48 +1021,48 @@ function getWeatherStatus($totallate)
|
|||||||
$weather = new stdClass();
|
$weather = new stdClass();
|
||||||
$weather->picto = '';
|
$weather->picto = '';
|
||||||
|
|
||||||
$offset=0;
|
$offset = 0;
|
||||||
$factor=10; // By default
|
$factor = 10; // By default
|
||||||
|
|
||||||
$used_conf = !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL';
|
$used_conf = !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL';
|
||||||
|
|
||||||
$level0=$offset;
|
$level0 = $offset;
|
||||||
$weather->level=0;
|
$weather->level = 0;
|
||||||
if (! empty($conf->global->{$used_conf.'0'})) {
|
if (!empty($conf->global->{$used_conf.'0'})) {
|
||||||
$level0=$conf->global->{$used_conf.'0'};
|
$level0 = $conf->global->{$used_conf.'0'};
|
||||||
}
|
}
|
||||||
$level1=$offset+1*$factor;
|
$level1 = $offset + 1 * $factor;
|
||||||
if (! empty($conf->global->{$used_conf.'1'})) {
|
if (!empty($conf->global->{$used_conf.'1'})) {
|
||||||
$level1=$conf->global->{$used_conf.'1'};
|
$level1 = $conf->global->{$used_conf.'1'};
|
||||||
}
|
}
|
||||||
$level2=$offset+2*$factor;
|
$level2 = $offset + 2 * $factor;
|
||||||
if (! empty($conf->global->{$used_conf.'2'})) {
|
if (!empty($conf->global->{$used_conf.'2'})) {
|
||||||
$level2=$conf->global->{$used_conf.'2'};
|
$level2 = $conf->global->{$used_conf.'2'};
|
||||||
}
|
}
|
||||||
$level3=$offset+3*$factor;
|
$level3 = $offset + 3 * $factor;
|
||||||
if (! empty($conf->global->{$used_conf.'3'})) {
|
if (!empty($conf->global->{$used_conf.'3'})) {
|
||||||
$level3=$conf->global->{$used_conf.'3'};
|
$level3 = $conf->global->{$used_conf.'3'};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totallate <= $level0){
|
if ($totallate <= $level0) {
|
||||||
$weather->picto = 'weather-clear.png';
|
$weather->picto = 'weather-clear.png';
|
||||||
$weather->level=0;
|
$weather->level = 0;
|
||||||
}
|
}
|
||||||
elseif ($totallate <= $level1){
|
elseif ($totallate <= $level1) {
|
||||||
$weather->picto = 'weather-few-clouds.png';
|
$weather->picto = 'weather-few-clouds.png';
|
||||||
$weather->level=1;
|
$weather->level = 1;
|
||||||
}
|
}
|
||||||
elseif ($totallate <= $level2){
|
elseif ($totallate <= $level2) {
|
||||||
$weather->picto = 'weather-clouds.png';
|
$weather->picto = 'weather-clouds.png';
|
||||||
$weather->level=2;
|
$weather->level = 2;
|
||||||
}
|
}
|
||||||
elseif ($totallate <= $level3){
|
elseif ($totallate <= $level3) {
|
||||||
$weather->picto = 'weather-many-clouds.png';
|
$weather->picto = 'weather-many-clouds.png';
|
||||||
$weather->level=3;
|
$weather->level = 3;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$weather->picto = 'weather-storm.png';
|
$weather->picto = 'weather-storm.png';
|
||||||
$weather->level=4;
|
$weather->level = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $weather;
|
return $weather;
|
||||||
|
|||||||
@ -95,18 +95,18 @@ print '<div class="opacitymedium">';
|
|||||||
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($user->rights->projet->all->lire) && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
if (!empty($user->rights->projet->all->lire) && !$socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
||||||
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
// Get list of ponderated percent for each status
|
// 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 = "SELECT cls.rowid, cls.code, cls.percent, cls.label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
|
||||||
$sql.= " WHERE active=1";
|
$sql .= " WHERE active=1";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -114,9 +114,9 @@ if ( $resql )
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$listofoppstatus[$objp->rowid]=$objp->percent;
|
$listofoppstatus[$objp->rowid] = $objp->percent;
|
||||||
$listofopplabel[$objp->rowid]=$objp->label;
|
$listofopplabel[$objp->rowid] = $objp->label;
|
||||||
$listofoppcode[$objp->rowid]=$objp->code;
|
$listofoppcode[$objp->rowid] = $objp->code;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,12 +127,12 @@ else dol_print_error($db);
|
|||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|
||||||
|
|
||||||
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
|
// 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))
|
if (count($listofsearchfields))
|
||||||
@ -141,8 +141,8 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover centpercent">';
|
print '<table class="noborder nohover centpercent">';
|
||||||
$i=0;
|
$i = 0;
|
||||||
foreach($listofsearchfields as $key => $value)
|
foreach ($listofsearchfields as $key => $value)
|
||||||
{
|
{
|
||||||
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -173,16 +173,16 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
|
|
||||||
// Latest modified projects
|
// Latest modified projects
|
||||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.tms as datem,";
|
$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 .= " 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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
$sql.= " WHERE p.entity IN (".getEntity('project').")";
|
$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 ($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.")";
|
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 .= " ORDER BY p.tms DESC";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -202,21 +202,21 @@ if ($resql)
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td width="20%" class="nowrap">';
|
print '<td width="20%" class="nowrap">';
|
||||||
|
|
||||||
$projectstatic->id=$obj->rowid;
|
$projectstatic->id = $obj->rowid;
|
||||||
$projectstatic->ref=$obj->ref;
|
$projectstatic->ref = $obj->ref;
|
||||||
$projectstatic->title=$obj->title;
|
$projectstatic->title = $obj->title;
|
||||||
$projectstatic->dateo=$obj->dateo;
|
$projectstatic->dateo = $obj->dateo;
|
||||||
$projectstatic->datep=$obj->datep;
|
$projectstatic->datep = $obj->datep;
|
||||||
$projectstatic->thirdparty_name=$obj->name;
|
$projectstatic->thirdparty_name = $obj->name;
|
||||||
|
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name=$obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->email=$obj->email;
|
$companystatic->email = $obj->email;
|
||||||
$companystatic->client=$obj->client;
|
$companystatic->client = $obj->client;
|
||||||
$companystatic->fournisseur=$obj->fournisseur;
|
$companystatic->fournisseur = $obj->fournisseur;
|
||||||
$companystatic->code_client=$obj->code_client;
|
$companystatic->code_client = $obj->code_client;
|
||||||
$companystatic->code_fournisseur=$obj->code_fournisseur;
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
$companystatic->canvas=$obj->canvas;
|
$companystatic->canvas = $obj->canvas;
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td width="96" class="nobordernopadding nowrap">';
|
print '<td width="96" class="nobordernopadding nowrap">';
|
||||||
@ -228,9 +228,9 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
print '<td width="16" class="right nobordernopadding hideonsmartphone">';
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename = dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||||
print $formfile->getDocumentsLink($projectstatic->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($projectstatic->element, $filename, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ if ($resql)
|
|||||||
else dol_print_error($db);
|
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
|
// Open project per thirdparty
|
||||||
@ -265,18 +265,18 @@ print_liste_field_titre("NbOfProjects", "", "", "", "", '', $sortfield, $sortord
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)";
|
$sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)";
|
||||||
$sql.= ", s.nom as name, s.rowid as socid";
|
$sql .= ", s.nom as name, s.rowid as socid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
$sql.= " WHERE p.entity IN (".getEntity('project').")";
|
$sql .= " WHERE p.entity IN (".getEntity('project').")";
|
||||||
$sql.= " AND p.fk_statut = 1";
|
$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 ($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.")";
|
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 .= " GROUP BY s.nom, s.rowid";
|
||||||
$sql.= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -289,8 +289,8 @@ if ( $resql )
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
if ($obj->socid)
|
if ($obj->socid)
|
||||||
{
|
{
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->name=$obj->name;
|
$companystatic->name = $obj->name;
|
||||||
print $companystatic->getNomUrl(1);
|
print $companystatic->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -316,7 +316,7 @@ else
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
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.
|
// 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
|
// Add constant PROJECT_SHOW_PROJECT_LIST_ON_PROJECT_AREA to show this list
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
* \brief Setup page for TakePos module
|
* \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.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.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'));
|
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
|
||||||
|
|
||||||
if (! $res > 0) $error++;
|
if (!$res > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
@ -68,12 +68,12 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form = new Form($db);
|
||||||
$formproduct=new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("CashDeskSetup"));
|
llxHeader('', $langs->trans("CashDeskSetup"));
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||||
$head = takepos_prepare_head();
|
$head = takepos_prepare_head();
|
||||||
dol_fiche_head($head, 'receipt', 'TakePOS', -1);
|
dol_fiche_head($head, 'receipt', 'TakePOS', -1);
|
||||||
@ -81,7 +81,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
// Mode
|
// Mode
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.(empty($terminal)?1:$terminal).'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.(empty($terminal) ? 1 : $terminal).'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="set">';
|
print '<input type="hidden" name="action" value="set">';
|
||||||
|
|
||||||
@ -90,16 +90,16 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
|
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
||||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||||
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
foreach ($substitutionarray as $key => $val) $htmltext .= $key.'<br>';
|
||||||
$htmltext.='</i>';
|
$htmltext .= '</i>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$variablename='TAKEPOS_HEADER';
|
$variablename = 'TAKEPOS_HEADER';
|
||||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||||
{
|
{
|
||||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||||
@ -107,7 +107,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
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 $doleditor->Create();
|
||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
@ -115,7 +115,7 @@ print "</td></tr>\n";
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
$variablename='TAKEPOS_FOOTER';
|
$variablename = 'TAKEPOS_FOOTER';
|
||||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||||
{
|
{
|
||||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||||
@ -123,13 +123,13 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
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 $doleditor->Create();
|
||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans("ReceiptName").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans("ReceiptName").'</label></td><td>';
|
||||||
print '<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="' . (! empty($conf->global->TAKEPOS_RECEIPT_NAME) ? $conf->global->TAKEPOS_RECEIPT_NAME : '') . '">';
|
print '<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="'.(!empty($conf->global->TAKEPOS_RECEIPT_NAME) ? $conf->global->TAKEPOS_RECEIPT_NAME : '').'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Customer information
|
// Customer information
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
* \brief Setup page for TakePos module
|
* \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.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.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";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
|
||||||
|
|
||||||
// If socid provided by ajax company selector
|
// 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');
|
$_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha');
|
||||||
$_POST['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')
|
if (GETPOST('action', 'alpha') == 'set')
|
||||||
{
|
{
|
||||||
$db->begin();
|
$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, "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);
|
$res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -135,12 +135,12 @@ print "</tr>\n";
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("NumberOfTerminals");
|
print $langs->trans("NumberOfTerminals");
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9");
|
$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 $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '0' : $conf->global->TAKEPOS_NUM_TERMINALS), 0);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
if (! empty($conf->service->enabled))
|
if (!empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("CashdeskShowServices");
|
print $langs->trans("CashdeskShowServices");
|
||||||
@ -230,8 +230,8 @@ print "</td></tr>\n";
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("Paymentnumpad");
|
print $langs->trans("Paymentnumpad");
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$array=array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad"));
|
$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 $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD) ? '0' : $conf->global->TAKEPOS_NUMPAD), 0);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Direct Payment
|
// Direct Payment
|
||||||
|
|||||||
@ -25,14 +25,14 @@
|
|||||||
* \brief Page to show a receipt.
|
* \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';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$langs->loadLangs(array("main", "cashdesk", "companies"));
|
$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)
|
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);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
{
|
||||||
$facid=$obj->rowid;
|
$facid = $obj->rowid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$object=new Facture($db);
|
$object = new Facture($db);
|
||||||
$object->fetch($facid);
|
$object->fetch($facid);
|
||||||
|
|
||||||
// Call to external receipt modules if exist
|
// Call to external receipt modules if exist
|
||||||
$hookmanager->initHooks(array('takeposfrontend'), $facid);
|
$hookmanager->initHooks(array('takeposfrontend'), $facid);
|
||||||
$reshook=$hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
|
$reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object);
|
||||||
if (!empty($hookmanager->resPrint)) {
|
if (!empty($hookmanager->resPrint)) {
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
exit;
|
exit;
|
||||||
@ -79,7 +79,7 @@ if (!empty($hookmanager->resPrint)) {
|
|||||||
</style>
|
</style>
|
||||||
<center>
|
<center>
|
||||||
<font size="4">
|
<font size="4">
|
||||||
<?php echo '<b>'.$mysoc->name.'</b>';?>
|
<?php echo '<b>'.$mysoc->name.'</b>'; ?>
|
||||||
</font>
|
</font>
|
||||||
</center>
|
</center>
|
||||||
<br>
|
<br>
|
||||||
@ -87,10 +87,10 @@ if (!empty($hookmanager->resPrint)) {
|
|||||||
<?php
|
<?php
|
||||||
if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
|
if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
|
||||||
{
|
{
|
||||||
$substitutionarray=getCommonSubstitutionArray($langs);
|
$substitutionarray = getCommonSubstitutionArray($langs);
|
||||||
if (! empty($conf->global->TAKEPOS_HEADER))
|
if (!empty($conf->global->TAKEPOS_HEADER))
|
||||||
{
|
{
|
||||||
$newfreetext=make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
|
$newfreetext = make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
|
||||||
echo $newfreetext;
|
echo $newfreetext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,9 +185,9 @@ if ($conf->global->TAKEPOS_CUSTOM_RECEIPT && $conf->global->TAKEPOS_SHOW_CUSTOME
|
|||||||
<?php
|
<?php
|
||||||
if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
|
if ($conf->global->TAKEPOS_CUSTOM_RECEIPT)
|
||||||
{
|
{
|
||||||
$substitutionarray=getCommonSubstitutionArray($langs);
|
$substitutionarray = getCommonSubstitutionArray($langs);
|
||||||
if (! empty($conf->global->TAKEPOS_FOOTER)){
|
if (!empty($conf->global->TAKEPOS_FOOTER)) {
|
||||||
$newfreetext=make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
|
$newfreetext = make_substitutions($conf->global->TAKEPOS_FOOTER, $substitutionarray);
|
||||||
echo $newfreetext;
|
echo $newfreetext;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||||
/* <style type="text/css" > */
|
/* <style type="text/css" > */
|
||||||
|
|
||||||
|
|
||||||
@ -32,8 +32,8 @@ span.butAction, span.butActionDelete {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em !important;
|
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em !important;
|
||||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -55,7 +55,7 @@ span.butAction, span.butActionDelete {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
margin: 0em 0.3em 0 0.3em !important;
|
margin: 0em 0.3em 0 0.3em !important;
|
||||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em 0.3em;
|
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em 0.3em;
|
||||||
font-family: <?php print $fontlist ?>;
|
font-family: <?php print $fontlist ?>;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/* text-align: center; New button are on right of screen */
|
/* text-align: center; New button are on right of screen */
|
||||||
@ -126,8 +126,8 @@ span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
|
|||||||
|
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
cursor: not-allowed !important;
|
cursor: not-allowed !important;
|
||||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em;
|
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.9'); ?>em;
|
||||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
padding: 0.6em <?php echo ($dol_optimize_smallscreen ? '0.6' : '0.7'); ?>em;
|
||||||
font-family: <?php print $fontlist ?> !important;
|
font-family: <?php print $fontlist ?> !important;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -145,8 +145,8 @@ span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
|
|||||||
|
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
cursor: not-allowed !important;
|
cursor: not-allowed !important;
|
||||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.7':'0.9'); ?>em;
|
margin: 0em <?php echo ($dol_optimize_smallscreen ? '0.7' : '0.9'); ?>em;
|
||||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
|
padding: 0.2em <?php echo ($dol_optimize_smallscreen ? '0.4' : '0.7'); ?>em;
|
||||||
font-family: <?php print $fontlist ?> !important;
|
font-family: <?php print $fontlist ?> !important;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/* text-align: center; New button are on right of screen */
|
/* text-align: center; New button are on right of screen */
|
||||||
@ -256,7 +256,7 @@ div.pagination li:first-child a.btnTitle{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
|
<?php if (!empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
|
||||||
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
|
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
* Please visit http://opensource.org/licenses/MIT for more information
|
* Please visit http://opensource.org/licenses/MIT for more information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||||
/* <style type="text/css" > */
|
/* <style type="text/css" > */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user