NEW Remove background on agenda view when event is a not busy event.
This commit is contained in:
parent
7ea96d53a2
commit
c16a150a70
@ -133,7 +133,7 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
|
||||
{
|
||||
$assignedtouser=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
$assignedtouser[GETPOST('assignedtouser')]=array('id'=>GETPOST('assignedtouser'), 'transparency'=>GETPOST('transparency'),'mandatory'=>1);
|
||||
$assignedtouser[GETPOST('assignedtouser')]=array('id'=>GETPOST('assignedtouser'), 'transparency'=>GETPOST('transparency'), 'mandatory'=>1);
|
||||
$_SESSION['assignedtouser']=json_encode($assignedtouser);
|
||||
}
|
||||
$donotclearsession=1;
|
||||
@ -439,7 +439,7 @@ if ($action == 'update')
|
||||
if (! empty($_SESSION['assignedtouser'])) // Now concat assigned users
|
||||
{
|
||||
// Restore array with key with same value than param 'id'
|
||||
$tmplist1=json_decode($_SESSION['assignedtouser'], true); $tmplist2=array();
|
||||
$tmplist1=json_decode($_SESSION['assignedtouser'], true);
|
||||
foreach($tmplist1 as $key => $val)
|
||||
{
|
||||
if ($val['id'] > 0 && $val['id'] != $assignedtouser) $listofuserid[$val['id']]=$val;
|
||||
@ -449,7 +449,6 @@ if ($action == 'update')
|
||||
$assignedtouser=(! empty($object->userownerid) && $object->userownerid > 0 ? $object->userownerid : 0);
|
||||
if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser, 'mandatory'=>0, 'transparency'=>($user->id == $assignedtouser ? $transparency : '')); // Owner first
|
||||
}
|
||||
|
||||
$object->userassigned=array(); $object->userownerid=0; // Clear old content
|
||||
$i=0;
|
||||
foreach($listofuserid as $key => $val)
|
||||
@ -460,6 +459,7 @@ if ($action == 'update')
|
||||
}
|
||||
|
||||
$object->transparency = $transparency; // We set transparency on event (even if we can also store it on each user, standard says this property is for event)
|
||||
// TODO store also transparency on owner user
|
||||
|
||||
if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
|
||||
{
|
||||
@ -954,11 +954,11 @@ if ($id > 0)
|
||||
$object->location = GETPOST('location');
|
||||
$object->socid = GETPOST("socid");
|
||||
$socpeopleassigned = GETPOST("socpeopleassigned",'array');
|
||||
foreach ($socpeopleassigned as $id) $object->socpeopleassigned[$id] = array('id' => $id);
|
||||
foreach ($socpeopleassigned as $tmpid) $object->socpeopleassigned[$id] = array('id' => $tmpid);
|
||||
$object->contactid = GETPOST("contactid",'int');
|
||||
$object->fk_project = GETPOST("projectid",'int');
|
||||
|
||||
$object->note = GETPOST("note");
|
||||
$object->note = GETPOST("note",'none');
|
||||
}
|
||||
|
||||
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||
@ -1136,11 +1136,21 @@ if ($id > 0)
|
||||
$listofuserid=array(); // User assigned
|
||||
if (empty($donotclearsession))
|
||||
{
|
||||
if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid, 'type'=>'user', 'transparency'=>$object->userassigned[$user->id]['transparency'], 'answer_status'=>$object->userassigned[$user->id]['answer_status'], 'mandatory'=>$object->userassigned[$user->id]['mandatory']); // Owner first
|
||||
if ($object->userownerid > 0)
|
||||
{
|
||||
$listofuserid[$object->userownerid]=array(
|
||||
'id'=>$object->userownerid,
|
||||
'type'=>'user',
|
||||
//'transparency'=>$object->userassigned[$user->id]['transparency'],
|
||||
'transparency'=>$object->transparency, // Force transparency on ownerfrom event
|
||||
'answer_status'=>$object->userassigned[$object->userownerid]['answer_status'],
|
||||
'mandatory'=>$object->userassigned[$object->userownerid]['mandatory']
|
||||
);
|
||||
}
|
||||
if (! empty($object->userassigned)) // Now concat assigned users
|
||||
{
|
||||
// Restore array with key with same value than param 'id'
|
||||
$tmplist1=$object->userassigned; $tmplist2=array();
|
||||
$tmplist1=$object->userassigned;
|
||||
foreach($tmplist1 as $key => $val)
|
||||
{
|
||||
if ($val['id'] && $val['id'] != $object->userownerid)
|
||||
@ -1384,11 +1394,19 @@ if ($id > 0)
|
||||
$listofuserid=array();
|
||||
if (empty($donotclearsession))
|
||||
{
|
||||
if ($object->userownerid > 0) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first
|
||||
if ($object->userownerid > 0)
|
||||
{
|
||||
$listofuserid[$object->userownerid]=array(
|
||||
'id'=>$object->userownerid,
|
||||
'transparency'=>$object->transparency, // Force transparency on onwer from preoperty of event
|
||||
'answer_status'=>$object->userassigned[$object->userownerid]['answer_status'],
|
||||
'mandatory'=>$object->userassigned[$object->userownerid]['mandatory']
|
||||
);
|
||||
}
|
||||
if (! empty($object->userassigned)) // Now concat assigned users
|
||||
{
|
||||
// Restore array with key with same value than param 'id'
|
||||
$tmplist1=$object->userassigned; $tmplist2=array();
|
||||
$tmplist1=$object->userassigned;
|
||||
foreach($tmplist1 as $key => $val)
|
||||
{
|
||||
if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val;
|
||||
@ -1403,6 +1421,7 @@ if ($id > 0)
|
||||
$listofuserid=json_decode($_SESSION['assignedtouser'], true);
|
||||
}
|
||||
}
|
||||
|
||||
$listofcontactid=array(); // not used yet
|
||||
$listofotherid=array(); // not used yet
|
||||
print '<div class="assignedtouser">';
|
||||
|
||||
@ -571,8 +571,9 @@ class ActionComm extends CommonObject
|
||||
$this->type_color = $obj->type_color;
|
||||
$this->type_picto = $obj->type_picto;
|
||||
$transcode=$langs->trans("Action".$obj->type_code);
|
||||
$type_label=($transcode!="Action".$obj->type_code?$transcode:$obj->type_label);
|
||||
$this->type = $type_label;
|
||||
$this->type = (($transcode!="Action".$obj->type_code) ? $transcode : $obj->type_label);
|
||||
$transcode=$langs->trans("Action".$obj->type_code.'Short');
|
||||
$this->type_short = (($transcode!="Action".$obj->type_code.'Short') ? $transcode : '');
|
||||
|
||||
$this->code = $obj->code;
|
||||
$this->label = $obj->label;
|
||||
@ -589,11 +590,11 @@ class ActionComm extends CommonObject
|
||||
$this->authorid = $obj->fk_user_author;
|
||||
$this->usermodid = $obj->fk_user_mod;
|
||||
|
||||
if (!is_object($this->author)) $this->author = new stdClass(); // For avoid warning
|
||||
if (!is_object($this->author)) $this->author = new stdClass(); // To avoid warning
|
||||
$this->author->id = $obj->fk_user_author; // deprecated
|
||||
$this->author->firstname = $obj->firstname; // deprecated
|
||||
$this->author->lastname = $obj->lastname; // deprecated
|
||||
if (!is_object($this->usermod)) $this->usermod = new stdClass(); // For avoid warning
|
||||
if (!is_object($this->usermod)) $this->usermod = new stdClass(); // To avoid warning
|
||||
$this->usermod->id = $obj->fk_user_mod; // deprecated
|
||||
|
||||
$this->userownerid = $obj->fk_user_action;
|
||||
|
||||
@ -107,9 +107,10 @@ class CActionComm
|
||||
* @param string $excludetype Type to exclude ('system' or 'systemauto')
|
||||
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
|
||||
* @param string $morefilter Add more SQL filter
|
||||
* @param int $shortlabel 1=Get short label instead of long label
|
||||
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
|
||||
*/
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='')
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
$langs->load("commercial");
|
||||
@ -154,11 +155,21 @@ class CActionComm
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
$keyfortrans='';
|
||||
$code=$obj->code;
|
||||
if ($onlyautoornot > 0 && $code == 'AC_OTH') $code='AC_MANUAL';
|
||||
if ($onlyautoornot > 0 && $code == 'AC_OTH_AUTO') $code='AC_AUTO';
|
||||
$transcode=$langs->trans("Action".$code);
|
||||
$label = ($transcode!="Action".$code?$transcode:$langs->trans($obj->label));
|
||||
if ($shortlabel)
|
||||
{
|
||||
$keyfortrans="Action".$code.'Short';
|
||||
$transcode=$langs->trans($keyfortrans);
|
||||
}
|
||||
if (empty($keyfortrans) || $keyfortrans == $transcode)
|
||||
{
|
||||
$keyfortrans="Action".$code;
|
||||
$transcode=$langs->trans($keyfortrans);
|
||||
}
|
||||
$label = (($transcode!=$keyfortrans) ? $transcode : $langs->trans($obj->label));
|
||||
if ($onlyautoornot == -1 && ! empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! preg_match('/auto/i', $code))
|
||||
{
|
||||
$label=' '.$label;
|
||||
@ -166,7 +177,7 @@ class CActionComm
|
||||
$repcode['AC_NON_AUTO']=$langs->trans("ActionAC_MANUAL");
|
||||
}
|
||||
$repid[$obj->id] = $label;
|
||||
$repcode[$obj->code] = $label;
|
||||
$repcode[$obj->code] = $label;
|
||||
if ($onlyautoornot > 0 && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')';
|
||||
}
|
||||
$i++;
|
||||
|
||||
@ -1373,9 +1373,18 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
//print ' position: absolute; top: 40px; width: 50%;';
|
||||
//print '"';
|
||||
print '>';
|
||||
print '<table class="centpercent cal_event'.(empty($event->transparency)?'':' cal_event_busy').'" style="'.$h;
|
||||
print 'background: #'.$color.';';
|
||||
print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));';
|
||||
//var_dump($event->userassigned);
|
||||
//var_dump($event->transparency);
|
||||
print '<table class="centpercent cal_event'.(empty($event->transparency)?' cal_event_notbusy':' cal_event_busy').'" style="'.$h;
|
||||
if (empty($event->transparency))
|
||||
{
|
||||
print 'border: 2px solid #'.$color.';';
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'background: #'.$color.';';
|
||||
print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));';
|
||||
}
|
||||
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
|
||||
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
|
||||
//print ' -moz-border-radius:4px;"';
|
||||
|
||||
@ -121,8 +121,8 @@ $hookmanager->initHooks(array('agendalist'));
|
||||
$arrayfields=array(
|
||||
'a.id'=>array('label'=>"Ref", 'checked'=>1),
|
||||
'owner'=>array('label'=>"Owner", 'checked'=>1),
|
||||
'a.label'=>array('label'=>"Title", 'checked'=>1),
|
||||
'c.libelle'=>array('label'=>"Type", 'checked'=>1),
|
||||
'a.label'=>array('label'=>"Title", 'checked'=>1),
|
||||
'a.datep'=>array('label'=>"DateStart", 'checked'=>1),
|
||||
'a.datep2'=>array('label'=>"DateEnd", 'checked'=>1),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||
@ -542,7 +542,7 @@ if ($resql)
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
$caction=new CActionComm($db);
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
|
||||
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
|
||||
|
||||
$var=true;
|
||||
while ($i < min($num,$limit))
|
||||
@ -584,17 +584,21 @@ if ($resql)
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['c.libelle']['checked'])) {
|
||||
// Type
|
||||
|
||||
// Type
|
||||
if (! empty($arrayfields['c.libelle']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
|
||||
else {
|
||||
if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
|
||||
if ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
|
||||
if ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
|
||||
if ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
|
||||
if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif ($actionstatic->type_code == 'AC_INT') print img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
|
||||
elseif (! preg_match('/_AUTO/', $actionstatic->type_code)) print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
|
||||
}
|
||||
}
|
||||
$labeltype=$obj->type_code;
|
||||
@ -603,15 +607,16 @@ if ($resql)
|
||||
print dol_trunc($labeltype,28);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Label
|
||||
if (! empty($arrayfields['a.label']['checked'])) {
|
||||
// Label
|
||||
print '<td class="tdoverflowmax300">';
|
||||
print $actionstatic->label;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Start date
|
||||
if (! empty($arrayfields['a.datep']['checked'])) {
|
||||
// Start date
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->dp),"dayhour");
|
||||
$late=0;
|
||||
|
||||
@ -4361,7 +4361,7 @@ abstract class CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Function to get extra fields of a member into $this->array_options
|
||||
* Function to get extra fields of an object into $this->array_options
|
||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||
*
|
||||
* @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters.
|
||||
|
||||
@ -1692,10 +1692,10 @@ class Form
|
||||
// Show my availability
|
||||
if ($showproperties)
|
||||
{
|
||||
if ($user->id == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($user->id, array_keys($listofuserid)))
|
||||
if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid)))
|
||||
{
|
||||
$out.='<div class="myavailability inline-block">';
|
||||
$out.=' - <span class="opacitymedium">'.$langs->trans("MyAvailability").':</span> <input id="transparency" class="marginleftonly marginrightonly" '.($action == 'view'?'disabled':'').' type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||
$out.=' - <span class="opacitymedium">'.$langs->trans("Availability").':</span> <input id="transparency" class="marginleftonly marginrightonly" '.($action == 'view'?'disabled':'').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency']?' checked':'').'>'.$langs->trans("Busy");
|
||||
$out.='</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ class FormActions
|
||||
if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
|
||||
}
|
||||
}
|
||||
print $action->type;
|
||||
print $action->type_short ? $action->type_short : $action->type;
|
||||
print '</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td align="center">'.dol_print_date($action->datep, 'dayhour', 'tzuserrel');
|
||||
|
||||
@ -66,6 +66,7 @@ ActionAC_OTH=Other
|
||||
ActionAC_OTH_AUTO=Automatically inserted events
|
||||
ActionAC_MANUAL=Manually inserted events
|
||||
ActionAC_AUTO=Automatically inserted events
|
||||
ActionAC_OTH_AUTOShort=Auto
|
||||
Stats=Sales statistics
|
||||
StatusProsp=Prospect status
|
||||
DraftPropals=Draft commercial proposals
|
||||
|
||||
@ -3539,7 +3539,7 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
||||
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||
.cal_event_busy { }
|
||||
.cal_peruserviewname { max-width: 100px; height: 22px; }
|
||||
|
||||
|
||||
@ -3608,7 +3608,7 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
||||
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||
.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||
.cal_event_busy { }
|
||||
.cal_peruserviewname { max-width: 100px; height: 22px; }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user