diff --git a/htdocs/telephonie/ligne/conso.php b/htdocs/telephonie/ligne/conso.php index b2f56b55133..eddc550ead9 100644 --- a/htdocs/telephonie/ligne/conso.php +++ b/htdocs/telephonie/ligne/conso.php @@ -49,8 +49,7 @@ if ($_GET["id"] or $_GET["numero"]) { print "Lecture non authorisée"; } - - + if ($result == 1 && $client_comm->perm_read) { if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') @@ -76,6 +75,15 @@ if ($_GET["id"] or $_GET["numero"]) $head[$h][1] = $langs->trans('Historique'); $h++; + $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/commentaires.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Commentaires'); + $numc = $ligne->num_comments(); + if ($numc > 0) + { + $head[$h][1] = $langs->trans("Commentaires ($numc)"); + } + $h++; + $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/conso.php?id=".$ligne->id; $head[$h][1] = $langs->trans('Conso'); $hselected = $h; @@ -109,7 +117,7 @@ if ($_GET["id"] or $_GET["numero"]) print 'Statut'; - print ' '; + print 'statut '; print $ligne->statuts[$ligne->statut]; print ''; @@ -163,10 +171,93 @@ if ($_GET["id"] or $_GET["numero"]) print $mesg_no_graph; } + /* + * Mode Liste + * + */ + + $sql = "SELECT date,numero, cout_vente, duree,fichier_cdr"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details"; + $sql .= " WHERE fk_ligne=".$ligne->id; + + if (isset($_GET["search_num"])) + $selnum = urldecode($_GET["search_num"]); + + if (isset($_POST["search_num"])) + $selnum = urldecode($_POST["search_num"]); + + + if ($selnum) + { + $selnum = ereg_replace("\.","",$selnum); + $selnum = ereg_replace(" ","",$selnum); + $sql .= " AND numero LIKE '%".$selnum."%'"; + } + + $page = $_GET["page"]; + if ($page == -1) { $page = 0 ; } + + $sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:'DESC'; + $sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:'date'; + + $offset = $conf->liste_limit * $page ; + $pageprev = $page - 1; + $pagenext = $page + 1; + + + $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); + $resql = $db->query($sql); + + if ($resql) + { + $num = $db->num_rows($resql); + + $urladd= "&id=".$ligne->id."&search_ligne=".$sel."&search_num=".$selnum; + + print_barre_liste("CDR", $page, "conso.php", $urladd, $sortfield, $sortorder, '', $num); + + print '
'."\n"; + print ''."\n"; + print ''; + print ''; + print ''; + print "\n"; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + $var=True; + + while ($obj = $db->fetch_object($resql)) + { + $var=!$var; + + print ""; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + + } + print "
NumeroDateDureeMontantFichier
   
'.$obj->numero."'.$obj->date." ".$obj->heure."'.$obj->duree."'.$obj->cout_vente."'.$obj->fichier_cdr."
"; + } + else + { + print $db->error(); + } } } + + print ''; + } else {