Skip to content

Commit

Permalink
Dolibarrize module ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 22, 2018
1 parent 3b55049 commit 6e52c89
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 37 deletions.
42 changes: 21 additions & 21 deletions htdocs/comm/action/list.php
Expand Up @@ -32,10 +32,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

$langs->load("users");
$langs->load("companies");
$langs->load("agenda");
$langs->load("commercial");
$langs->loadLangs(array("users","companies","agenda","commercial"));

$action=GETPOST('action','alpha');
$resourceid=GETPOST("resourceid","int");
Expand All @@ -57,6 +54,7 @@
$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));
}
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
$search_id=GETPOST('search_id','alpha');
$search_title=GETPOST('search_title','alpha');

$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
Expand Down Expand Up @@ -170,7 +168,8 @@
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
//$actioncode='';
$search_title='';
$search_id='';
$search_title='';
$datestart='';
$dateend='';
$status='';
Expand Down Expand Up @@ -199,24 +198,25 @@
$listofextcals=array();

$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($actioncode != '') {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
foreach($actioncode as $str_action) $param.="&actioncode[]=".urlencode($str_action);
} else $param.="&actioncode=".urlencode($actioncode);
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($filtert) $param.="&filtert=".$filtert;
if ($socid) $param.="&socid=".$socid;
if ($resourceid > 0) $param.="&resourceid=".urlencode($resourceid);
if ($status != '' && $status > -1) $param.="&status=".urlencode($status);
if ($filter) $param.="&filter=".urlencode($filter);
if ($filtert) $param.="&filtert=".urlencode($filtert);
if ($socid) $param.="&socid=".urlencode($socid);
if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_title != '') $param.='&search_title='.$search_title;
if ($pid) $param.="&projectid=".urlencode($pid);
if ($type) $param.="&type=".urlencode($type);
if ($usergroup) $param.="&usergroup=".urlencode($usergroup);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_id != '') $param.='&search_title='.urlencode($search_id);
if ($search_title != '') $param.='&search_title='.urlencode($search_title);
if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int');
if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int');
if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int');
Expand Down Expand Up @@ -293,6 +293,7 @@
if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($search_id) $sql.=natural_search("a.id", $search_id, 1);
if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
Expand Down Expand Up @@ -421,7 +422,7 @@
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";

print '<tr class="liste_titre_filter">';
if (! empty($arrayfields['a.id']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.id']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
if (! empty($arrayfields['owner']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['c.libelle']['checked'])) print '<td class="liste_titre"></td>';
if (! empty($arrayfields['a.label']['checked'])) print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.'"></td>';
Expand Down Expand Up @@ -492,7 +493,6 @@
$caction=new CActionComm($db);
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);

$var=true;
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($resql);
Expand Down
35 changes: 21 additions & 14 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -1530,10 +1530,17 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
$out.='</tr>';

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), '', 1);

foreach ($histo as $key=>$value)
{
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo

$actionstatic->type_picto=$histo[$key]['apicto'];
$actionstatic->type_code=$histo[$key]['acode'];

$out.='<tr class="oddeven">';

// Done or todo
Expand Down Expand Up @@ -1564,26 +1571,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.='<td>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($histo[$key]['apicto']) $out.=img_picto('', $histo[$key]['apicto']);
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
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').' ';
if ($actionstatic->type_code == 'AC_RDV') $out.= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_TEL') $out.= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_FAX') $out.= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL') $out.= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actionstatic->type_code == 'AC_INT') $out.= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif (! preg_match('/_AUTO/', $actionstatic->type_code)) $out.= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
}
$out.=$actionstatic->type;
}
else {
$typelabel = $actionstatic->type;
if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL");
$out.=$typelabel;
}
$labeltype=$actionstatic->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype='AC_OTH';
if (! empty($arraylist[$labeltype])) $labeltype=$arraylist[$labeltype];
$out.= dol_trunc($labeltype,28);
$out.='</td>';

// Title
$out.='<td>';
if (isset($histo[$key]['type']) && $histo[$key]['type']=='action')
{
$actionstatic->type_code=$histo[$key]['acode'];
$transcode=$langs->trans("Action".$histo[$key]['acode']);
$libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:$histo[$key]['alabel']);
//$actionstatic->libelle=$libelle;
Expand Down Expand Up @@ -1635,7 +1642,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$propalstatic->type=$histo[$key]['ftype'];
$out.=$propalstatic->getNomUrl(1);
} else {
$out.= $langs->trans("ProposalDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("ProposalDeleted").'</span>';
}
}
elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
Expand All @@ -1646,7 +1653,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$orderstatic->type=$histo[$key]['ftype'];
$out.=$orderstatic->getNomUrl(1);
} else {
$out.= $langs->trans("OrderDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("OrderDeleted").'<span>';
}
}
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
Expand All @@ -1657,7 +1664,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
} else {
$out.= $langs->trans("InvoiceDeleted");
//$out.= '<span class="opacitymedium">'.$langs->trans("InvoiceDeleted").'</span>';
}
}
else $out.='&nbsp;';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/ticketsup.lib.php
Expand Up @@ -104,7 +104,7 @@ function ticketsup_prepare_head($object)

// History
$head[$h][0] = DOL_URL_ROOT.'/ticketsup/history.php?track_id=' . $object->track_id;
$head[$h][1] = $langs->trans('TicketHistory');
$head[$h][1] = $langs->trans('Events');
$head[$h][2] = 'tabTicketLogs';
$h++;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticketsup/card.php
Expand Up @@ -545,7 +545,7 @@
}


if (! empty($conf->global->TICKETSUP_SHOW_CONTACT_ON_MAIN_TAB))
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png');

Expand Down

0 comments on commit 6e52c89

Please sign in to comment.