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"]; |
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"]); |
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"]); |
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"]; |
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"]; |
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"]); |
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"]); |
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"]); |
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"]); |
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"]); |
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"]); |
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"]; |
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 |
{ |
{ |
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 |
|
|
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) |