Uniformize GUI. All lists must have a search on status at end and last
column is dedicaded to future "mass action checkbox".
This commit is contained in:
parent
b2a2f5b449
commit
480623a6d5
@ -1565,13 +1565,14 @@ else
|
||||
if ($objp->fk_product) print '<select id="fournprice" name="fournprice"></select>';
|
||||
print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht,0,'',0).'"></td>';
|
||||
}
|
||||
print '<td align="center" rowspan="2" valign="middle"><input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">';
|
||||
print '<td align="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">';
|
||||
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
|
||||
$colspan=5;
|
||||
$colspan=6;
|
||||
if (! empty($conf->margin->enabled) && ! empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) $colspan++;
|
||||
if($conf->global->PRODUCT_USE_UNITS) $colspan++;
|
||||
if($conf->global->PRODUCT_USE_UNITS) $colspan++;
|
||||
|
||||
// Ligne dates prevues
|
||||
print "<tr ".$bc[$var].">";
|
||||
@ -1746,22 +1747,23 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DateServiceActivate").'</td><td>';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td>';
|
||||
print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>'.$langs->trans("DateEndPlanned").'</td><td>';
|
||||
print '<td class="nohover">'.$langs->trans("DateEndPlanned").'</td><td>';
|
||||
print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" rowspan="2" valign="middle">';
|
||||
print '<td align="center nohover" rowspan="2" valign="middle">';
|
||||
print '<input type="submit" class="button" name="activate" value="'.$langs->trans("Activate").'"><br>';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Comment").'</td><td colspan="'.($conf->margin->enabled?4:3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover" colspan="'.($conf->margin->enabled?4:3).'"><input size="80" type="text" name="comment" value="'.$_POST["comment"].'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1798,7 +1800,7 @@ else
|
||||
$now=dol_now();
|
||||
if ($dateactend > $now) $dateactend=$now;
|
||||
|
||||
print '<tr '.$bc[$var].'><td colspan="2">';
|
||||
print '<tr '.$bc[$var].'><td colspan="2" class="nohover">';
|
||||
if ($objp->statut >= 4)
|
||||
{
|
||||
if ($objp->statut == 4)
|
||||
@ -1809,11 +1811,12 @@ else
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right" rowspan="2"><input type="submit" class="button" name="close" value="'.$langs->trans("Close").'"><br>';
|
||||
print '<td align="right" rowspan="2" class="nohover">';
|
||||
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Close").'"><br>';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Comment").'</td><td><input size="70" type="text" class="flat" name="comment" value="'.GETPOST('comment').'"></td></tr>';
|
||||
print '<tr '.$bc[$var].'><td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.GETPOST('comment').'"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
@ -48,6 +48,7 @@ $filter=GETPOST("filter");
|
||||
$search_name=GETPOST("search_name");
|
||||
$search_contract=GETPOST("search_contract");
|
||||
$search_service=GETPOST("search_service");
|
||||
$search_status=GETPOST("search_status","alpha");
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
@ -65,6 +66,23 @@ $contratid = GETPOST('id','int');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contrat',$contratid);
|
||||
|
||||
if ($search_status != '')
|
||||
{
|
||||
$tmp=explode('&', $search_status);
|
||||
$mode=$tmp[0];
|
||||
if (empty($tmp[1])) $filter='';
|
||||
else
|
||||
{
|
||||
if ($tmp[1] == 'filter=notexpired') $filter='notexpired';
|
||||
if ($tmp[1] == 'filter=expired') $filter='expired';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$search_status = $mode;
|
||||
if ($filter == 'expired') $search_status.='&filter=expired';
|
||||
if ($filter == 'notexpired') $search_status.='&filter=notexpired';
|
||||
}
|
||||
|
||||
$staticcontrat=new Contrat($db);
|
||||
$staticcontratligne=new ContratLigne($db);
|
||||
@ -75,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_name="";
|
||||
$search_contract="";
|
||||
$search_service="";
|
||||
$search_status=-1;
|
||||
$op1month="";
|
||||
$op1day="";
|
||||
$op1year="";
|
||||
@ -83,6 +102,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$op2day="";
|
||||
$op2year="";
|
||||
$filter_op2="";
|
||||
$mode='';
|
||||
$filter='';
|
||||
}
|
||||
|
||||
/*
|
||||
@ -117,6 +138,7 @@ if ($mode == "0") $sql.= " AND cd.statut = 0";
|
||||
if ($mode == "4") $sql.= " AND cd.statut = 4";
|
||||
if ($mode == "5") $sql.= " AND cd.statut = 5";
|
||||
if ($filter == "expired") $sql.= " AND cd.date_fin_validite < '".$db->idate($now)."'";
|
||||
if ($filter == "notexpired") $sql.= " AND cd.date_fin_validite >= '".$db->idate($now)."'";
|
||||
if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'";
|
||||
if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'";
|
||||
if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')";
|
||||
@ -169,6 +191,7 @@ if ($resql)
|
||||
if ($mode == "" || $mode < 5) print_liste_field_titre($langs->trans("DateEndPlannedShort"),$_SERVER["PHP_SELF"], "cd.date_fin_validite",$param,'',' align="center"',$sortfield,$sortorder);
|
||||
else print_liste_field_titre($langs->trans("DateEndRealShort"),$_SERVER["PHP_SELF"], "cd.date_cloture",$param,'',' align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -179,11 +202,11 @@ if ($resql)
|
||||
print '</td>';
|
||||
// Service label
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="18" name="search_service" value="'.dol_escape_htmltag($search_service).'">';
|
||||
print '<input type="text" class="flat" size="12" name="search_service" value="'.dol_escape_htmltag($search_service).'">';
|
||||
print '</td>';
|
||||
// Third party
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="24" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
||||
print '<input type="text" class="flat" size="12" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$arrayofoperators=array('<'=>'<','>'=>'>');
|
||||
@ -199,6 +222,16 @@ if ($resql)
|
||||
$filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year);
|
||||
print $form->select_date($filter_date2,'op2',0,0,1,'',1,0,1);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
$arrayofstatus=array(
|
||||
'0'=>$langs->trans("ServiceStatusInitial"),
|
||||
'4'=>$langs->trans("ServiceStatusRunning"),
|
||||
'4&filter=notexpired'=>$langs->trans("ServiceStatusNotLate"),
|
||||
'4&filter=expired'=>$langs->trans("ServiceStatusLate"),
|
||||
'5'=>$langs->trans("ServiceStatusClosed")
|
||||
);
|
||||
print $form->selectarray('search_status',$arrayofstatus,(strstr($search_status, ',')?-1:$search_status),1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
@ -272,6 +305,7 @@ if ($resql)
|
||||
print $staticcontratligne->LibStatut($obj->statut,5,($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)?1:0);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -286,6 +320,6 @@ else
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -730,8 +730,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->contrat->enabled))
|
||||
{
|
||||
$langs->load("contracts");
|
||||
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("Contracts"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000);
|
||||
$newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContract"), 1, $user->rights->contrat->creer);
|
||||
$newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->rights->contrat->lire, '', $mainmenu, 'contracts', 2000);
|
||||
$newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->rights->contrat->creer);
|
||||
$newmenu->add("/contrat/list.php?leftmenu=contracts", $langs->trans("List"), 1, $user->rights->contrat->lire);
|
||||
$newmenu->add("/contrat/services.php?leftmenu=contracts", $langs->trans("MenuServices"), 1, $user->rights->contrat->lire);
|
||||
if (empty($leftmenu) || $leftmenu=="contracts") $newmenu->add("/contrat/services.php?leftmenu=contracts&mode=0", $langs->trans("MenuInactiveServices"), 2, $user->rights->contrat->lire);
|
||||
|
||||
@ -19,6 +19,7 @@ ServiceStatusLateShort=Expired
|
||||
ServiceStatusClosed=Closed
|
||||
ServicesLegend=Services legend
|
||||
Contracts=Contracts
|
||||
ContractsSubscriptions=Contracts/Subscriptions
|
||||
ContractsAndLine=Contracts and line of contracts
|
||||
Contract=Contract
|
||||
ContractLine=Contract line
|
||||
@ -30,6 +31,7 @@ MenuRunningServices=Running services
|
||||
MenuExpiredServices=Expired services
|
||||
MenuClosedServices=Closed services
|
||||
NewContract=New contract
|
||||
NewContractSubscription=New contract/subscription
|
||||
AddContract=Create contract
|
||||
SearchAContract=Search a contract
|
||||
DeleteAContract=Delete a contract
|
||||
|
||||
Loading…
Reference in New Issue
Block a user