Modif des permissions
This commit is contained in:
parent
0bb5b5243b
commit
d390de882a
@ -24,7 +24,7 @@ require "./pre.inc.php";
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
if ($_POST["action"] == 'addservice' && $user->rights->telephonie->ligne->creer)
|
if ($_POST["action"] == 'addservice' && $user->rights->telephonie->service->affecter)
|
||||||
{
|
{
|
||||||
$contrat = new TelephonieContrat($db);
|
$contrat = new TelephonieContrat($db);
|
||||||
$contrat->id= $_GET["id"];
|
$contrat->id= $_GET["id"];
|
||||||
@ -35,7 +35,7 @@ if ($_POST["action"] == 'addservice' && $user->rights->telephonie->ligne->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'rmservice' && $user->rights->telephonie->ligne->creer)
|
if ($_GET["action"] == 'rmservice' && $user->rights->telephonie->service->affecter)
|
||||||
{
|
{
|
||||||
$contrat = new TelephonieContrat($db);
|
$contrat = new TelephonieContrat($db);
|
||||||
$contrat->id= $_GET["id"];
|
$contrat->id= $_GET["id"];
|
||||||
@ -134,132 +134,125 @@ if ($_GET["id"])
|
|||||||
$commercial_suiv = new User($db, $contrat->commercial_suiv_id);
|
$commercial_suiv = new User($db, $contrat->commercial_suiv_id);
|
||||||
$commercial_suiv->fetch();
|
$commercial_suiv->fetch();
|
||||||
|
|
||||||
print '<tr><td width="20%">Commercial Suivi</td>';
|
print '<tr><td width="20%">Commercial Suivi</td>';
|
||||||
print '<td colspan="2">'.$commercial_suiv->fullname.'</td></tr>';
|
print '<td colspan="2">'.$commercial_suiv->fullname.'</td></tr>';
|
||||||
|
|
||||||
/* Contacts */
|
/* Contacts */
|
||||||
print '<tr><td valign="top" width="20%">Contact facture</td>';
|
print '<tr><td valign="top" width="20%">Contact facture</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
|
|
||||||
$sql = "SELECT c.idp, c.name, c.firstname, c.email ";
|
$sql = "SELECT c.idp, c.name, c.firstname, c.email ";
|
||||||
$sql .= "FROM ".MAIN_DB_PREFIX."socpeople as c";
|
$sql .= "FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||||
$sql .= ",".MAIN_DB_PREFIX."telephonie_contrat_contact_facture as cf";
|
$sql .= ",".MAIN_DB_PREFIX."telephonie_contrat_contact_facture as cf";
|
||||||
$sql .= " WHERE c.idp = cf.fk_contact AND cf.fk_contrat = ".$contrat->id." ORDER BY name ";
|
$sql .= " WHERE c.idp = cf.fk_contact AND cf.fk_contrat = ".$contrat->id." ORDER BY name ";
|
||||||
if ( $db->query( $sql) )
|
if ( $db->query( $sql) )
|
||||||
|
{
|
||||||
|
$num = $db->num_rows();
|
||||||
|
if ( $num > 0 )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$i = 0;
|
||||||
if ( $num > 0 )
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$row = $db->fetch_row($i);
|
||||||
while ($i < $num)
|
|
||||||
{
|
|
||||||
$row = $db->fetch_row($i);
|
|
||||||
|
|
||||||
print $row[1] . " " . $row[2] . " <".$row[3]."><br />";
|
print $row[1] . " " . $row[2] . " <".$row[3]."><br />";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$db->free();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
$db->free();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $sql;
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
/* Fin Contacts */
|
||||||
|
|
||||||
|
print "</table><br />";
|
||||||
|
|
||||||
|
|
||||||
|
/* Services */
|
||||||
|
|
||||||
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
|
|
||||||
|
$sql = "SELECT s.libelle, s.statut";
|
||||||
|
$sql .= " , cs.rowid as serid, s.montant, cs.montant as montant_fac";
|
||||||
|
$sql .= " , ".$db->pdate("cs.date_creat") . " as date_creat";
|
||||||
|
$sql .= " , u.name, u.firstname";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_service as cs";
|
||||||
|
$sql .= " , ".MAIN_DB_PREFIX."telephonie_service as s";
|
||||||
|
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
||||||
|
|
||||||
|
$sql .= " WHERE cs.fk_service = s.rowid";
|
||||||
|
$sql .= " AND cs.fk_user_creat = u.rowid";
|
||||||
|
$sql .= " AND cs.fk_contrat = ".$contrat->id;
|
||||||
|
|
||||||
|
if ( $db->query( $sql) )
|
||||||
|
{
|
||||||
|
$numlignes = $db->num_rows();
|
||||||
|
if ( $numlignes > 0 )
|
||||||
{
|
{
|
||||||
print $sql;
|
$i = 0;
|
||||||
}
|
$ligne = new LigneTel($db);
|
||||||
print '</td></tr>';
|
|
||||||
/* Fin Contacts */
|
|
||||||
|
|
||||||
print "</table><br />";
|
print '<tr class="liste_titre"><td>Service</td>';
|
||||||
|
print '<td align="right">Montant Facturé</td>';
|
||||||
|
print '<td align="right">Montant du service</td>';
|
||||||
|
if ($user->rights->telephonie->service->affecter)
|
||||||
|
print "<td> </td>\n";
|
||||||
|
print '<td align="center">Ajouté par</td>';
|
||||||
|
print '<td align="center">Ajouté le</td></tr>';
|
||||||
|
|
||||||
|
while ($i < $numlignes)
|
||||||
/* Services */
|
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
|
||||||
|
|
||||||
$sql = "SELECT s.libelle, s.statut";
|
|
||||||
$sql .= " , cs.rowid as serid, s.montant, cs.montant as montant_fac";
|
|
||||||
$sql .= " , ".$db->pdate("cs.date_creat") . " as date_creat";
|
|
||||||
$sql .= " , u.name, u.firstname";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_service as cs";
|
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."telephonie_service as s";
|
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
|
||||||
|
|
||||||
$sql .= " WHERE cs.fk_service = s.rowid";
|
|
||||||
$sql .= " AND cs.fk_user_creat = u.rowid";
|
|
||||||
$sql .= " AND cs.fk_contrat = ".$contrat->id;
|
|
||||||
|
|
||||||
if ( $db->query( $sql) )
|
|
||||||
{
|
|
||||||
$numlignes = $db->num_rows();
|
|
||||||
if ( $numlignes > 0 )
|
|
||||||
{
|
{
|
||||||
$i = 0;
|
$obj = $db->fetch_object($i);
|
||||||
$ligne = new LigneTel($db);
|
$var=!$var;
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td>Service</td>';
|
print "<tr $bc[$var]><td>";
|
||||||
print '<td align="right">Montant Facturé</td>';
|
|
||||||
print '<td align="right">Montant du service</td>';
|
|
||||||
if ($user->rights->telephonie->ligne->creer)
|
|
||||||
print "<td> </td>\n";
|
|
||||||
print '<td align="center">Ajouté par</td>';
|
|
||||||
print '<td align="center">Ajouté le</td></tr>';
|
|
||||||
|
|
||||||
while ($i < $numlignes)
|
print '<img src="../graph'.$obj->statut.'.png"> ';
|
||||||
|
|
||||||
|
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/telephonie/service/fiche.php?id='.$obj->serid.'">'.$obj->libelle."</a></td>\n";
|
||||||
|
|
||||||
|
print '<td align="right">'.price($obj->montant_fac)." euros HT</td>\n";
|
||||||
|
print '<td align="right">'.price($obj->montant)." euros HT</td>\n";
|
||||||
|
|
||||||
|
if ($user->rights->telephonie->service->affecter)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($i);
|
|
||||||
$var=!$var;
|
|
||||||
|
|
||||||
print "<tr $bc[$var]><td>";
|
|
||||||
|
|
||||||
print '<img src="../graph'.$obj->statut.'.png"> ';
|
|
||||||
|
|
||||||
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/telephonie/service/fiche.php?id='.$obj->serid.'">'.$obj->libelle."</a></td>\n";
|
|
||||||
|
|
||||||
print '<td align="right">'.price($obj->montant_fac)." euros HT</td>\n";
|
|
||||||
print '<td align="right">'.price($obj->montant)." euros HT</td>\n";
|
|
||||||
|
|
||||||
if ($user->rights->telephonie->ligne->creer)
|
|
||||||
{
|
|
||||||
print '<td align="center"><a href="services.php?id='.$contrat->id.'&action=rmservice&service_id='.$obj->serid.'">';
|
print '<td align="center"><a href="services.php?id='.$contrat->id.'&action=rmservice&service_id='.$obj->serid.'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print "</a></td>";
|
print "</a></td>";
|
||||||
}
|
|
||||||
print '<td align="center">'.$obj->firstname.' '.$obj->name.'</td>';
|
|
||||||
print '<td align="center">'.strftime("%d/%m/%y",$obj->date_creat).'</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
print '<td align="center">'.$obj->firstname.' '.$obj->name.'</td>';
|
||||||
|
print '<td align="center">'.strftime("%d/%m/%y",$obj->date_creat).'</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
$db->free();
|
||||||
{
|
|
||||||
print $db->error();
|
|
||||||
print $sql;
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $db->error();
|
||||||
|
print $sql;
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
/*
|
}
|
||||||
* Service
|
/*
|
||||||
*
|
* Service
|
||||||
*
|
*
|
||||||
*/
|
*
|
||||||
|
*/
|
||||||
if ($user->rights->telephonie->ligne->creer)
|
if ($user->rights->telephonie->service->affecter)
|
||||||
{
|
{
|
||||||
|
|
||||||
print_fiche_titre('Ajouter un service', $mesg);
|
print_fiche_titre('Ajouter un service', $mesg);
|
||||||
|
|
||||||
print '<form action="services.php?id='.$contrat->id.'" method="post">';
|
print '<form action="services.php?id='.$contrat->id.'" method="post">';
|
||||||
print '<input type="hidden" name="action" value="addservice">';
|
print '<input type="hidden" name="action" value="addservice">';
|
||||||
|
|
||||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
print '<tr><td valign="top" width="20%">Service</td><td valign="top" colspan="2">';
|
print '<tr><td valign="top" width="20%">Service</td><td valign="top" colspan="2">';
|
||||||
|
|
||||||
@ -301,16 +294,16 @@ if ($_GET["id"])
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "Error";
|
print "Error";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user