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');
|
||||
$id = GETPOST('id');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
// TODO: revoir les droits car pas clair
|
||||
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
|
||||
|
||||
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");
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
$day=GETPOST("day","int")?GETPOST("day","int"):0;
|
||||
$actioncode=GETPOST("actioncode");
|
||||
$pid=GETPOST("projectid","int")?GETPOST("projectid","int"):0;
|
||||
$status=GETPOST("status");
|
||||
$maxprint=GETPOST("maxprint");
|
||||
@ -198,6 +199,7 @@ if ($filterd) $param.="&filterd=".$filterd;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
if ($pid) $param.="&projectid=".$pid;
|
||||
if ($actioncode) $param.="&actioncode=".$actioncode;
|
||||
if (GETPOST("type")) $param.="&type=".GETPOST("type");
|
||||
if ($action == 'show_day' || $action == 'show_week') $param.='&action='.$action;
|
||||
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 a.entity = '.$conf->entity;
|
||||
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 ($action == 'show_day')
|
||||
{
|
||||
|
||||
@ -39,6 +39,7 @@ $action=GETPOST('action','alpha');
|
||||
$year=GETPOST("year",'int');
|
||||
$month=GETPOST("month",'int');
|
||||
$day=GETPOST("day",'int');
|
||||
$actioncode=GETPOST('actioncode');
|
||||
$pid=GETPOST("projectid",'int');
|
||||
$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.= ' AND a.fk_user_author = u.rowid';
|
||||
$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 (!$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;
|
||||
|
||||
@ -26,22 +26,23 @@
|
||||
|
||||
/**
|
||||
* Show filter form in agenda view
|
||||
* @param $form
|
||||
* @param $canedit
|
||||
* @param $status
|
||||
* @param $year
|
||||
* @param $month
|
||||
* @param $day
|
||||
* @param $showbirthday
|
||||
* @param $filtera
|
||||
* @param $filtert
|
||||
* @param $filterd
|
||||
* @param $pid
|
||||
* @param $socid
|
||||
*
|
||||
* @param string $form Form name
|
||||
* @param int $canedit Can edit filter fields
|
||||
* @param int $status Status
|
||||
* @param int $year Year
|
||||
* @param int $month Month
|
||||
* @param int $day Day
|
||||
* @param int $showbirthday Show birthday
|
||||
* @param string $filtera Filter on create by user
|
||||
* @param string $filtert Filter on assigned to user
|
||||
* @param string $filterd Filter of done by user
|
||||
* @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)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$langs,$db;
|
||||
|
||||
// Filters
|
||||
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 $langs->trans("ActionsAskedBy");
|
||||
print ' </td><td nowrap="nowrap">';
|
||||
print $form->select_users($filtera,'userasked',1,'',!$canedit);
|
||||
print $form->select_dolusers($filtera,'userasked',1,'',!$canedit);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -74,14 +75,23 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
||||
print '<td nowrap="nowrap">';
|
||||
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy");
|
||||
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 '<tr>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
|
||||
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>';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user