mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Standardize code for events
This commit is contained in:
parent
2dee81125a
commit
85606126a9
|
|
@ -38,6 +38,28 @@ $langs->load("members");
|
|||
|
||||
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='a.datep,a.id';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||
}
|
||||
$search_agenda_label=GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$id);
|
||||
|
||||
|
|
@ -56,7 +78,26 @@ if ($result > 0)
|
|||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Cancel
|
||||
if (GETPOST('cancel','alpha') && ! empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -103,25 +144,33 @@ if ($object->id > 0)
|
|||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
*/
|
||||
//print '<div class="tabsAction">';
|
||||
//print '</div>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
$morehtmlcenter = '';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a></div>';
|
||||
$morehtmlcenter.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
$out='';
|
||||
$param='&id='.$id;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
print load_fiche_titre($langs->trans("ActionsOnMember"),$out,'');
|
||||
print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
|
||||
|
||||
// List of actions
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,'','');
|
||||
// List of all actions
|
||||
$filters=array();
|
||||
$filters['search_agenda_label']=$search_agenda_label;
|
||||
|
||||
// TODO Replace this with same code than into listactions.php
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1799,10 +1799,16 @@ else
|
|||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAX = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright.= $langs->trans("SeeAll");
|
||||
$morehtmlright.= '</a>';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', 10);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', $MAX, '', $morehtmlright);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ if ($resql)
|
|||
//$param='month='.$monthshown.'&year='.$year;
|
||||
$hourminsec='100000';
|
||||
$link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$tmpforcreatebutton['year'],$tmpforcreatebutton['mon'],$tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
|
||||
$link.= $langs->trans("NewAction");
|
||||
$link.= $langs->trans("AddAction");
|
||||
$link.= '</a>';
|
||||
}
|
||||
|
||||
|
|
@ -372,9 +372,9 @@ if ($resql)
|
|||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_title" value="'.$search_title.'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
|
|
@ -396,9 +396,9 @@ if ($resql)
|
|||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("ActionsOwnedByShort",$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateStart",$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||
|
|
@ -452,11 +452,6 @@ if ($resql)
|
|||
else print ' ';
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td class="tdoverflowmax300">';
|
||||
print $actionstatic->label;
|
||||
print '</td>';
|
||||
|
||||
// Type
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
|
|
@ -475,6 +470,11 @@ if ($resql)
|
|||
print dol_trunc($labeltype,28);
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td class="tdoverflowmax300">';
|
||||
print $actionstatic->label;
|
||||
print '</td>';
|
||||
|
||||
// Start date
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->dp),"dayhour");
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ if ($resql)
|
|||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("Actions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("EventReports"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_agenda', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
|
|
|||
|
|
@ -257,30 +257,33 @@ else
|
|||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
//print '<div class="tabsAction">';
|
||||
//print '</div>';
|
||||
|
||||
|
||||
$morehtmlcenter='';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.= '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.= '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
$param='&id='.$id;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');
|
||||
print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
$filters=array();
|
||||
|
|
|
|||
|
|
@ -157,9 +157,10 @@ class FormActions
|
|||
* @param string $morecss More css on table
|
||||
* @param int $max Max number of record
|
||||
* @param string $moreparambacktopage More param for the backtopage
|
||||
* @param string $morehtmlright More html text on right of title line
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
|
||||
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='', $morehtmlright='')
|
||||
{
|
||||
global $langs,$conf,$user;
|
||||
global $bc;
|
||||
|
|
@ -196,7 +197,7 @@ class FormActions
|
|||
$buttontoaddnewevent.= '</a>';
|
||||
|
||||
print '<!-- formactions->showactions -->'."\n";
|
||||
print load_fiche_titre($title, $buttontoaddnewevent, '');
|
||||
print load_fiche_titre($title, $morehtmlright, '', 0, 0, '', $buttontoaddnewevent);
|
||||
|
||||
$page=0; $param='';
|
||||
|
||||
|
|
@ -206,10 +207,10 @@ class FormActions
|
|||
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Action', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, 'align="center"', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Action', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, 'align="center"', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"', $sortfield, $sortorder, '', 1);
|
||||
print '</tr>';
|
||||
print "\n";
|
||||
|
|
@ -228,8 +229,14 @@ class FormActions
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$ref.'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>';
|
||||
if (! empty($action->userownerid))
|
||||
{
|
||||
$userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($action->type_picto) print img_picto('', $action->type_picto);
|
||||
|
|
@ -242,6 +249,7 @@ class FormActions
|
|||
}
|
||||
print $action->type;
|
||||
print '</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td align="center">'.dol_print_date($action->datep,'dayhour');
|
||||
if ($action->datef)
|
||||
{
|
||||
|
|
@ -254,13 +262,6 @@ class FormActions
|
|||
else print '-'.dol_print_date($action->datef,'dayhour');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (! empty($action->userownerid))
|
||||
{
|
||||
$userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if (! empty($action->author->id))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1287,11 +1287,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||
}
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre">';
|
||||
$out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1);
|
||||
$out.='</td>';
|
||||
$out.='<td class="liste_titre maxwidth100onsmartphone"><input type="text" class="maxwidth100onsmartphone" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
|
|
@ -1316,9 +1316,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||
}
|
||||
$out.=getTitleFieldOfList($langs->trans("Ref"), 0, $_SERVER["PHP_SELF"], 'a.id', '', $param, '', $sortfield, $sortorder);
|
||||
$out.=getTitleFieldOfList($langs->trans("Owner"));
|
||||
$out.=getTitleFieldOfList($langs->trans("Type"));
|
||||
$out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
$out.=getTitleFieldOfList($langs->trans("Type"));
|
||||
$out.=getTitleFieldOfList('');
|
||||
$out.=getTitleFieldOfList('');
|
||||
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||
|
|
@ -1353,6 +1353,25 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||
$out.=$userstatic->getNomUrl(-1);
|
||||
$out.='</td>';
|
||||
|
||||
// Type
|
||||
$out.='<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($histo[$key]['apicto']) $out.=img_picto('', $histo[$key]['apicto']);
|
||||
else {
|
||||
if ($histo[$key]['acode'] == 'AC_TEL') $out.=img_picto('', 'object_phoning').' ';
|
||||
if ($histo[$key]['acode'] == 'AC_FAX') $out.=img_picto('', 'object_phoning_fax').' ';
|
||||
if ($histo[$key]['acode'] == 'AC_EMAIL') $out.=img_picto('', 'object_email').' ';
|
||||
}
|
||||
$out.=$actionstatic->type;
|
||||
}
|
||||
else {
|
||||
$typelabel = $actionstatic->type;
|
||||
if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL");
|
||||
$out.=$typelabel;
|
||||
}
|
||||
$out.='</td>';
|
||||
|
||||
// Title
|
||||
$out.='<td>';
|
||||
if (isset($histo[$key]['type']) && $histo[$key]['type']=='action')
|
||||
|
|
@ -1392,25 +1411,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||
if ($late) $out.=img_warning($langs->trans("Late")).' ';
|
||||
$out.="</td>\n";
|
||||
|
||||
// Type
|
||||
$out.='<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($histo[$key]['apicto']) $out.=img_picto('', $histo[$key]['apicto']);
|
||||
else {
|
||||
if ($histo[$key]['acode'] == 'AC_TEL') $out.=img_picto('', 'object_phoning').' ';
|
||||
if ($histo[$key]['acode'] == 'AC_FAX') $out.=img_picto('', 'object_phoning_fax').' ';
|
||||
if ($histo[$key]['acode'] == 'AC_EMAIL') $out.=img_picto('', 'object_email').' ';
|
||||
}
|
||||
$out.=$actionstatic->type;
|
||||
}
|
||||
else {
|
||||
$typelabel = $actionstatic->type;
|
||||
if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL");
|
||||
$out.=$typelabel;
|
||||
}
|
||||
$out.='</td>';
|
||||
|
||||
// Title of event
|
||||
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -3540,10 +3540,11 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi
|
|||
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||
* @param int $id To force an id on html objects
|
||||
* @param string $morecssontable More css on table
|
||||
* @param string $morehtmlcenter Added message to show on center
|
||||
* @return string
|
||||
* @see print_barre_liste
|
||||
*/
|
||||
function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='')
|
||||
function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -3558,6 +3559,10 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
|
|||
$return.= '<td class="nobordernopadding" valign="middle">';
|
||||
$return.= '<div class="titre">'.$titre.'</div>';
|
||||
$return.= '</td>';
|
||||
if (dol_strlen($morehtmlcenter))
|
||||
{
|
||||
$return.= '<td class="nobordernopadding" align="center" valign="middle">'.$morehtmlcenter.'</td>';
|
||||
}
|
||||
if (dol_strlen($morehtmlright))
|
||||
{
|
||||
$return.= '<td class="nobordernopadding titre_right" align="right" valign="middle">'.$morehtmlright.'</td>';
|
||||
|
|
@ -3585,9 +3590,10 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
|
|||
* @param string $morecss More css to the table
|
||||
* @param int $limit Max number of lines (-1 = use default, 0 = no limit, > 0 = limit).
|
||||
* @param int $hideselectlimit Force to hide select limit
|
||||
* @param int $hidenavigation Force to hide all navigation tools
|
||||
* @return void
|
||||
*/
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
|
||||
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ Event=Event
|
|||
Events=Events
|
||||
EventsNb=Number of events
|
||||
ListOfActions=List of events
|
||||
EventReports=Event reports
|
||||
Location=Location
|
||||
ToUserOfGroup=To any user in group
|
||||
EventOnFullDay=Event on all day(s)
|
||||
|
|
|
|||
|
|
@ -597,6 +597,7 @@ Undo=Undo
|
|||
Redo=Redo
|
||||
ExpandAll=Expand all
|
||||
UndoExpandAll=Undo expand
|
||||
SeeAll=See all
|
||||
Reason=Reason
|
||||
FeatureNotYetSupported=Feature not yet supported
|
||||
CloseWindow=Close window
|
||||
|
|
|
|||
|
|
@ -1192,16 +1192,20 @@ elseif ($object->id > 0)
|
|||
$genallowed=($user->rights->projet->lire && $userAccess > 0);
|
||||
$delallowed=($user->rights->projet->creer && $userWrite > 0);
|
||||
|
||||
$var=true;
|
||||
|
||||
print $formfile->showdocuments('project',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAX = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/projet/info.php?id='.$object->id.'">';
|
||||
$morehtmlright.= $langs->trans("SeeAll");
|
||||
$morehtmlright.= '</a>';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', 10);
|
||||
$somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', $MAX, '', $morehtmlright);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ class Project extends CommonObject
|
|||
$sql.= ", fk_user_close=" . ($this->fk_user_close > 0 ? $this->fk_user_close : "null");
|
||||
$sql.= ", opp_amount = " . (strcmp($this->opp_amount, '') ? price2num($this->opp_amount) : "null");
|
||||
$sql.= ", budget_amount = " . (strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null");
|
||||
$sql.= ", fk_user_modif = " . $user->id;
|
||||
$sql.= " WHERE rowid = " . $this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
|
|
@ -390,7 +391,7 @@ class Project extends CommonObject
|
|||
if (empty($id) && empty($ref)) return -1;
|
||||
|
||||
$sql = "SELECT rowid, ref, title, description, public, datec, opp_amount, budget_amount,";
|
||||
$sql.= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_close, fk_statut, fk_opp_status, opp_percent, note_private, note_public, model_pdf";
|
||||
$sql.= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut, fk_opp_status, opp_percent, note_private, note_public, model_pdf";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "projet";
|
||||
if (! empty($id))
|
||||
{
|
||||
|
|
@ -428,6 +429,7 @@ class Project extends CommonObject
|
|||
$this->note_public = $obj->note_public;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->user_author_id = $obj->fk_user_creat;
|
||||
$this->user_modification_id = $obj->fk_user_modif;
|
||||
$this->user_close_id = $obj->fk_user_close;
|
||||
$this->public = $obj->public;
|
||||
$this->statut = $obj->fk_statut;
|
||||
|
|
|
|||
|
|
@ -156,42 +156,32 @@ if ($permok)
|
|||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
//print '<div class="tabsAction">';
|
||||
$morehtmlcenter='';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.='<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
//print '</div>';
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
$param='&id='.$object->id;
|
||||
print '<br>';
|
||||
|
||||
$param='&id='.$object->id;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
print load_fiche_titre($langs->trans("ActionsOnProject"),'','');
|
||||
|
||||
// List of actions on element
|
||||
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object,'project',0);*/
|
||||
|
||||
// List of todo actions
|
||||
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
|
||||
// List of done actions
|
||||
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
|
||||
print_barre_liste($langs->trans("ActionsOnProject"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
$filters=array();
|
||||
$filters['search_agenda_label']=$search_agenda_label;
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" name="label" class="flat minwidth300" value="'.$label.'">';
|
||||
print '<input type="text" name="label" autofocus class="flat minwidth300" value="'.$label.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// List of projects
|
||||
|
|
|
|||
|
|
@ -155,30 +155,32 @@ if ($socid > 0)
|
|||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
//print '<div class="tabsAction">';
|
||||
//print '</div>';
|
||||
|
||||
|
||||
$morehtmlcenter='';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
$morehtmlcenter.='<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
|
||||
print_barre_liste($langs->trans("ActionsOnCompany"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
|
||||
|
||||
// List of all actions
|
||||
$filters=array();
|
||||
|
|
|
|||
|
|
@ -2532,12 +2532,16 @@ else
|
|||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAX = 5;
|
||||
$MAX = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id.'">';
|
||||
$morehtmlright.= $langs->trans("SeeAll");
|
||||
$morehtmlright.= '</a>';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, '', $socid, 1, '', $MAX); // Show all action for thirdparty
|
||||
$somethingshown = $formactions->showactions($object, '', $socid, 1, '', $MAX, '', $morehtmlright); // Show all action for thirdparty
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user