42 |
$result = $ligne->fetch($_GET["numero"]); |
$result = $ligne->fetch($_GET["numero"]); |
43 |
} |
} |
44 |
} |
} |
45 |
|
|
46 |
|
|
47 |
|
if ($result == 1) |
48 |
|
{ |
49 |
|
$client_comm = new Societe($db); |
50 |
|
$client_comm->fetch($ligne->client_comm_id, $user); |
51 |
|
} |
52 |
|
|
53 |
|
if (!$client_comm->perm_read) |
54 |
|
{ |
55 |
|
print "Lecture non authorisée"; |
56 |
|
} |
57 |
|
|
58 |
|
|
59 |
if ( $result ) |
if ($result == 1 && $client_comm->perm_read) |
60 |
{ |
{ |
61 |
|
|
62 |
$h=0; |
$h=0; |
69 |
$hselected = $h; |
$hselected = $h; |
70 |
$h++; |
$h++; |
71 |
|
|
72 |
|
/* |
73 |
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id; |
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id; |
74 |
$head[$h][1] = $langs->trans('Factures détaillées'); |
$head[$h][1] = $langs->trans('Factures détaillées'); |
75 |
$h++; |
$h++; |
76 |
|
*/ |
77 |
|
|
78 |
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; |
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; |
79 |
$head[$h][1] = $langs->trans('Infos'); |
$head[$h][1] = $langs->trans('Infos'); |
176 |
print '<tr><td>Facture</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id.'">'.$fac->ref.'</a></td></tr>'; |
print '<tr><td>Facture</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/telephonie/client/facture.php?facid='.$fac->id.'">'.$fac->ref.'</a></td></tr>'; |
177 |
|
|
178 |
print "</table>\n"; |
print "</table>\n"; |
|
} |
|
|
/* |
|
|
* |
|
|
* |
|
|
* |
|
|
*/ |
|
|
|
|
|
$file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf"; |
|
|
$file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png"; |
|
179 |
|
|
180 |
if (file_exists($file_img)) |
/* |
181 |
{ |
* |
182 |
print '<br><img src="../showfacture.php?facref='.$fac->ref.'"></img>'; |
* |
183 |
} |
* |
184 |
else |
*/ |
185 |
{ |
|
186 |
if (file_exists("/usr/bin/convert")) |
$file = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf"; |
187 |
|
$file_img = DOL_DATA_ROOT."/facture/".$fac->ref."/".$fac->ref.".pdf.png"; |
188 |
|
|
189 |
|
if (file_exists($file_img)) |
190 |
{ |
{ |
191 |
exec("/usr/bin/convert $file $file_img"); |
print '<br><img src="../showfacture.php?uid='.$user->id.'&facref='.$fac->id.'"></img>'; |
192 |
|
} |
193 |
if (file_exists($file_img)) |
else |
194 |
{ |
{ |
195 |
print '<br><img src="../showfacture.php?facref='.$fac->ref.'"></img>'; |
if (file_exists("/usr/bin/convert")) |
|
} |
|
|
else |
|
196 |
{ |
{ |
197 |
print "Erreur "; |
exec("/usr/bin/convert $file $file_img"); |
198 |
|
|
199 |
|
if (file_exists($file_img)) |
200 |
|
{ |
201 |
|
print '<br><img src="../showfacture.php?uid='.$user->id.'&facref='.$fac->id.'"></img>'; |
202 |
|
} |
203 |
|
else |
204 |
|
{ |
205 |
|
print "Erreur "; |
206 |
|
} |
207 |
} |
} |
208 |
} |
} |
209 |
} |
} |