Uniformize code.
This commit is contained in:
parent
2b95bd2fcc
commit
cd4c81d15d
@ -44,6 +44,8 @@ $object = new Adherent($db);
|
|||||||
$result=$object->fetch($id);
|
$result=$object->fetch($id);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
$adht = new AdherentType($db);
|
$adht = new AdherentType($db);
|
||||||
$result=$adht->fetch($object->typeid);
|
$result=$adht->fetch($object->typeid);
|
||||||
}
|
}
|
||||||
@ -146,7 +148,23 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ActionsOnMember"),'','');
|
$out='';
|
||||||
|
|
||||||
|
/*$objthirdparty=$object->thirdparty;
|
||||||
|
$objcon=new stdClass();
|
||||||
|
|
||||||
|
$permok=$user->rights->agenda->myactions->create;
|
||||||
|
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||||
|
{
|
||||||
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||||
|
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
||||||
|
$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
$out.="</a>";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ActionsOnMember"),$out,'');
|
||||||
|
|
||||||
// List of todo actions
|
// List of todo actions
|
||||||
show_actions_todo($conf,$langs,$db,$object);
|
show_actions_todo($conf,$langs,$db,$object);
|
||||||
|
|||||||
@ -601,6 +601,7 @@ else
|
|||||||
$colorsbytype=array();
|
$colorsbytype=array();
|
||||||
|
|
||||||
// Loop on each user to show calendar
|
// Loop on each user to show calendar
|
||||||
|
$todayarray=dol_getdate($now,'fast');
|
||||||
$sav = $tmpday;
|
$sav = $tmpday;
|
||||||
$showheader = true;
|
$showheader = true;
|
||||||
foreach ($usernames as $username)
|
foreach ($usernames as $username)
|
||||||
@ -629,11 +630,10 @@ foreach ($usernames as $username)
|
|||||||
$style='cal_current_month';
|
$style='cal_current_month';
|
||||||
if ($iter_day == 6) $style.=' cal_other_month';
|
if ($iter_day == 6) $style.=' cal_other_month';
|
||||||
$today=0;
|
$today=0;
|
||||||
$todayarray=dol_getdate($now,'fast');
|
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
|
||||||
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
|
|
||||||
if ($today) $style='cal_today_peruser';
|
if ($today) $style='cal_today_peruser';
|
||||||
|
|
||||||
show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
|
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -642,7 +642,6 @@ foreach ($usernames as $username)
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
var_dump($eventarray);exit;
|
|
||||||
|
|
||||||
// Add js code to manage click on a box
|
// Add js code to manage click on a box
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
@ -731,9 +730,11 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$annee = date('Y',$daykey);
|
$annee = date('Y',$daykey);
|
||||||
$mois = date('m',$daykey);
|
$mois = date('m',$daykey);
|
||||||
$jour = date('d',$daykey);
|
$jour = date('d',$daykey);
|
||||||
if ($day==$jour && $month==$mois && $year==$annee)
|
//print $annee.'-'.$mois.'-'.$jour.' '.$year.'-'.$month.'-'.$day."<br>\n";
|
||||||
|
|
||||||
|
if ($day==$jour && $month==$mois && $year==$annee) // Is it the day we are looking for when calling function ?
|
||||||
{
|
{
|
||||||
//Tout les events à la même date :
|
// Scan all event for this date
|
||||||
foreach ($eventarray[$daykey] as $index => $event)
|
foreach ($eventarray[$daykey] as $index => $event)
|
||||||
{
|
{
|
||||||
$keysofuserassigned=array_keys($event->userassigned);
|
$keysofuserassigned=array_keys($event->userassigned);
|
||||||
@ -836,7 +837,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break; // We found the date we were looking for. No need to search anymore.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1110,7 +1110,22 @@ else
|
|||||||
|
|
||||||
if (! empty($conf->agenda->enabled))
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');
|
$objthirdparty=$objsoc;
|
||||||
|
$objcon=$object;
|
||||||
|
|
||||||
|
$out='';
|
||||||
|
$permok=$user->rights->agenda->myactions->create;
|
||||||
|
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||||
|
{
|
||||||
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||||
|
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
||||||
|
$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),$out,'');
|
||||||
|
|
||||||
print show_actions_todo($conf,$langs,$db,$objsoc,$object);
|
print show_actions_todo($conf,$langs,$db,$objsoc,$object);
|
||||||
|
|
||||||
|
|||||||
@ -914,16 +914,6 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
|||||||
if (get_class($object) == 'Societe') $out.='</a>';
|
if (get_class($object) == 'Societe') $out.='</a>';
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
$out.='<td colspan="5" align="right">';
|
$out.='<td colspan="5" align="right">';
|
||||||
$permok=$user->rights->agenda->myactions->create;
|
|
||||||
if (($object->id || $objcon->id) && $permok)
|
|
||||||
{
|
|
||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
|
||||||
if (get_class($object) == 'Societe') $out.='&socid='.$object->id;
|
|
||||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
|
||||||
$out.=$langs->trans("AddAnAction").' ';
|
|
||||||
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
|
||||||
$out.="</a>";
|
|
||||||
}
|
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
$out.='</tr>';
|
$out.='</tr>';
|
||||||
|
|
||||||
@ -1208,16 +1198,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
|||||||
if (get_class($object) == 'Societe') $out.='</a>';
|
if (get_class($object) == 'Societe') $out.='</a>';
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
$out.='<td colspan="5" align="right">';
|
$out.='<td colspan="5" align="right">';
|
||||||
$permok=$user->rights->agenda->myactions->create;
|
|
||||||
if ((! empty($object->id) || ! empty($objcon->id)) && $permok)
|
|
||||||
{
|
|
||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
|
||||||
if (get_class($object) == 'Societe') $out.='&socid='.$object->id;
|
|
||||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
|
||||||
$out.=$langs->trans("AddAnAction").' ';
|
|
||||||
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
|
||||||
$out.="</a>";
|
|
||||||
}
|
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
$out.='</tr>';
|
$out.='</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -171,7 +171,22 @@ if ($socid)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
|
$objthirdparty=$soc;
|
||||||
|
$objcon=new stdClass();
|
||||||
|
|
||||||
|
$out='';
|
||||||
|
$permok=$user->rights->agenda->myactions->create;
|
||||||
|
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||||
|
{
|
||||||
|
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||||
|
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
||||||
|
$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ActionsOnCompany"),$out,'');
|
||||||
|
|
||||||
// List of todo actions
|
// List of todo actions
|
||||||
show_actions_todo($conf,$langs,$db,$soc);
|
show_actions_todo($conf,$langs,$db,$soc);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user