/[dolibarr]/dolibarr/htdocs/telephonie/ligne/fiche.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/ligne/fiche.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by rodolphe, Fri Aug 19 13:26:01 2005 UTC revision 1.19 by rodolphe, Fri Sep 2 09:32:13 2005 UTC
# Line 32  $h = strftime("%H",$dt); Line 32  $h = strftime("%H",$dt);
32  $m = strftime("%M",$dt);  $m = strftime("%M",$dt);
33  $s = strftime("%S",$dt);  $s = strftime("%S",$dt);
34    
35  if ($_POST["action"] == 'add')  if ($_POST["action"] == 'add' && $user->rights->telephonie->ligne->creer)
36  {  {
37    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
38    $ligne->contrat         = $_POST["contrat"];    $ligne->contrat         = $_POST["contrat"];
# Line 58  if ($_POST["action"] == 'add') Line 58  if ($_POST["action"] == 'add')
58      }        }  
59  }  }
60    
61  if ($_GET["action"] == 'transfer')  if ($_GET["action"] == 'transfer' && $user->rights->telephonie->ligne->creer)
62  {  {
63    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
64    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 69  if ($_GET["action"] == 'transfer') Line 69  if ($_GET["action"] == 'transfer')
69      }      }
70  }  }
71    
72  if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')  if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user->rights->telephonie->ligne->creer)
73  {  {
74    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
75    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 106  if ($_POST["action"] == 'changecontrat' Line 106  if ($_POST["action"] == 'changecontrat'
106      }      }
107  }  }
108    
109  if ($_POST["action"] == 'addcontact')  if ($_POST["action"] == 'addcontact' && $user->rights->telephonie->ligne->creer)
110  {  {
111    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
112    $ligne->id = $_GET["id"];    $ligne->id = $_GET["id"];
# Line 119  if ($_POST["action"] == 'addcontact') Line 119  if ($_POST["action"] == 'addcontact')
119  }  }
120    
121    
122  if ($_GET["action"] == 'delcontact')  if ($_GET["action"] == 'delcontact' && $user->rights->telephonie->ligne->creer)
123  {  {
124    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
125    $ligne->id = $_GET["id"];    $ligne->id = $_GET["id"];
# Line 131  if ($_GET["action"] == 'delcontact') Line 131  if ($_GET["action"] == 'delcontact')
131    
132  }  }
133    
134  if ($_GET["action"] == 'active')  if ($_GET["action"] == 'active' && $user->rights->telephonie->ligne->creer)
135  {  {
136    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
137    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 148  if ($_GET["action"] == 'active') Line 148  if ($_GET["action"] == 'active')
148    
149  }  }
150    
151  if ($_GET["action"] == 'refuse')  if ($_GET["action"] == 'refuse' && $user->rights->telephonie->ligne->creer)
152  {  {
153    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
154    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 164  if ($_GET["action"] == 'refuse') Line 164  if ($_GET["action"] == 'refuse')
164      }      }
165  }  }
166    
167  if ($_GET["action"] == 'resilier')  if ($_GET["action"] == 'resilier' && $user->rights->telephonie->ligne->creer)
168  {  {
169    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
170    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 175  if ($_GET["action"] == 'resilier') Line 175  if ($_GET["action"] == 'resilier')
175      }      }
176  }  }
177    
178  if ($_GET["action"] == 'annuleresilier')  if ($_GET["action"] == 'annuleresilier' && $user->rights->telephonie->ligne->creer)
179  {  {
180    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
181    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 186  if ($_GET["action"] == 'annuleresilier') Line 186  if ($_GET["action"] == 'annuleresilier')
186      }      }
187  }  }
188    
189  if ($_GET["action"] == 'confirmresilier')  if ($_GET["action"] == 'confirmresilier' && $user->rights->telephonie->ligne->creer)
190  {  {
191    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
192    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 232  if ($_GET["action"] == 'confirmresilier' Line 232  if ($_GET["action"] == 'confirmresilier'
232      }      }
233  }  }
234    
235  if ($_GET["action"] == 'acommander')  if ($_GET["action"] == 'acommander' && $user->rights->telephonie->ligne->creer)
236  {  {
237    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
238    $ligne->fetch_by_id($_GET["id"]);    $ligne->fetch_by_id($_GET["id"]);
# Line 244  if ($_GET["action"] == 'acommander') Line 244  if ($_GET["action"] == 'acommander')
244  }  }
245    
246    
247  if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))  if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->telephonie->ligne->creer)
248  {  {
249    $ligne = new LigneTel($db);    $ligne = new LigneTel($db);
250    $ligne->id = $_GET["id"];    $ligne->id = $_GET["id"];
# Line 511  else Line 511  else
511              }              }
512          }          }
513    
514        if ( $result == 1)        if ($result == 1)
515            {
516              $client_comm = new Societe($db);
517              $client_comm->fetch($ligne->client_comm_id, $user);
518            }
519    
520          if (!$client_comm->perm_read)
521            {
522              print decoct($client_comm->id);
523              print "Lecture non authorisée";
524            }
525    
526    
527          if ($result == 1 && $client_comm->perm_read)
528          {          {
529            if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')            if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
530              {              {
# Line 583  else Line 596  else
596                    print '</td></tr>';                    print '</td></tr>';
597                  }                  }
598    
               $client_comm = new Societe($db, $ligne->client_comm_id);  
               $client_comm->fetch($ligne->client_comm_id);  
   
599                print '<tr><td width="20%">Client</td><td>';                print '<tr><td width="20%">Client</td><td>';
600                print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">';                print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">';
601    
# Line 1295  if ( $user->rights->telephonie->ligne->c Line 1305  if ( $user->rights->telephonie->ligne->c
1305    
1306  print "\n<br>\n<div class=\"tabsAction\">\n";  print "\n<br>\n<div class=\"tabsAction\">\n";
1307    
1308  if ($_GET["action"] == '')  if ($_GET["action"] == '' && $result == 1 && $client_comm->perm_read)
1309  {  {
1310    
1311    if ( $user->rights->telephonie->ligne->resilier && $ligne->statut == 3)    if ( $user->rights->telephonie->ligne->resilier && $ligne->statut == 3)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26