PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 1ms

/htdocs/societe/lib/societe.lib.php

https://bitbucket.org/speedealing/speedealing
PHP | 614 lines | 332 code | 94 blank | 188 comment | 79 complexity | c072334c340686b339fd2a380c1db757 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  4. * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
  5. * Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
  6. * Copyright (C) 2010-2012 Herve Prot <herve.prot@symeos.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. * or see http://www.gnu.org/
  21. */
  22. /**
  23. * \file htdocs/core/lib/company.lib.php
  24. * \brief Ensemble de fonctions de base pour le module societe
  25. * \ingroup societe
  26. */
  27. /**
  28. * Return array of tabs to used on pages for third parties cards.
  29. *
  30. * @param Object $object Object company shown
  31. * @return array Array of tabs
  32. */
  33. function societe_prepare_head($object) {
  34. global $langs, $conf, $user;
  35. $h = 0;
  36. $head = array();
  37. $head[$h][0] = DOL_URL_ROOT . '/societe/fiche.php?socid=' . $object->id;
  38. $head[$h][1] = $langs->trans("Card");
  39. $head[$h][2] = 'card';
  40. $h++;
  41. // TODO Remove tests on object->object. Functions must be called with a company object directly
  42. if (($object->client == 2 || $object->client == 3
  43. || (isset($object->object) && $object->object->client == 2) || (isset($object->object) && $object->object->client == 3)) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
  44. $head[$h][0] = DOL_URL_ROOT . '/comm/prospect/fiche.php?socid=' . $object->id;
  45. $head[$h][1] = $langs->trans("Prospect");
  46. $head[$h][2] = 'prospect';
  47. $h++;
  48. }
  49. if ($object->client == 1 || $object->client == 3 || (isset($object->object) && $object->object->client == 1) || (isset($object->object) && $object->object->client == 3)) {
  50. $head[$h][0] = DOL_URL_ROOT . '/comm/fiche.php?socid=' . $object->id;
  51. $head[$h][1] = $langs->trans("Customer");
  52. $head[$h][2] = 'customer';
  53. $h++;
  54. }
  55. if (!empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur)) && !empty($user->rights->fournisseur->lire)) {
  56. $head[$h][0] = DOL_URL_ROOT . '/fourn/fiche.php?socid=' . $object->id;
  57. $head[$h][1] = $langs->trans("Supplier");
  58. $head[$h][2] = 'supplier';
  59. $h++;
  60. }
  61. // Show more tabs from modules
  62. // Entries must be declared in modules descriptor with line
  63. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  64. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  65. complete_head_from_modules($conf, $langs, $object, $head, $h, 'thirdparty');
  66. if ($user->societe_id == 0) {
  67. // Notes
  68. $head[$h][0] = DOL_URL_ROOT . '/societe/note.php?socid=' . $object->id;
  69. $head[$h][1] = $langs->trans("Note");
  70. $head[$h][2] = 'note';
  71. $h++;
  72. if (!empty($conf->ecm->enabled)) {
  73. // Attached files
  74. $head[$h][0] = DOL_URL_ROOT . '/societe/document.php?socid=' . $object->id;
  75. $head[$h][1] = $langs->trans("Documents");
  76. $head[$h][2] = 'document';
  77. $h++;
  78. }
  79. //Map module
  80. if ($conf->map->enabled && $user->societe_id == 0 && $object->lat && $object->lng) {
  81. $langs->load("map@map");
  82. $head[$h][0] = DOL_URL_ROOT . '/map/map.php?socid=' . $object->id;
  83. $head[$h][1] = $langs->trans("Map");
  84. $head[$h][2] = 'map';
  85. $h++;
  86. }
  87. // Notifications
  88. if (!empty($conf->notification->enabled)) {
  89. $head[$h][0] = DOL_URL_ROOT . '/societe/notify/fiche.php?socid=' . $object->id;
  90. $head[$h][1] = $langs->trans("Notifications");
  91. $head[$h][2] = 'notify';
  92. $h++;
  93. }
  94. }
  95. complete_head_from_modules($conf, $langs, $object, $head, $h, 'thirdparty', 'remove');
  96. return $head;
  97. }
  98. /**
  99. * Return array of tabs to used on page
  100. *
  101. * @param Object $object Object for tabs
  102. * @return array Array of tabs
  103. */
  104. function societe_prepare_head2($object) {
  105. global $langs, $conf, $user;
  106. $h = 0;
  107. $head = array();
  108. $head[$h][0] = DOL_URL_ROOT . '/societe/soc.php?socid=' . $object->id;
  109. $head[$h][1] = $langs->trans("Card");
  110. $head[$h][2] = 'company';
  111. $h++;
  112. if (empty($conf->global->SOCIETE_DISABLE_BANKACCOUNT)) {
  113. $head[$h][0] = DOL_URL_ROOT . '/societe/rib.php?socid=' . $object->id;
  114. $head[$h][1] = $langs->trans("BankAccount") . " $account->number";
  115. $head[$h][2] = 'rib';
  116. $h++;
  117. }
  118. if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) {
  119. $head[$h][0] = 'lien.php?socid=' . $object->id;
  120. $head[$h][1] = $langs->trans("ParentCompany");
  121. $head[$h][2] = 'links';
  122. $h++;
  123. }
  124. $head[$h][0] = 'commerciaux.php?socid=' . $object->id;
  125. $head[$h][1] = $langs->trans("SalesRepresentative");
  126. $head[$h][2] = 'salesrepresentative';
  127. $h++;
  128. return $head;
  129. }
  130. /**
  131. * Return array head with list of tabs to view object informations.
  132. *
  133. * @param Object $object Thirdparty
  134. * @return array head array with tabs
  135. */
  136. function societe_admin_prepare_head($object) {
  137. global $langs, $conf, $user;
  138. $h = 0;
  139. $head = array();
  140. $head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe.php';
  141. $head[$h][1] = $langs->trans("Miscellanous");
  142. $head[$h][2] = 'general';
  143. $h++;
  144. // Show more tabs from modules
  145. // Entries must be declared in modules descriptor with line
  146. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  147. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  148. complete_head_from_modules($conf, $langs, $object, $head, $h, 'company_admin');
  149. $head[$h][0] = DOL_URL_ROOT . '/societe/admin/societe_extrafields.php';
  150. $head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
  151. $head[$h][2] = 'attributes';
  152. $h++;
  153. $head[$h][0] = DOL_URL_ROOT . '/societe/admin/contact_extrafields.php';
  154. $head[$h][1] = $langs->trans("ExtraFieldsContacts");
  155. $head[$h][2] = 'attributes_contacts';
  156. $h++;
  157. complete_head_from_modules($conf, $langs, $object, $head, $h, 'company_admin', 'remove');
  158. return $head;
  159. }
  160. /**
  161. * Return country label, code or id from an id or a code
  162. *
  163. * @param int $id Id or code of country
  164. * @param int $withcode '0'=Return label,
  165. * '1'=Return code + label,
  166. * '2'=Return code from id,
  167. * '3'=Return id from code,
  168. * 'all'=Return array('id'=>,'code'=>,'label'=>)
  169. * @param DoliDB $dbtouse Database handler (using in global way may fail because of conflicts with some autoload features)
  170. * @param Translate $outputlangs Langs object for output translation
  171. * @param int $entconv 0=Return value without entities and not converted to output charset
  172. * @return mixed String with country code or translated country name or Array('id','code','label')
  173. */
  174. /*function getCountry($id, $withcode = '', $dbtouse = 0, $outputlangs = '', $entconv = 1) {
  175. global $db, $langs;
  176. // Check parameters
  177. if (empty($id)) {
  178. if ($withcode === 'all')
  179. return array('id' => '', 'code' => '', 'label' => '');
  180. else
  181. return '';
  182. }
  183. if (!is_object($dbtouse))
  184. $dbtouse = $db;
  185. if (!is_object($outputlangs))
  186. $outputlangs = $langs;
  187. $sql = "SELECT rowid, code, libelle FROM " . MAIN_DB_PREFIX . "c_pays";
  188. if (is_numeric($id))
  189. $sql.= " WHERE rowid=" . $id;
  190. else
  191. $sql.= " WHERE code='" . $db->escape($id) . "'";
  192. dol_syslog("Company.lib::getCountry sql=" . $sql);
  193. $resql = $dbtouse->query($sql);
  194. if ($resql) {
  195. $obj = $dbtouse->fetch_object($resql);
  196. if ($obj) {
  197. $label = ((!empty($obj->libelle) && $obj->libelle != '-') ? $obj->libelle : '');
  198. if (is_object($outputlangs)) {
  199. $outputlangs->load("dict");
  200. if ($entconv)
  201. $label = ($obj->code && ($outputlangs->trans("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->trans("Country" . $obj->code) : $label;
  202. else
  203. $label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country" . $obj->code) != "Country" . $obj->code)) ? $outputlangs->transnoentitiesnoconv("Country" . $obj->code) : $label;
  204. }
  205. if ($withcode == 1)
  206. return $label ? "$obj->code - $label" : "$obj->code";
  207. else if ($withcode == 2)
  208. return $obj->code;
  209. else if ($withcode == 3)
  210. return $obj->rowid;
  211. else if ($withcode === 'all')
  212. return array('id' => $obj->rowid, 'code' => $obj->code, 'label' => $label);
  213. else
  214. return $label;
  215. }
  216. else {
  217. return 'NotDefined';
  218. }
  219. }
  220. else
  221. dol_print_error($dbtouse, '');
  222. return 'Error';
  223. }*/
  224. /**
  225. * Return state translated from an id
  226. *
  227. * @param int $id id of state (province/departement)
  228. * @param int $withcode '0'=Return label,
  229. * '1'=Return string code + label,
  230. * '2'=Return code,
  231. * 'all'=return array('id'=>,'code'=>,'label'=>)
  232. * @param DoliDB $dbtouse Database handler (using in global way may fail because of conflicts with some autoload features)
  233. * @return string String with state code or translated state name
  234. */
  235. function getState($id, $withcode = '', $dbtouse = 0) {
  236. global $db, $langs;
  237. if (!is_object($dbtouse))
  238. $dbtouse = $db;
  239. $sql = "SELECT rowid, code_departement as code, nom as label FROM " . MAIN_DB_PREFIX . "c_departements";
  240. $sql.= " WHERE rowid=" . $id;
  241. dol_syslog("Company.lib::getState sql=" . $sql);
  242. $resql = $dbtouse->query($sql);
  243. if ($resql) {
  244. $obj = $dbtouse->fetch_object($resql);
  245. if ($obj) {
  246. $label = $obj->label;
  247. if ($withcode == '1')
  248. return $label = $obj->code ? "$obj->code" : "$obj->code - $label";
  249. else if ($withcode == '2')
  250. return $label = $obj->code;
  251. else if ($withcode == 'all')
  252. return array('id' => $obj->rowid, 'code' => $obj->code, 'label' => $label);
  253. else
  254. return $label;
  255. }
  256. else {
  257. return $langs->trans("NotDefined");
  258. }
  259. }
  260. else
  261. dol_print_error($dbtouse, '');
  262. }
  263. /**
  264. * Retourne le nom traduit ou code+nom d'une devise
  265. *
  266. * @param string $code_iso Code iso de la devise
  267. * @param int $withcode '1'=affiche code + nom
  268. * @return string Nom traduit de la devise
  269. */
  270. function currency_name($code_iso, $withcode = '') {
  271. global $langs, $db;
  272. // Si il existe une traduction, on peut renvoyer de suite le libelle
  273. if ($langs->trans("Currency" . $code_iso) != "Currency" . $code_iso) {
  274. return $langs->trans("Currency" . $code_iso);
  275. }
  276. // Si pas de traduction, on consulte le libelle par defaut en table
  277. $sql = "SELECT label FROM " . MAIN_DB_PREFIX . "c_currencies";
  278. $sql.= " WHERE code_iso='" . $code_iso . "'";
  279. $resql = $db->query($sql);
  280. if ($resql) {
  281. $num = $db->num_rows($resql);
  282. if ($num) {
  283. $obj = $db->fetch_object($resql);
  284. $label = ($obj->label != '-' ? $obj->label : '');
  285. if ($withcode)
  286. return ($label == $code_iso) ? "$code_iso" : "$code_iso - $label";
  287. else
  288. return $label;
  289. }
  290. else {
  291. return $code_iso;
  292. }
  293. }
  294. }
  295. /**
  296. * Retourne le nom traduit de la forme juridique
  297. *
  298. * @param string $code Code de la forme juridique
  299. * @return string Nom traduit du pays
  300. */
  301. function getFormeJuridiqueLabel($code) {
  302. global $db, $langs;
  303. if (!$code)
  304. return '';
  305. $sql = "SELECT libelle FROM " . MAIN_DB_PREFIX . "c_forme_juridique";
  306. $sql.= " WHERE code='$code'";
  307. dol_syslog("Company.lib::getFormeJuridiqueLabel sql=" . $sql);
  308. $resql = $db->query($sql);
  309. if ($resql) {
  310. $num = $db->num_rows($resql);
  311. if ($num) {
  312. $obj = $db->fetch_object($resql);
  313. $label = ($obj->libelle != '-' ? $obj->libelle : '');
  314. return $label;
  315. } else {
  316. return $langs->trans("NotDefined");
  317. }
  318. }
  319. }
  320. /**
  321. * Show html area for list of projects
  322. *
  323. * @param Conf $conf Object conf
  324. * @param Translate $langs Object langs
  325. * @param DoliDB $db Database handler
  326. * @param Object $object Third party object
  327. * @param string $backtopage Url to go once contact is created
  328. * @return void
  329. */
  330. function show_projects($conf, $langs, $db, $object, $backtopage = '') {
  331. global $user;
  332. global $bc;
  333. $i = -1;
  334. if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
  335. $langs->load("projects");
  336. $buttoncreate = '';
  337. if (!empty($conf->projet->enabled) && $user->rights->projet->creer) {
  338. //$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&amp;backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
  339. $buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/projet/fiche.php?socid=' . $object->id . '&amp;action=create&amp;backtopage=' . urlencode($backtopage) . '">' . $langs->trans("AddProject") . ' ' . img_picto($langs->trans("AddProject"), 'filenew') . '</a>' . "\n";
  340. }
  341. print "\n";
  342. print_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $buttoncreate, '');
  343. print "\n" . '<table class="noborder" width=100%>';
  344. $sql = "SELECT p.rowid,p.title,p.ref,p.public, p.dateo as do, p.datee as de";
  345. $sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
  346. $sql .= " WHERE p.fk_soc = " . $object->id;
  347. $sql .= " ORDER BY p.dateo DESC";
  348. $result = $db->query($sql);
  349. if ($result) {
  350. $num = $db->num_rows($result);
  351. print '<tr class="liste_titre">';
  352. print '<td>' . $langs->trans("Ref") . '</td><td>' . $langs->trans("Name") . '</td><td align="center">' . $langs->trans("DateStart") . '</td><td align="center">' . $langs->trans("DateEnd") . '</td>';
  353. print '</tr>';
  354. if ($num > 0) {
  355. require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
  356. $projectstatic = new Project($db);
  357. $i = 0;
  358. $var = true;
  359. while ($i < $num) {
  360. $obj = $db->fetch_object($result);
  361. $projectstatic->fetch($obj->rowid);
  362. // To verify role of users
  363. $userAccess = $projectstatic->restrictedProjectArea($user);
  364. if ($user->rights->projet->lire && $userAccess > 0) {
  365. $var = !$var;
  366. print "<tr $bc[$var]>";
  367. // Ref
  368. print '<td><a href="' . DOL_URL_ROOT . '/projet/fiche.php?id=' . $obj->rowid . '">' . img_object($langs->trans("ShowProject"), ($obj->public ? 'projectpub' : 'project')) . " " . $obj->ref . '</a></td>';
  369. // Label
  370. print '<td>' . $obj->title . '</td>';
  371. // Date start
  372. print '<td align="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
  373. // Date end
  374. print '<td align="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
  375. print '</tr>';
  376. }
  377. $i++;
  378. }
  379. } else {
  380. print '<tr><td colspan="3">' . $langs->trans("None") . '</td></tr>';
  381. }
  382. $db->free($result);
  383. } else {
  384. dol_print_error($db);
  385. }
  386. print "</table>";
  387. print "<br>\n";
  388. }
  389. return $i;
  390. }
  391. /**
  392. * Show html area for list of addresses
  393. *
  394. * @param Conf $conf Object conf
  395. * @param Translate $langs Object langs
  396. * @param DoliDB $db Database handler
  397. * @param Object $object Third party object
  398. * @param string $backtopage Url to go once address is created
  399. * @return void
  400. */
  401. function show_addresses($conf, $langs, $db, $object, $backtopage = '') {
  402. global $user;
  403. global $bc;
  404. require_once DOL_DOCUMENT_ROOT . '/societe/class/address.class.php';
  405. $addressstatic = new Address($db);
  406. $num = $addressstatic->fetch_lines($object->id);
  407. $buttoncreate = '';
  408. if ($user->rights->societe->creer) {
  409. $buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/comm/address.php?socid=' . $object->id . '&amp;action=create&amp;backtopage=' . urlencode($backtopage) . '">' . $langs->trans("AddAddress") . ' ' . img_picto($langs->trans("AddAddress"), 'filenew') . '</a>' . "\n";
  410. }
  411. print "\n";
  412. print_fiche_titre($langs->trans("AddressesForCompany"), $buttoncreate, '');
  413. print "\n" . '<table class="noborder" width="100%">' . "\n";
  414. print '<tr class="liste_titre"><td>' . $langs->trans("Label") . '</td>';
  415. print '<td>' . $langs->trans("CompanyName") . '</td>';
  416. print '<td>' . $langs->trans("Town") . '</td>';
  417. print '<td>' . $langs->trans("Country") . '</td>';
  418. print '<td>' . $langs->trans("Tel") . '</td>';
  419. print '<td>' . $langs->trans("Fax") . '</td>';
  420. print "<td>&nbsp;</td>";
  421. print "</tr>";
  422. if ($num > 0) {
  423. $var = true;
  424. foreach ($addressstatic->lines as $address) {
  425. $var = !$var;
  426. print "<tr " . $bc[$var] . ">";
  427. print '<td>';
  428. $addressstatic->id = $address->id;
  429. $addressstatic->label = $address->label;
  430. print $addressstatic->getNomUrl(1);
  431. print '</td>';
  432. print '<td>' . $address->name . '</td>';
  433. print '<td>' . $address->town . '</td>';
  434. $img = picto_from_langcode($address->country_code);
  435. print '<td>' . ($img ? $img . ' ' : '') . $address->country . '</td>';
  436. // Lien click to dial
  437. print '<td>';
  438. print dol_print_phone($address->phone, $address->country_code, $address->id, $object->id, 'AC_TEL');
  439. print '</td>';
  440. print '<td>';
  441. print dol_print_phone($address->fax, $address->country_code, $address->id, $object->id, 'AC_FAX');
  442. print '</td>';
  443. if ($user->rights->societe->creer) {
  444. print '<td align="right">';
  445. print '<a href="' . DOL_URL_ROOT . '/comm/address.php?action=edit&amp;id=' . $address->id . '&amp;socid=' . $object->id . '&amp;backtopage=' . urlencode($backtopage) . '">';
  446. print img_edit();
  447. print '</a></td>';
  448. }
  449. print "</tr>\n";
  450. }
  451. } else {
  452. //print "<tr ".$bc[$var].">";
  453. //print '<td>'.$langs->trans("NoAddressYetDefined").'</td>';
  454. //print "</tr>\n";
  455. }
  456. print "\n</table>\n";
  457. print "<br>\n";
  458. return $num;
  459. }
  460. /**
  461. * Show html area for list of subsidiaries
  462. *
  463. * @param Conf $conf Object conf
  464. * @param Translate $langs Object langs
  465. * @param DoliDB $db Database handler
  466. * @param Societe $object Third party object
  467. * @return void
  468. */
  469. function show_subsidiaries($conf, $langs, $db, $object) {
  470. global $user;
  471. global $bc;
  472. $i = -1;
  473. $sql = "SELECT s.rowid, s.nom as name, s.address, s.cp as zip, s.ville as town, s.code_client, s.canvas";
  474. $sql.= " FROM " . MAIN_DB_PREFIX . "societe as s";
  475. $sql.= " WHERE s.parent = " . $object->id;
  476. $sql.= " AND s.entity IN (" . getEntity('societe', 1) . ")";
  477. $sql.= " ORDER BY s.nom";
  478. $result = $db->query($sql);
  479. $num = $db->num_rows($result);
  480. if ($num) {
  481. $socstatic = new Societe($db);
  482. print_titre($langs->trans("Subsidiaries"));
  483. print "\n" . '<table class="noborder" width="100%">' . "\n";
  484. print '<tr class="liste_titre"><td>' . $langs->trans("Company") . '</td>';
  485. print '<td>' . $langs->trans("Address") . '</td><td>' . $langs->trans("Zip") . '</td>';
  486. print '<td>' . $langs->trans("Town") . '</td><td>' . $langs->trans("CustomerCode") . '</td>';
  487. print "<td>&nbsp;</td>";
  488. print "</tr>";
  489. $i = 0;
  490. $var = true;
  491. while ($i < $num) {
  492. $obj = $db->fetch_object($result);
  493. $var = !$var;
  494. print "<tr " . $bc[$var] . ">";
  495. print '<td>';
  496. $socstatic->id = $obj->rowid;
  497. $socstatic->name = $obj->name;
  498. $socstatic->canvas = $obj->canvas;
  499. print $socstatic->getNomUrl(1);
  500. print '</td>';
  501. print '<td>' . $obj->address . '</td>';
  502. print '<td>' . $obj->zip . '</td>';
  503. print '<td>' . $obj->town . '</td>';
  504. print '<td>' . $obj->code_client . '</td>';
  505. print '<td align="center">';
  506. print '<a href="' . DOL_URL_ROOT . '/societe/soc.php?socid=' . $obj->rowid . '&amp;action=edit">';
  507. print img_edit();
  508. print '</a></td>';
  509. print "</tr>\n";
  510. $i++;
  511. }
  512. print "\n</table>\n";
  513. }
  514. print "<br>\n";
  515. return $i;
  516. }
  517. ?>