clean and update code
This commit is contained in:
parent
f1f56ca5e9
commit
5021c7a556
@ -145,12 +145,10 @@ $sql.= " GROUP BY p.rowid, p.ref, p.title, p.public";
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$var=true;
|
||||
$total=0;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
@ -202,12 +200,10 @@ $sql.= " GROUP BY p.rowid, p.ref, p.title, p.public";
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$var=true;
|
||||
$total=0;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
@ -263,11 +259,9 @@ if ($db->type != 'pgsql')
|
||||
if ( $resql )
|
||||
{
|
||||
$total = 0;
|
||||
$var=true;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$projectstatic->id=$row->rowid;
|
||||
@ -320,8 +314,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH))
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
$var=false;
|
||||
|
||||
while ($row = $db->fetch_object($resql))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
@ -369,7 +361,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR))
|
||||
$sql.= " AND p.rowid in (".$projectsListId.")";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.title, p.public";
|
||||
|
||||
$var=false;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
@ -463,8 +454,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
||||
$sql.= " ORDER BY t.dateo desc, t.rowid desc, t.datee";
|
||||
$sql.= $db->plimit($max+1); // We want more to know if we have more than limit
|
||||
|
||||
$var=true;
|
||||
|
||||
dol_syslog('projet:index.php: affectationpercent', LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
@ -492,7 +481,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
$username='';
|
||||
if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
@ -301,7 +301,6 @@ dol_fiche_head($head, 'project', $langs->trans("Projects"), -1, 'project');
|
||||
|
||||
// Main options
|
||||
$form=new Form($db);
|
||||
$var=true;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -313,8 +312,6 @@ print "<td>".$langs->trans("Parameters")."</td>\n";
|
||||
print '<td align="right" width="60">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '<td width="80"> </td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="80%">'.$langs->trans("ManageOpportunitiesStatus").'</td>';
|
||||
print '<td width="60" align="right">';
|
||||
@ -372,8 +369,6 @@ foreach ($dirmodels as $reldir)
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$var=true;
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||
@ -391,7 +386,6 @@ foreach ($dirmodels as $reldir)
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
@ -476,8 +470,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle))
|
||||
{
|
||||
$var=true;
|
||||
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||
@ -495,7 +487,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
|
||||
if ($module->isEnabled())
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
@ -600,7 +591,6 @@ print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach (array('','/doc') as $valdir)
|
||||
@ -637,7 +627,6 @@ foreach ($dirmodels as $reldir)
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
@ -759,7 +748,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach (array('','/doc') as $valdir)
|
||||
@ -796,7 +784,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name)?$name:$module->name);
|
||||
print "</td><td>\n";
|
||||
@ -875,7 +862,6 @@ print load_fiche_titre($langs->trans("Other"), '', '');
|
||||
|
||||
// Other options
|
||||
$form=new Form($db);
|
||||
$var=true;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -887,8 +873,6 @@ print "<td>".$langs->trans("Parameters")."</td>\n";
|
||||
print '<td align="right" width="60">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '<td width="80"> </td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="80%">'.$langs->trans("UseSearchToSelectProject").'</td>';
|
||||
if (! $conf->use_javascript_ajax)
|
||||
@ -912,7 +896,6 @@ else
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowToSelectProjectFromOtherCompany").'</td>';
|
||||
|
||||
|
||||
@ -265,7 +265,6 @@ if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$soci
|
||||
$sql.= " GROUP BY s.nom, s.rowid";
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
|
||||
$var=true;
|
||||
$resql = $db->query($sql);
|
||||
if ( $resql )
|
||||
{
|
||||
|
||||
@ -315,7 +315,6 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
$var=true;
|
||||
foreach ($data_all_year as $val)
|
||||
{
|
||||
$year = $val['year'];
|
||||
@ -323,7 +322,7 @@ foreach ($data_all_year as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
@ -335,7 +334,7 @@ foreach ($data_all_year as $val)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
|
||||
@ -174,7 +174,6 @@ print '<td align="right">'.$langs->trans("NbOfTasks").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$oldyear=0;
|
||||
$var=true;
|
||||
foreach ($data_all_year as $val)
|
||||
{
|
||||
$year = $val['year'];
|
||||
@ -182,13 +181,13 @@ foreach ($data_all_year as $val)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -162,10 +162,6 @@ if ($action == 'delete_resource')
|
||||
print $form->formconfirm($_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_resource",'','',1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$var=true;
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);
|
||||
|
||||
|
||||
@ -68,15 +68,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$thirdTypeSelect = GETPOST("third_select_id");
|
||||
$type_element = GETPOST('type_element')?GETPOST('type_element'):'';
|
||||
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("orders");
|
||||
$langs->load("suppliers");
|
||||
$langs->load("propal");
|
||||
$langs->load("interventions");
|
||||
$langs->load("contracts");
|
||||
$langs->load("products");
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('consumptionthirdparty'));
|
||||
@ -365,8 +358,7 @@ if ($sql_select)
|
||||
{
|
||||
$resql=$db->query($sql);
|
||||
if (!$resql) dol_print_error($db);
|
||||
|
||||
$var=true;
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param="&socid=".$socid."&type_element=".$type_element;
|
||||
@ -433,7 +425,6 @@ if ($sql_select)
|
||||
|
||||
if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status;
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nobordernopadding nowrap" width="100">';
|
||||
print $documentstatic->getNomUrl(1);
|
||||
@ -643,7 +634,7 @@ else if (empty($type_element) || $type_element == -1)
|
||||
print_liste_field_titre('Quantity',$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr '.$bc[0].'><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>';
|
||||
print '<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
@ -652,7 +643,7 @@ else {
|
||||
|
||||
print '<table class="liste" width="100%">'."\n";
|
||||
|
||||
print '<tr '.$bc[0].'><td class="opacitymedium" colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
print '<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user