Uniformize code and look and feel
This commit is contained in:
parent
d1f9f3fd42
commit
434b3ef643
@ -852,12 +852,13 @@ if ($id > 0)
|
||||
{
|
||||
$result1=$object->fetch($id);
|
||||
$result2=$object->fetch_thirdparty();
|
||||
$result2=$object->fetch_projet();
|
||||
$result3=$object->fetch_contact();
|
||||
$result4=$object->fetch_userassigned();
|
||||
$result5=$object->fetch_optionals($id,$extralabels);
|
||||
|
||||
if ($listUserAssignedUpdated || $donotclearsession) {
|
||||
|
||||
if($listUserAssignedUpdated || $donotclearsession) {
|
||||
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
@ -1100,8 +1101,10 @@ if ($id > 0)
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ActionOnCompany").'</td>';
|
||||
print '<td>';
|
||||
print '<div class="maxwidth200onsmartphone">';
|
||||
$events=array();
|
||||
$events=array(); // 'method'=parameter action of url, 'url'=url to call that return new list of contacts
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
// TODO Refresh also list of project if $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY not defined with list linked to socid ?
|
||||
// FIXME If we change company, we may get a project that does not match
|
||||
print $form->select_company($object->socid, 'socid', '', 'SelectThirdParty', 1, 0, $events, 0);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
@ -1122,8 +1125,8 @@ if ($id > 0)
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
$numprojet=$formproject->select_projects($object->socid, $object->fk_project, 'projectid');
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>';
|
||||
$numprojet=$formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0);
|
||||
if ($numprojet==0)
|
||||
{
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->socid.'&action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit').'">'.$langs->trans("AddProject").'</a>';
|
||||
@ -1132,7 +1135,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// Priority
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
|
||||
print '<input type="text" name="priority" value="'.($object->priority?$object->priority:'').'" size="5">';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1141,11 +1144,11 @@ if ($id > 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
|
||||
print '<td colspan="3">'.dolGetElementUrl($object->fk_element,$object->elementtype,1).'</td></tr>';
|
||||
print '<td>'.dolGetElementUrl($object->fk_element,$object->elementtype,1).'</td></tr>';
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('note',$object->note,'',200,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,90);
|
||||
@ -1153,7 +1156,7 @@ if ($id > 0)
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan'=>' colspan="3"', 'colspanvalue'=>'3', 'id'=>$object->id);
|
||||
$parameters=array('id'=>$object->id);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
|
||||
@ -1078,7 +1078,7 @@ class ActionComm extends CommonObject
|
||||
else if ($mode == 6)
|
||||
{
|
||||
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable').' '.img_picto($langs->trans('StatusNotApplicable'),'statut9');
|
||||
else if ($percent==0) return $langs->trans('StatusActionToDo').'0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
||||
else if ($percent==0) return $langs->trans('StatusActionToDo').' (0%) '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
||||
else if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%) '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
|
||||
else if ($percent >= 100) return $langs->trans('StatusActionDone').' (100%) '.img_picto($langs->trans('StatusActionDone'),'statut6');
|
||||
}
|
||||
|
||||
@ -309,7 +309,8 @@ if ($resql)
|
||||
$i = 0;
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
@ -322,6 +323,7 @@ if ($resql)
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -367,15 +369,22 @@ if ($resql)
|
||||
|
||||
$var=!$var;
|
||||
|
||||
$actionstatic->id=$obj->id;
|
||||
$actionstatic->ref=$obj->id;
|
||||
$actionstatic->type_code=$obj->type_code;
|
||||
$actionstatic->type_label=$obj->type_label;
|
||||
$actionstatic->label=$obj->label;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
// Action (type)
|
||||
print '<td>';
|
||||
$actionstatic->id=$obj->id;
|
||||
$actionstatic->type_code=$obj->type_code;
|
||||
$actionstatic->type_label=$obj->type_label;
|
||||
$actionstatic->label=$obj->label;
|
||||
print $actionstatic->getNomUrl(1,36);
|
||||
print $actionstatic->getNomUrl(1,-1);
|
||||
print '</td>';
|
||||
|
||||
// Action (type)
|
||||
print '<td>';
|
||||
print $actionstatic->label;
|
||||
print '</td>';
|
||||
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
|
||||
@ -182,14 +182,17 @@ class FormActions
|
||||
|
||||
print load_fiche_titre($title,'','');
|
||||
|
||||
$total = 0; $var=true;
|
||||
$page=0; $param=''; $sortfield='a.datep';
|
||||
|
||||
$total = 0; $var=true;
|
||||
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th class="liste_titre">'.$langs->trans('Ref').'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans('Action').'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans('Date').'</th>';
|
||||
print '<th class="liste_titre">'.$langs->trans('By').'</th>';
|
||||
print '<th class="liste_titre" align="right">'.$langs->trans('Status').'</th>';
|
||||
print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], '', $page, $param, '');
|
||||
print_liste_field_titre($langs->trans('Action'), $_SERVER["PHP_SELF"], '', $page, $param, '');
|
||||
print_liste_field_titre($langs->trans('Type'), $_SERVER["PHP_SELF"], '', $page, $param, '');
|
||||
print_liste_field_titre($langs->trans('Date'), $_SERVER["PHP_SELF"], '', $page, $param, '');
|
||||
print_liste_field_titre($langs->trans('By'), $_SERVER["PHP_SELF"], '', $page, $param, '');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"');
|
||||
print '</tr>';
|
||||
print "\n";
|
||||
|
||||
@ -199,11 +202,12 @@ class FormActions
|
||||
{
|
||||
$ref=$action->getNomUrl(1,-1);
|
||||
$label=$action->getNomUrl(0,38);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$ref.'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>'.$action->type.'</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'dayhour');
|
||||
if ($action->datef)
|
||||
{
|
||||
@ -243,15 +247,16 @@ class FormActions
|
||||
/**
|
||||
* Output html select list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
|
||||
* @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
|
||||
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
|
||||
* @param int $multiselect 1=Allow multiselect of action type
|
||||
* @return void
|
||||
* @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
|
||||
* @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
|
||||
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
|
||||
* @param int $multiselect 1=Allow multiselect of action type
|
||||
* @param int $nooutput 1=No output
|
||||
* @return string
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0)
|
||||
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
|
||||
{
|
||||
global $langs,$user,$form,$conf;
|
||||
|
||||
@ -271,20 +276,26 @@ class FormActions
|
||||
|
||||
if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']);
|
||||
|
||||
$out='';
|
||||
|
||||
if (! empty($multiselect))
|
||||
{
|
||||
if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
|
||||
print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
|
||||
if (!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
|
||||
$out.=$form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
$out.=$form->selectarray($htmlname, $arraylist, $selected);
|
||||
}
|
||||
|
||||
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)
|
||||
{
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup").($hideinfohelp == -1 ? ". ".$langs->trans("YouCanSetDefaultValueInModuleSetup") : ''),1);
|
||||
$out.=info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup").($hideinfohelp == -1 ? ". ".$langs->trans("YouCanSetDefaultValueInModuleSetup") : ''),1);
|
||||
}
|
||||
|
||||
if ($nooutput) return $out;
|
||||
else print $out;
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class FormProjets
|
||||
}
|
||||
|
||||
/**
|
||||
* Output a combo list with projects qualified for a third party
|
||||
* Output a combo list with projects qualified for a third party / user
|
||||
*
|
||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||
* @param int $selected Id project preselected
|
||||
@ -58,9 +58,10 @@ class FormProjets
|
||||
* @param int $mode 0 for HTML mode and 1 for JSON mode
|
||||
* @param string $filterkey Key to filter
|
||||
* @param int $nooutput No print output. Return it only.
|
||||
* @param int $forceaddid Force to add project id in list, event if not qualified
|
||||
* @return string Return html content
|
||||
*/
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0)
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0)
|
||||
{
|
||||
global $langs,$conf,$form;
|
||||
|
||||
@ -122,9 +123,10 @@ class FormProjets
|
||||
* @param int $mode 0 for HTML mode and 1 for array return (to be used by json_encode for example)
|
||||
* @param string $filterkey Key to filter
|
||||
* @param int $nooutput No print output. Return it only.
|
||||
* @param int $forceaddid Force to add project id in list, event if not qualified
|
||||
* @return int Nb of project if OK, <0 if KO
|
||||
*/
|
||||
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0)
|
||||
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
@ -143,6 +145,7 @@ class FormProjets
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
|
||||
}
|
||||
|
||||
|
||||
// Search all projects
|
||||
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
|
||||
|
||||
@ -930,177 +930,17 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
||||
* @param Conf $conf Object conf
|
||||
* @param Translate $langs Object langs
|
||||
* @param DoliDB $db Object db
|
||||
* @param Adherent|Societe $object Object third party or member
|
||||
* @param Adherent|Societe $filterobj Object third party or member
|
||||
* @param Contact $objcon Object contact
|
||||
* @param int $noprint Return string but does not output it
|
||||
* @param int $actioncode Filter on actioncode
|
||||
* @return mixed Return html part or void if noprint is 1
|
||||
*/
|
||||
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0,$actioncode='')
|
||||
function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$actioncode='')
|
||||
{
|
||||
global $bc,$user,$conf;
|
||||
|
||||
// Check parameters
|
||||
if (! is_object($object)) dol_print_error('','BadParameter');
|
||||
|
||||
$now=dol_now('tzuser');
|
||||
$out='';
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
$actionstatic=new ActionComm($db);
|
||||
$userstatic=new User($db);
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
$out.="\n";
|
||||
$out.='<table width="100%" class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
|
||||
else $out.='<td colspan="2">';
|
||||
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&status=todo">';
|
||||
$out.=$langs->trans("ActionsToDoShort");
|
||||
if (get_class($object) == 'Societe') $out.='</a>';
|
||||
$out.='</td>';
|
||||
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) {
|
||||
$out.='<td>';
|
||||
$out.=$langs->trans("Type");
|
||||
$out.='</td>';
|
||||
$out.='<td colspan="4" align="right">';
|
||||
} else {
|
||||
$out.='<td colspan="5" align="right">';
|
||||
}
|
||||
|
||||
$out.='</td>';
|
||||
$out.='</tr>';
|
||||
|
||||
$sql = "SELECT a.id, a.label,";
|
||||
$sql.= " a.datep as dp,";
|
||||
$sql.= " a.datep2 as dp2,";
|
||||
$sql.= " a.percent,";
|
||||
$sql.= " a.fk_user_author, a.fk_contact,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " c.code as acode, c.libelle,";
|
||||
$sql.= " u.login, u.rowid";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
|
||||
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
$sql.= " WHERE u.rowid = a.fk_user_author";
|
||||
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
|
||||
if (get_class($object) == 'Adherent')
|
||||
{
|
||||
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
|
||||
if (! empty($object->id)) $sql.= " AND a.fk_element = ".$object->id;
|
||||
}
|
||||
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;
|
||||
if (! empty($objcon->id)) $sql.= " AND a.fk_contact = ".$objcon->id;
|
||||
if (! empty($actioncode)) $sql.= " AND c.code='".$actioncode."' ";
|
||||
$sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||
$sql.= " ORDER BY a.datep DESC, a.id DESC";
|
||||
|
||||
dol_syslog("company.lib::show_actions_todo", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($result);
|
||||
$var=true;
|
||||
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object($result);
|
||||
$actionstatic->fetch($obj->id);
|
||||
$datep=$db->jdate($obj->dp);
|
||||
$datep2=$db->jdate($obj->dp2);
|
||||
|
||||
$out.="<tr ".$bc[$var].">";
|
||||
|
||||
// Date
|
||||
$out.='<td width="120" align="left" class="nowrap">';
|
||||
$out.=dol_print_date($datep,'dayhour');
|
||||
if ($datep2 && $datep2 != $datep)
|
||||
{
|
||||
$tmpa=dol_getdate($datep,true);
|
||||
$tmpb=dol_getdate($datep2,true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($datep2,'hour');
|
||||
else $out.='-'.dol_print_date($datep2,'dayhour');
|
||||
}
|
||||
$out.="</td>\n";
|
||||
|
||||
// Picto warning
|
||||
$out.='<td width="16">';
|
||||
if ($obj->percent >= 0 && $datep && $datep < ($now - ($conf->global->MAIN_DELAY_ACTIONS_TODO *60*60*24)) ) $out.=' '.img_warning($langs->trans("Late"));
|
||||
else $out.=' ';
|
||||
$out.='</td>';
|
||||
|
||||
$actionstatic->type_code=$obj->acode;
|
||||
$transcode=$langs->trans("Action".$obj->acode);
|
||||
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
|
||||
//$actionstatic->libelle=$libelle;
|
||||
$actionstatic->libelle=$obj->label;
|
||||
$actionstatic->id=$obj->id;
|
||||
//$out.='<td width="140">'.$actionstatic->getNomUrl(1,16).'</td>';
|
||||
|
||||
// Title of event
|
||||
//$out.='<td colspan="2">'.dol_trunc($obj->label,40).'</td>';
|
||||
$out.='<td>'.$actionstatic->getNomUrl(1,120).'</td>';
|
||||
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) {
|
||||
$out.= '<td>';
|
||||
$out.=$actionstatic->type;
|
||||
$out.='</td>';
|
||||
}
|
||||
// Contact pour cette action
|
||||
if (empty($objcon->id) && $obj->fk_contact > 0)
|
||||
{
|
||||
$contactstatic->lastname=$obj->lastname;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
$contactstatic->id=$obj->fk_contact;
|
||||
$out.='<td width="120">'.$contactstatic->getNomUrl(1,'',10).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$out.='<td> </td>';
|
||||
}
|
||||
|
||||
$out.='<td width="80" class="nowrap">';
|
||||
//$userstatic->id=$obj->fk_user_author;
|
||||
//$userstatic->login=$obj->login;
|
||||
//$out.=$userstatic->getLoginUrl(1);
|
||||
$userstatic->fetch($obj->fk_user_author);
|
||||
$out.=$userstatic->getNomUrl(1);
|
||||
$out.='</td>';
|
||||
|
||||
// Statut
|
||||
$out.='<td class="nowrap" width="20">'.$actionstatic->LibStatut($obj->percent,3).'</td>';
|
||||
|
||||
$out.="</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Aucun action a faire
|
||||
|
||||
}
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$out.="</table>\n";
|
||||
|
||||
$out.="<br>\n";
|
||||
}
|
||||
$out = show_actions_done($conf,$langs,$db,$filterobj,$objcon,1,$actioncode, 'todo');
|
||||
|
||||
if ($noprint) return $out;
|
||||
else print $out;
|
||||
@ -1112,19 +952,21 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0,$actio
|
||||
* @param Conf $conf Object conf
|
||||
* @param Translate $langs Object langs
|
||||
* @param DoliDB $db Object db
|
||||
* @param Adherent|Societe $object Object third party or member
|
||||
* @param Adherent|Societe $filterobj Object third party or member
|
||||
* @param Contact $objcon Object contact
|
||||
* @param int $noprint Return string but does not output it
|
||||
* @param string $actioncode Filter on actioncode
|
||||
* @param string $donetodo Filter on avent 'done' or 'todo' or ''=nofilter.
|
||||
* @return mixed Return html part or void if noprint is 1
|
||||
* TODO change function to be able to list event linked to an object.
|
||||
*/
|
||||
function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0, $actioncode='')
|
||||
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done')
|
||||
{
|
||||
global $bc,$user,$conf;
|
||||
global $form;
|
||||
|
||||
// Check parameters
|
||||
if (! is_object($object)) dol_print_error('','BadParameter');
|
||||
if (! is_object($filterobj)) dol_print_error('','BadParameter');
|
||||
|
||||
$out='';
|
||||
$histo=array();
|
||||
@ -1142,20 +984,22 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
$sql.= " a.fk_user_author, a.fk_contact,";
|
||||
$sql.= " c.code as acode, c.libelle,";
|
||||
$sql.= " u.login, u.rowid as user_id";
|
||||
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||
if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
|
||||
if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
|
||||
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||
$sql.= " WHERE u.rowid = a.fk_user_author";
|
||||
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
|
||||
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;
|
||||
if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
|
||||
if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id;
|
||||
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
|
||||
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
|
||||
if (get_class($filterobj) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
|
||||
if (get_class($filterobj) == 'Adherent' && $filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
|
||||
if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id;
|
||||
if (!empty($actioncode)) $sql.= " AND c.code='".$actioncode."' ";
|
||||
$sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||
if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||
$sql.= " ORDER BY a.datep DESC, a.id DESC";
|
||||
|
||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||
@ -1168,23 +1012,31 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||
//if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||
$tododone='';
|
||||
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone='todo';
|
||||
|
||||
$histo[$numaction]=array(
|
||||
'type'=>'action',
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->dp),
|
||||
'dateend'=>$db->jdate($obj->dp2),
|
||||
'note'=>$obj->label,
|
||||
'percent'=>$obj->percent,
|
||||
'acode'=>$obj->acode,
|
||||
'libelle'=>$obj->libelle,
|
||||
'userid'=>$obj->user_id,
|
||||
'login'=>$obj->login,
|
||||
'contact_id'=>$obj->fk_contact,
|
||||
'lastname'=>$obj->lastname,
|
||||
'firstname'=>$obj->firstname,
|
||||
'fk_element'=>$obj->fk_element,
|
||||
'elementtype'=>$obj->elementtype
|
||||
'type'=>'action',
|
||||
'tododone'=>$tododone,
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->dp),
|
||||
'dateend'=>$db->jdate($obj->dp2),
|
||||
'note'=>$obj->label,
|
||||
'percent'=>$obj->percent,
|
||||
'acode'=>$obj->acode,
|
||||
'libelle'=>$obj->libelle,
|
||||
'userid'=>$obj->user_id,
|
||||
'login'=>$obj->login,
|
||||
'contact_id'=>$obj->fk_contact,
|
||||
'lastname'=>$obj->lastname,
|
||||
'firstname'=>$obj->firstname,
|
||||
'fk_element'=>$obj->fk_element,
|
||||
'elementtype'=>$obj->elementtype
|
||||
);
|
||||
|
||||
$numaction++;
|
||||
$i++;
|
||||
}
|
||||
@ -1199,7 +1051,7 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
{
|
||||
$langs->load("mails");
|
||||
|
||||
// Recherche histo sur mailing
|
||||
// Add also event from emailings. TODO This should be replaced by an automatic event
|
||||
$sql = "SELECT m.rowid as id, mc.date_envoi as da, m.titre as note, '100' as percentage,";
|
||||
$sql.= " 'AC_EMAILING' as acode,";
|
||||
$sql.= " u.rowid as user_id, u.login"; // User that valid action
|
||||
@ -1222,6 +1074,7 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
$obj = $db->fetch_object($resql);
|
||||
$histo[$numaction]=array(
|
||||
'type'=>'mailing',
|
||||
'tododone'=>'done',
|
||||
'id'=>$obj->id,
|
||||
'datestart'=>$db->jdate($obj->da),
|
||||
'dateend'=>$db->jdate($obj->da),
|
||||
@ -1258,49 +1111,79 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
$orderstatic=new Commande($db);
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
$out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />';
|
||||
if (get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
|
||||
|
||||
$out.="\n";
|
||||
$out.='<table class="noborder" width="100%">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) $out.='<td colspan="3">';
|
||||
else $out.='<td colspan="2">';
|
||||
if (get_class($object) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$object->id.'&status=done">';
|
||||
$out.=$langs->trans("ActionsDoneShort");
|
||||
if (get_class($object) == 'Societe') $out.='</a>';
|
||||
$out.='</td>';
|
||||
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) {
|
||||
$out.='<td>';
|
||||
$out.=$langs->trans("Type");
|
||||
$out.='</td>';
|
||||
$out.='<td colspan="4" align="right">';
|
||||
} else {
|
||||
$out.='<td colspan="5" align="right">';
|
||||
if ($donetodo)
|
||||
{
|
||||
$out.='<td>';
|
||||
if (get_class($filterobj) == 'Societe') $out.='<a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?socid='.$filterobj->id.'&status=done">';
|
||||
$out.=$langs->trans("ActionsToDoShort").' / '.$langs->trans("ActionsDoneShort");
|
||||
if (get_class($filterobj) == 'Societe') $out.='</a>';
|
||||
$out.='</td>';
|
||||
}
|
||||
|
||||
$out.='</td>';
|
||||
$out.='</tr>';
|
||||
$out.='<td>'.$langs->trans("Ref").'</td>';
|
||||
$out.='<td>'.$langs->trans("Label").'</td>';
|
||||
$out.='<td>'.$langs->trans("Date").'</td>';
|
||||
$out.='<td>'.$langs->trans("Type").'</td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td>'.$langs->trans("By").'</td>';
|
||||
$out.='<td align="center">'.$langs->trans("Status").'</td>';
|
||||
$out.='<td align="center"></td>';
|
||||
$out.='</tr>';
|
||||
|
||||
|
||||
$out.='<tr class="liste_titre">';
|
||||
if ($donetodo)
|
||||
{
|
||||
$out.='<td></td>';
|
||||
}
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td>';
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
$out.=$formactions->select_type_actions($actioncode, "actioncode", '', 0, 0, 0, 1);
|
||||
}
|
||||
$out.='</td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
// Action column
|
||||
$out.='<td class="liste_titre" align="middle">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
$out.=$searchpitco;
|
||||
$out.='</td>';
|
||||
$out.='</tr>';
|
||||
|
||||
foreach ($histo as $key=>$value)
|
||||
{
|
||||
$var=!$var;
|
||||
$out.="<tr ".$bc[$var].">";
|
||||
$actionstatic->fetch($histo[$key]['id']);
|
||||
// Champ date
|
||||
$out.='<td width="120" class="nowrap">';
|
||||
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
|
||||
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
|
||||
|
||||
$out.="<tr ".$bc[$var].">";
|
||||
|
||||
// done or todo
|
||||
if ($donetodo)
|
||||
{
|
||||
$tmpa=dol_getdate($histo[$key]['datestart'],true);
|
||||
$tmpb=dol_getdate($histo[$key]['dateend'],true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
|
||||
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
|
||||
$out.='<td class="nowrap">';
|
||||
$out.='</td>';
|
||||
}
|
||||
$out.="</td>\n";
|
||||
|
||||
// Picto
|
||||
$out.='<td width="16"> </td>';
|
||||
|
||||
// Action
|
||||
|
||||
// Ref
|
||||
$out.='<td class="nowrap">';
|
||||
$out.=$actionstatic->getNomUrl(1, -1);
|
||||
$out.='</td>';
|
||||
|
||||
// Title
|
||||
$out.='<td>';
|
||||
if (isset($histo[$key]['type']) && $histo[$key]['type']=='action')
|
||||
{
|
||||
@ -1308,9 +1191,9 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
$transcode=$langs->trans("Action".$histo[$key]['acode']);
|
||||
$libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:$histo[$key]['libelle']);
|
||||
//$actionstatic->libelle=$libelle;
|
||||
$actionstatic->libelle=$histo[$key]['note'];
|
||||
$libelle=$histo[$key]['note'];
|
||||
$actionstatic->id=$histo[$key]['id'];
|
||||
$out.=$actionstatic->getNomUrl(1,120);
|
||||
$out.=dol_trunc($libelle,120);
|
||||
}
|
||||
if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing')
|
||||
{
|
||||
@ -1321,6 +1204,18 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
}
|
||||
$out.='</td>';
|
||||
|
||||
// Date
|
||||
$out.='<td class="nowrap">';
|
||||
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
|
||||
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
|
||||
{
|
||||
$tmpa=dol_getdate($histo[$key]['datestart'],true);
|
||||
$tmpb=dol_getdate($histo[$key]['dateend'],true);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
|
||||
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
|
||||
}
|
||||
$out.="</td>\n";
|
||||
|
||||
if($conf->global->AGENDA_USE_EVENT_TYPE) {
|
||||
$out.='<td>';
|
||||
$out.=$actionstatic->type;
|
||||
@ -1396,8 +1291,11 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
$out.='</td>';
|
||||
|
||||
// Statut
|
||||
$out.='<td class="nowrap" width="20">'.$actionstatic->LibStatut($histo[$key]['percent'],3).'</td>';
|
||||
$out.='<td class="nowrap" align="center">'.$actionstatic->LibStatut($histo[$key]['percent'],3).'</td>';
|
||||
|
||||
// Actions
|
||||
$out.='<td></td>';
|
||||
|
||||
$out.="</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
@ -1405,6 +1303,8 @@ function show_actions_done($conf, $langs, $db, $object, $objcon='', $noprint=0,
|
||||
//$out.="<br>\n";
|
||||
}
|
||||
|
||||
$out.='</form>';
|
||||
|
||||
if ($noprint) return $out;
|
||||
else print $out;
|
||||
}
|
||||
|
||||
@ -111,8 +111,13 @@ function project_prepare_head($object)
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$head[$h][2] = 'info';
|
||||
$head[$h][1].= $langs->trans("Events");
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
$head[$h][1].= '/';
|
||||
$head[$h][1].= $langs->trans("Agenda");
|
||||
}
|
||||
$head[$h][2] = 'agenda';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'project','remove');
|
||||
|
||||
@ -1094,13 +1094,6 @@ else
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
@ -27,16 +27,42 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
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)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
$id = GETPOST("id",'int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'projet',$id,'');
|
||||
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters=array('id'=>$socid);
|
||||
$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');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -48,22 +74,70 @@ if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$c
|
||||
$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
llxHeader("",$title,$help_url);
|
||||
|
||||
$projet = new Project($db);
|
||||
$projet->fetch($id);
|
||||
$projet->info($id);
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($projet->socid);
|
||||
$object = new Project($db);
|
||||
$object->fetch($id);
|
||||
$object->info($id);
|
||||
|
||||
$head = project_prepare_head($projet);
|
||||
$head = project_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
|
||||
dol_fiche_head($head, 'agenda', $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
dol_print_object_info($projet);
|
||||
|
||||
dol_print_object_info($object, 1);
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Actions buttons
|
||||
|
||||
$out='';
|
||||
$permok=$user->rights->agenda->myactions->create;
|
||||
if ($permok)
|
||||
{
|
||||
$out.='&projectid='.$object->id;
|
||||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
if (!empty($object->id))
|
||||
{
|
||||
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);
|
||||
|
||||
// List of all actions
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '');
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -34,6 +34,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
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)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -51,6 +61,12 @@ $parameters=array('id'=>$socid);
|
||||
$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');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -128,10 +144,8 @@ if ($socid)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
*/
|
||||
|
||||
// Actions buttons
|
||||
|
||||
$objthirdparty=$object;
|
||||
$objcon=new stdClass();
|
||||
|
||||
@ -147,6 +161,7 @@ if ($socid)
|
||||
//$out.="</a>";
|
||||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
@ -165,39 +180,16 @@ if ($socid)
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
|
||||
$actioncode = '';
|
||||
if(!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
|
||||
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)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
|
||||
print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
|
||||
print '<input type="hidden" name="socid" value="'.$objthirdparty->id.'" />';
|
||||
$formactions->select_type_actions($actioncode, "actioncode", '', 0, 0, 0);
|
||||
print '<input type="submit" class="button" name="refresh" value="' . $langs->trans("Refresh") . '">';
|
||||
print '</form><br />' ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
|
||||
|
||||
// List of todo actions
|
||||
show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
|
||||
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
|
||||
// List of done actions
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode);
|
||||
|
||||
// List of all actions
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user