Task 188: Add filter on event type
This commit is contained in:
parent
37cca4231a
commit
1015cefcfd
@ -48,7 +48,6 @@ $action=GETPOST("action");
|
|||||||
$socid = GETPOST('socid');
|
$socid = GETPOST('socid');
|
||||||
$id = GETPOST('id');
|
$id = GETPOST('id');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
// TODO: revoir les droits car pas clair
|
|
||||||
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
|
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
|
||||||
|
|
||||||
if (isset($_GET["error"])) $error=$_GET["error"];
|
if (isset($_GET["error"])) $error=$_GET["error"];
|
||||||
|
|||||||
@ -69,6 +69,7 @@ $year=GETPOST("year","int")?GETPOST("year","int"):date("Y");
|
|||||||
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
$month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
||||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||||
$day=GETPOST("day","int")?GETPOST("day","int"):0;
|
$day=GETPOST("day","int")?GETPOST("day","int"):0;
|
||||||
|
$actioncode=GETPOST("actioncode");
|
||||||
$pid=GETPOST("projectid","int")?GETPOST("projectid","int"):0;
|
$pid=GETPOST("projectid","int")?GETPOST("projectid","int"):0;
|
||||||
$status=GETPOST("status");
|
$status=GETPOST("status");
|
||||||
$maxprint=GETPOST("maxprint");
|
$maxprint=GETPOST("maxprint");
|
||||||
@ -198,6 +199,7 @@ if ($filterd) $param.="&filterd=".$filterd;
|
|||||||
if ($socid) $param.="&socid=".$socid;
|
if ($socid) $param.="&socid=".$socid;
|
||||||
if ($showbirthday) $param.="&showbirthday=1";
|
if ($showbirthday) $param.="&showbirthday=1";
|
||||||
if ($pid) $param.="&projectid=".$pid;
|
if ($pid) $param.="&projectid=".$pid;
|
||||||
|
if ($actioncode) $param.="&actioncode=".$actioncode;
|
||||||
if (GETPOST("type")) $param.="&type=".GETPOST("type");
|
if (GETPOST("type")) $param.="&type=".GETPOST("type");
|
||||||
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
|
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
|
||||||
if ($maxprint) $param.="&maxprint=on";
|
if ($maxprint) $param.="&maxprint=on";
|
||||||
@ -281,6 +283,7 @@ $sql.= ' AND a.fk_user_author = u.rowid';
|
|||||||
$sql.= ' AND u.entity in (0,'.$conf->entity.')'; // To limit to entity
|
$sql.= ' AND u.entity in (0,'.$conf->entity.')'; // To limit to entity
|
||||||
$sql.= ' AND a.entity = '.$conf->entity;
|
$sql.= ' AND a.entity = '.$conf->entity;
|
||||||
if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit to external user company
|
if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit to external user company
|
||||||
|
if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
|
||||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||||
if ($action == 'show_day')
|
if ($action == 'show_day')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,6 +39,7 @@ $action=GETPOST('action','alpha');
|
|||||||
$year=GETPOST("year",'int');
|
$year=GETPOST("year",'int');
|
||||||
$month=GETPOST("month",'int');
|
$month=GETPOST("month",'int');
|
||||||
$day=GETPOST("day",'int');
|
$day=GETPOST("day",'int');
|
||||||
|
$actioncode=GETPOST('actioncode');
|
||||||
$pid=GETPOST("projectid",'int');
|
$pid=GETPOST("projectid",'int');
|
||||||
$status=GETPOST("status",'alpha');
|
$status=GETPOST("status",'alpha');
|
||||||
|
|
||||||
@ -144,6 +145,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid";
|
|||||||
$sql.= " WHERE c.id = a.fk_action";
|
$sql.= " WHERE c.id = a.fk_action";
|
||||||
$sql.= ' AND a.fk_user_author = u.rowid';
|
$sql.= ' AND a.fk_user_author = u.rowid';
|
||||||
$sql.= ' AND a.entity = '.$conf->entity; // To limit to entity
|
$sql.= ' AND a.entity = '.$conf->entity; // To limit to entity
|
||||||
|
if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'";
|
||||||
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
|
|||||||
@ -26,22 +26,23 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show filter form in agenda view
|
* Show filter form in agenda view
|
||||||
* @param $form
|
*
|
||||||
* @param $canedit
|
* @param string $form Form name
|
||||||
* @param $status
|
* @param int $canedit Can edit filter fields
|
||||||
* @param $year
|
* @param int $status Status
|
||||||
* @param $month
|
* @param int $year Year
|
||||||
* @param $day
|
* @param int $month Month
|
||||||
* @param $showbirthday
|
* @param int $day Day
|
||||||
* @param $filtera
|
* @param int $showbirthday Show birthday
|
||||||
* @param $filtert
|
* @param string $filtera Filter on create by user
|
||||||
* @param $filterd
|
* @param string $filtert Filter on assigned to user
|
||||||
* @param $pid
|
* @param string $filterd Filter of done by user
|
||||||
* @param $socid
|
* @param int $pid Product id
|
||||||
|
* @param int $socid Third party id
|
||||||
*/
|
*/
|
||||||
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid)
|
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs,$db;
|
||||||
|
|
||||||
// Filters
|
// Filters
|
||||||
if ($canedit || $conf->projet->enabled)
|
if ($canedit || $conf->projet->enabled)
|
||||||
@ -66,7 +67,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
|||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("ActionsAskedBy");
|
print $langs->trans("ActionsAskedBy");
|
||||||
print ' </td><td nowrap="nowrap">';
|
print ' </td><td nowrap="nowrap">';
|
||||||
print $form->select_users($filtera,'userasked',1,'',!$canedit);
|
print $form->select_dolusers($filtera,'userasked',1,'',!$canedit);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -74,14 +75,23 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
|||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy");
|
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy");
|
||||||
print ' </td><td nowrap="nowrap">';
|
print ' </td><td nowrap="nowrap">';
|
||||||
print $form->select_users($filtert,'usertodo',1,'',!$canedit);
|
print $form->select_dolusers($filtert,'usertodo',1,'',!$canedit);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
|
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
|
||||||
print ' </td><td nowrap="nowrap">';
|
print ' </td><td nowrap="nowrap">';
|
||||||
print $form->select_users($filterd,'userdone',1,'',!$canedit);
|
print $form->select_dolusers($filterd,'userdone',1,'',!$canedit);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php');
|
||||||
|
$htmlactions=new FormActions($db);
|
||||||
|
print '<tr>';
|
||||||
|
print '<td nowrap="nowrap">';
|
||||||
|
print $langs->trans("Type");
|
||||||
|
print ' </td><td nowrap="nowrap">';
|
||||||
|
print $htmlactions->select_type_actions(GETPOST('actioncode'), "actioncode");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user