Some fix on per user view.
This commit is contained in:
parent
0390085f54
commit
06cc08026b
@ -1248,7 +1248,8 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
if ($action != 'edit')
|
||||||
|
{
|
||||||
// Link to agenda views
|
// Link to agenda views
|
||||||
print '<div id="agendaviewbutton">';
|
print '<div id="agendaviewbutton">';
|
||||||
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
|
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
|
||||||
@ -1288,6 +1289,7 @@ if ($id > 0)
|
|||||||
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
|
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
|
||||||
print '</form>'."\n";
|
print '</form>'."\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -419,7 +419,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
while ($obj = $this->db->fetch_object($resql2))
|
while ($obj = $this->db->fetch_object($resql2))
|
||||||
{
|
{
|
||||||
$this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency);
|
if ($obj->fk_element > 0) $this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency);
|
||||||
if (empty($this->userownerid)) $this->userownerid=$obj->fk_element; // If not defined (should not happened, we fix this)
|
if (empty($this->userownerid)) $this->userownerid=$obj->fk_element; // If not defined (should not happened, we fix this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,11 @@ $filterd = GETPOST("userdone","int",3)?GETPOST("userdone","int",3):GETPOST("filt
|
|||||||
$usergroup = GETPOST("usergroup","int",3);
|
$usergroup = GETPOST("usergroup","int",3);
|
||||||
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||||
|
|
||||||
|
// If not choice done on calendar owner, we filter on user.
|
||||||
|
if (empty($filtert) && empty($conf->AGENDA_ALL_CALENDARS))
|
||||||
|
{
|
||||||
|
$filtert=$user->id;
|
||||||
|
}
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
|
|||||||
@ -56,6 +56,12 @@ $filterd = GETPOST("userdone","int",3)?GETPOST("userdone","int",3):GETPOST("filt
|
|||||||
$usergroup = GETPOST("usergroup","int",3);
|
$usergroup = GETPOST("usergroup","int",3);
|
||||||
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||||
|
|
||||||
|
// If not choice done on calendar owner, we filter on user.
|
||||||
|
if (empty($filtert) && empty($conf->AGENDA_ALL_CALENDARS))
|
||||||
|
{
|
||||||
|
$filtert=$user->id;
|
||||||
|
}
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
@ -98,6 +104,7 @@ $hookmanager->initHooks(array('agendalist'));
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
|
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
|
||||||
{
|
{
|
||||||
$param='';
|
$param='';
|
||||||
@ -144,7 +151,7 @@ $sql.= " a.fk_contact, a.note, a.label, a.percent as percent,";
|
|||||||
$sql.= " c.code as acode, c.libelle,";
|
$sql.= " c.code as acode, c.libelle,";
|
||||||
$sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
|
$sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
|
||||||
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
|
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
|
||||||
$sql.= " ud.login as logindone, ud.rowid as useriddone,";
|
//$sql.= " ud.login as logindone, ud.rowid as useriddone,";
|
||||||
$sql.= " sp.lastname, sp.firstname";
|
$sql.= " sp.lastname, sp.firstname";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX.'user as u,';
|
$sql.= " ".MAIN_DB_PREFIX.'user as u,';
|
||||||
@ -154,7 +161,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid";
|
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid";
|
||||||
if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu";
|
if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu";
|
||||||
$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';
|
||||||
@ -244,7 +251,7 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("AffectedTo"),$_SERVER["PHP_SELF"],"ut.login",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"ut.login",$param,"","",$sortfield,$sortorder);
|
||||||
//print_liste_field_titre($langs->trans("DoneBy"),$_SERVER["PHP_SELF"],"ud.login",$param,"","",$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("DoneBy"),$_SERVER["PHP_SELF"],"ud.login",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -47,6 +47,11 @@ $usergroup = GETPOST("usergroup","int",3);
|
|||||||
//$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
//$showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1;
|
||||||
$showbirthday = 0;
|
$showbirthday = 0;
|
||||||
|
|
||||||
|
// If not choice done on calendar owner, we filter on user.
|
||||||
|
if (empty($filtert) && empty($conf->AGENDA_ALL_CALENDARS))
|
||||||
|
{
|
||||||
|
$filtert=$user->id;
|
||||||
|
}
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -557,30 +562,32 @@ while ($i < 7)
|
|||||||
}
|
}
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
// Define $usernames
|
// Define $usernames
|
||||||
$usernames = array(); //init
|
$usernames = array(); //init
|
||||||
/* Use this to have list of users only if users have events
|
$usernamesid = array();
|
||||||
|
/* Use this to have list of users only if users have events */
|
||||||
foreach ($eventarray as $daykey => $notused)
|
foreach ($eventarray as $daykey => $notused)
|
||||||
{
|
{
|
||||||
$annee = date('Y',$daykey);
|
// Get all assigned users for each event
|
||||||
$mois = date('m',$daykey);
|
|
||||||
$jour = date('d',$daykey);
|
|
||||||
//if ($day==$jour && $month==$mois && $year==$annee)
|
|
||||||
//{
|
|
||||||
//Tout les events à la même date :
|
|
||||||
foreach ($eventarray[$daykey] as $index => $event)
|
foreach ($eventarray[$daykey] as $index => $event)
|
||||||
{
|
{
|
||||||
$myuser = new User($db);
|
$event->fetch_userassigned();
|
||||||
$user_id = $event->usertodo->id;
|
$listofuserid=$event->userassigned;
|
||||||
$myuser->fetch($user_id);
|
foreach($listofuserid as $userid => $tmp)
|
||||||
$username = $myuser->getFullName($langs);
|
|
||||||
if (! in_array($username, $usernames))
|
|
||||||
{
|
{
|
||||||
$usernames[] = $username;
|
if (! in_array($userid, $usernamesid)) $usernamesid[$userid] = $userid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
}*/
|
foreach($usernamesid as $id)
|
||||||
|
{
|
||||||
|
$tmpuser=new User($db);
|
||||||
|
$result=$tmpuser->fetch($id);
|
||||||
|
$usernames[]=$tmpuser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if ($filtert > 0)
|
if ($filtert > 0)
|
||||||
{
|
{
|
||||||
$tmpuser = new User($db);
|
$tmpuser = new User($db);
|
||||||
@ -598,7 +605,7 @@ else
|
|||||||
$tmpgroup = new UserGroup($db);
|
$tmpgroup = new UserGroup($db);
|
||||||
//$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups
|
//$tmpgroup->fetch($usergroup); No fetch, we want all users for all groups
|
||||||
$usernames = $tmpgroup->listUsersForGroup();
|
$usernames = $tmpgroup->listUsersForGroup();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Load array of colors by type
|
// Load array of colors by type
|
||||||
$colorsbytype=array();
|
$colorsbytype=array();
|
||||||
|
|||||||
@ -74,7 +74,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
|||||||
//print ' </td><td class="nowrap maxwidthonsmartphone">';
|
//print ' </td><td class="nowrap maxwidthonsmartphone">';
|
||||||
//print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit);
|
//print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit);
|
||||||
//print ' '.$langs->trans("or") . ' ';
|
//print ' '.$langs->trans("or") . ' ';
|
||||||
print $langs->trans("ActionAffectedTo").' ';
|
print $langs->trans("ActionsOwnedBy").' ';
|
||||||
print '</td><td class="nowrap maxwidthonsmartphone">';
|
print '</td><td class="nowrap maxwidthonsmartphone">';
|
||||||
//print $langs->trans("User");
|
//print $langs->trans("User");
|
||||||
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
|
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
|
||||||
|
|||||||
@ -7,6 +7,7 @@ Agendas=Agendas
|
|||||||
Calendar=Calendar
|
Calendar=Calendar
|
||||||
Calendars=Calendars
|
Calendars=Calendars
|
||||||
LocalAgenda=Internal calendar
|
LocalAgenda=Internal calendar
|
||||||
|
ActionsOwnedBy=Event owned by
|
||||||
AffectedTo=Assigned to
|
AffectedTo=Assigned to
|
||||||
DoneBy=Done by
|
DoneBy=Done by
|
||||||
Event=Event
|
Event=Event
|
||||||
|
|||||||
@ -2375,7 +2375,7 @@ table.cal_month { border-spacing: 0px; }
|
|||||||
.cal_past { }
|
.cal_past { }
|
||||||
.cal_peruser { padding: 0px; }
|
.cal_peruser { padding: 0px; }
|
||||||
.peruser_busy { background: #CC8888; }
|
.peruser_busy { background: #CC8888; }
|
||||||
.peruser_notbusy { background: #EEDDDD; }
|
.peruser_notbusy { background: #EEDDDD; opacity: 0.5; }
|
||||||
table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px;
|
table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px;
|
||||||
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
|
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
|
||||||
moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
|
moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user