PageRenderTime 83ms CodeModel.GetById 41ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/societe/edit.php

https://bitbucket.org/speedealing/speedealing
PHP | 1195 lines | 826 code | 119 blank | 250 comment | 210 complexity | b6131c4b1d7dc7f430db2d809b73ef01 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2003 Brian Fraval <brian@fraval.org>
  4. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  5. * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
  6. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  7. * Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
  8. * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
  9. * Copyright (C) 2010-2012 Herve Prot <herve.prot@symeos.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. */
  24. if (!defined('NOTOKENRENEWAL'))
  25. define('NOTOKENRENEWAL', '1'); // Disables token renewal
  26. if (!defined('NOREQUIREMENU'))
  27. define('NOREQUIREMENU', '1');
  28. if (!defined('NOHEADER'))
  29. define('NOHEADER', '1');
  30. //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
  31. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
  32. require("../main.inc.php");
  33. require_once(DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php");
  34. require_once(DOL_DOCUMENT_ROOT . "/core/lib/images.lib.php");
  35. require_once(DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php");
  36. require_once(DOL_DOCUMENT_ROOT . "/core/class/html.formadmin.class.php");
  37. require_once(DOL_DOCUMENT_ROOT . "/core/class/html.formcompany.class.php");
  38. require_once(DOL_DOCUMENT_ROOT . "/core/class/html.formfile.class.php");
  39. require_once(DOL_DOCUMENT_ROOT . "/core/class/extrafields.class.php");
  40. require_once(DOL_DOCUMENT_ROOT . "/contact/class/contact.class.php");
  41. if ($conf->adherent->enabled)
  42. require_once(DOL_DOCUMENT_ROOT . "/adherents/class/adherent.class.php");
  43. if ($conf->highcharts->enabled)
  44. dol_include_once("/highCharts/class/highCharts.class.php");
  45. $langs->load("companies");
  46. $langs->load("commercial");
  47. $langs->load("bills");
  48. $langs->load("banks");
  49. $langs->load("users");
  50. if ($conf->notification->enabled)
  51. $langs->load("mails");
  52. $mesg = '';
  53. $error = 0;
  54. $errors = array();
  55. $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view');
  56. $confirm = GETPOST('confirm', 'alpha');
  57. $cancel = GETPOST('cancel', 'alpha');
  58. $socid = GETPOST('id', 'alpha');
  59. if ($user->societe_id)
  60. $socid = $user->societe_id;
  61. // Security check
  62. $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
  63. $object = new Societe($db);
  64. /*
  65. * Actions
  66. */
  67. if (empty($reshook)) {
  68. if ($_POST["getcustomercode"]) {
  69. // We defined value code_client
  70. $_POST["code_client"] = "Acompleter";
  71. }
  72. if ($_POST["getsuppliercode"]) {
  73. // We defined value code_fournisseur
  74. $_POST["code_fournisseur"] = "Acompleter";
  75. }
  76. // Add new third party
  77. if ((!$_POST["getcustomercode"] && !$_POST["getsuppliercode"])
  78. && ($action == 'add' || $action == 'update') && empty($cancel) && $user->rights->societe->creer) {
  79. require_once(DOL_DOCUMENT_ROOT . "/core/lib/functions2.lib.php");
  80. if ($action == 'update')
  81. $object->load($socid);
  82. else
  83. $object->canvas = $canvas;
  84. if (GETPOST("private") == 1) {
  85. $object->particulier = GETPOST("private");
  86. $object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? trim($_POST["prenom"] . ' ' . $_POST["nom"]) : trim($_POST["nom"] . ' ' . $_POST["prenom"]);
  87. $object->civilite_id = (int) $_POST["civilite_id"];
  88. // Add non official properties
  89. $object->name_bis = $_POST["nom"];
  90. $object->firstname = $_POST["prenom"];
  91. } else {
  92. $object->name = ucwords($_POST["nom"]);
  93. }
  94. foreach ($_POST as $key => $aRow)
  95. if (!in_array($key, $object->no_save))
  96. $object->$key = $aRow;
  97. $object->tms = dol_now();
  98. if (GETPOST("private") == 1) {
  99. $object->typent_id = 8; // TODO predict another method if the field "special" change of rowid
  100. } else {
  101. $object->typent_id = $_POST["typent_id"];
  102. }
  103. if ($conf->map->enabled) {
  104. //Retire le CEDEX de la ville :
  105. $town = $_POST["town"];
  106. $town = strtolower($town);
  107. $find = "cedex";
  108. $pos = strpos($town, $find);
  109. if ($pos != false) {
  110. $town = substr($town, 0, $pos);
  111. }
  112. $apiUrl = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" . urlencode($_POST["adresse"] . "," . $_POST["zipcode"] . "," . $town);
  113. $c = curl_init();
  114. curl_setopt($c, CURLOPT_URL, $apiUrl);
  115. curl_setopt($c, CURLOPT_HEADER, false);
  116. curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  117. // make the call
  118. $json = curl_exec($c);
  119. $response = json_decode($json);
  120. curl_close($c);
  121. if ($response->status == "OK") {
  122. $object->gps = array($response->results[0]->geometry->location->lat, $response->results[0]->geometry->location->lng);
  123. } else {
  124. $object->gps = array(0, 0);
  125. }
  126. }
  127. if (GETPOST('deletephoto'))
  128. $object->logo = '';
  129. else if (!empty($_FILES['photo']['name']))
  130. $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
  131. // Check parameters
  132. if (empty($_POST["cancel"])) {
  133. if (!empty($object->Web) && !isValidUrl($object->Web)) {
  134. $langs->load("errors");
  135. $error++;
  136. $errors[] = $langs->trans("ErrorBadUrl", $object->Web);
  137. $action = ($action == 'add' ? 'create' : 'edit');
  138. }
  139. if ($object->fournisseur && !$conf->fournisseur->enabled) {
  140. $langs->load("errors");
  141. $error++;
  142. $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled");
  143. $action = ($action == 'add' ? 'create' : 'edit');
  144. }
  145. /* for ($i = 1; $i < 3; $i++)
  146. {
  147. $slabel="idprof".$i;
  148. if (($_POST[$slabel] && $object->id_prof_verifiable($i)))
  149. {
  150. if($object->id_prof_exists($i,$_POST["$slabel"],$object->id))
  151. {
  152. $langs->load("errors");
  153. $error++; $errors[] = $langs->transcountry('ProfId'.$i, $object->country_id)." ".$langs->trans("ErrorProdIdAlreadyExist", $_POST[$slabel]);
  154. $action = ($action=='add'?'create':'edit');
  155. }
  156. }
  157. } */
  158. }
  159. if (!$error) {
  160. if ($action == 'add') {
  161. if (!empty($conf->global->MAIN_FIRST_TO_UPPER))
  162. $object->name = ucwords($object->name);
  163. dol_syslog(get_class($object) . "::create " . $object->name);
  164. // Check parameters
  165. if (!empty($conf->global->SOCIETE_MAIL_REQUIRED) && !isValidEMail($object->EMail)) {
  166. $langs->load("errors");
  167. $message = $langs->trans("ErrorBadEMail", $object->EMail);
  168. return -1;
  169. }
  170. $object->tms = dol_now();
  171. // For automatic creation during create action (not used by Dolibarr GUI, can be used by scripts)
  172. if ($object->CustomCode == -1)
  173. $compta->setCode("CustomerCode", $object->get_codeclient($object->prefix_comm, 0));
  174. if ($object->SupplierCode == -1)
  175. $compta->setCode("SupplierCode", $object->get_codefournisseur($object->prefix_comm, 1));
  176. if (!$message) {
  177. try {
  178. $object->record();
  179. Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
  180. exit;
  181. } catch (Exception $e) {
  182. $message = "Something weird happened: " . $e->getMessage() . " (errcode=" . $e->getCode() . ")\n";
  183. dol_syslog("Ego::Create " . $message, LOG_ERR);
  184. }
  185. }
  186. $message = '<div class="error">' . $message . '</div>';
  187. $action = "create";
  188. $result = 0; // TODO go next
  189. if ($result >= 0) {
  190. if ($object->particulier) {
  191. dol_syslog("This thirdparty is a personal people", LOG_DEBUG);
  192. $contact = new Contact($db);
  193. $contact->civilite_id = $object->civilite_id;
  194. $contact->name = $object->name_bis;
  195. $contact->firstname = $object->firstname;
  196. $contact->address = $object->address;
  197. $contact->zip = $object->zip;
  198. $contact->town = $object->town;
  199. $contact->state_id = $object->state_id;
  200. $contact->country_id = $object->country_id;
  201. $contact->socid = $object->id; // fk_soc
  202. $contact->status = 1;
  203. $contact->email = $object->email;
  204. $contact->phone_pro = $object->tel;
  205. $contact->fax = $object->fax;
  206. $contact->priv = 0;
  207. $result = $contact->create($user);
  208. if (!$result >= 0) {
  209. $error = $contact->error;
  210. $errors = $contact->errors;
  211. }
  212. }
  213. // Gestion du logo de la société
  214. $dir = $conf->societe->multidir_output[$conf->entity] . "/" . $object->id . "/logos/";
  215. $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
  216. if ($file_OK) {
  217. if (image_format_supported($_FILES['photo']['name'])) {
  218. dol_mkdir($dir);
  219. if (@is_dir($dir)) {
  220. $newfile = $dir . '/' . dol_sanitizeFileName($_FILES['photo']['name']);
  221. $result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
  222. if (!$result > 0) {
  223. $errors[] = "ErrorFailedToSaveFile";
  224. } else {
  225. // Create small thumbs for company (Ratio is near 16/9)
  226. // Used on logon for example
  227. $imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
  228. // Create mini thumbs for company (Ratio is near 16/9)
  229. // Used on menu or for setup page for example
  230. $imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
  231. }
  232. }
  233. }
  234. }
  235. // Gestion du logo de la société
  236. }
  237. if ($result >= 0) {
  238. $db->commit();
  239. $url = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
  240. if (($object->client == 1 || $object->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
  241. $url = DOL_URL_ROOT . "/comm/fiche.php?socid=" . $object->id;
  242. else if ($object->fournisseur == 1)
  243. $url = DOL_URL_ROOT . "/fourn/fiche.php?socid=" . $object->id;
  244. Header("Location: " . $url);
  245. exit;
  246. }
  247. else {
  248. $db->rollback();
  249. $action = 'create';
  250. }
  251. }
  252. if ($action == 'update') {
  253. if ($_POST["cancel"]) {
  254. Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $socid);
  255. exit;
  256. }
  257. $backtopage = '';
  258. if (!empty($_POST["backtopage"]))
  259. $backtopage = $_POST["backtopage"];
  260. $oldcopy = dol_clone($object);
  261. ### Calcul des coordonnées GPS
  262. if ($conf->map->enabled) {
  263. //Retire le CEDEX de la ville :
  264. $town = $_POST["town"];
  265. $town = strtolower($town);
  266. $find = "cedex";
  267. $pos = strpos($town, $find);
  268. if ($pos != false) {
  269. $town = substr($town, 0, $pos);
  270. //print $town;exit;
  271. }
  272. $apiUrl = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" . urlencode($_POST["adresse"] . "," . $_POST["zipcode"] . "," . $_POST["town"]);
  273. $c = curl_init();
  274. curl_setopt($c, CURLOPT_URL, $apiUrl);
  275. curl_setopt($c, CURLOPT_HEADER, false);
  276. curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  277. // make the call
  278. $json = curl_exec($c);
  279. $response = json_decode($json);
  280. curl_close($c);
  281. if ($response->status == "OK") {
  282. $object->gps = array($response->results[0]->geometry->location->lat, $response->results[0]->geometry->location->lng);
  283. } else {
  284. $object->gps = array(0, 0);
  285. }
  286. }
  287. // To not set code if third party is not concerned. But if it had values, we keep them.
  288. if (empty($object->client) && empty($oldcopy->code_client))
  289. $object->code_client = '';
  290. if (empty($object->valeus->fournisseur) && empty($oldcopy->code_fournisseur))
  291. $object->code_fournisseur = '';
  292. //var_dump($object);exit;
  293. $soc = new Societe($db);
  294. // For automatic creation during create action (not used by Dolibarr GUI, can be used by scripts)
  295. if ($object->CustomCode == -1)
  296. $object->CustomCode = $soc->get_codeclient($object->prefix_comm, 0);
  297. if ($object->SupplierCode == -1)
  298. $object->SupplierCode = $soc->get_codefournisseur($object->prefix_comm, 1);
  299. //$object->update($socid,$user,1,$oldcopy->codeclient_modifiable(),$oldcopy->codefournisseur_modifiable());
  300. try {
  301. $object->record();
  302. $result = 1;
  303. } catch (Exception $e) {
  304. $error = "Something weird happened: " . $e->getMessage() . " (errcode=" . $e->getCode() . ")\n";
  305. print $error;
  306. exit;
  307. }
  308. // Gestion du logo de la société
  309. $dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->_id . "/logos";
  310. $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
  311. if ($file_OK) {
  312. if (GETPOST('deletephoto')) {
  313. $fileimg = $dir . '/' . $object->logo;
  314. $dirthumbs = $dir . '/thumbs';
  315. dol_delete_file($fileimg);
  316. dol_delete_dir_recursive($dirthumbs);
  317. }
  318. if (image_format_supported($_FILES['photo']['name']) > 0) {
  319. dol_mkdir($dir);
  320. if (@is_dir($dir)) {
  321. $newfile = $dir . '/' . dol_sanitizeFileName($_FILES['photo']['name']);
  322. $result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
  323. if (!$result > 0) {
  324. $errors[] = "ErrorFailedToSaveFile";
  325. } else {
  326. // Create small thumbs for company (Ratio is near 16/9)
  327. // Used on logon for example
  328. $imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
  329. // Create mini thumbs for company (Ratio is near 16/9)
  330. // Used on menu or for setup page for example
  331. $imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
  332. }
  333. }
  334. } else {
  335. $errors[] = "ErrorBadImageFormat";
  336. }
  337. }
  338. // Gestion du logo de la société
  339. if (!$error && !count($errors)) {
  340. ?>
  341. <script language="javascript">
  342. //code to close fancy box
  343. parent.$.fancybox.close();
  344. </script>
  345. <?php
  346. exit;
  347. } else {
  348. $action = "edit";
  349. }
  350. }
  351. }
  352. }
  353. }
  354. /*
  355. * View
  356. */
  357. llxHeader('', $langs->trans("ThirdParty"));
  358. $form = new Form($db);
  359. $formfile = new FormFile($db);
  360. $formadmin = new FormAdmin($db);
  361. $formcompany = new FormCompany($db);
  362. $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
  363. if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
  364. // -----------------------------------------
  365. // When used with CANVAS
  366. // -----------------------------------------
  367. if (!$objcanvas->hasActions() && $socid) {
  368. $object->load($socid); // For use with "pure canvas" (canvas that contains templates only)
  369. }
  370. $objcanvas->assign_values($action, $socid); // Set value for templates
  371. $objcanvas->display_canvas($action); // Show template
  372. } else {
  373. // -----------------------------------------
  374. // When used in standard mode
  375. // -----------------------------------------
  376. if ($action == 'create') {
  377. /*
  378. * Creation
  379. */
  380. // Load object modCodeTiers
  381. $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
  382. if (!$module)
  383. dolibarr_error('', $langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
  384. if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
  385. $module = substr($module, 0, dol_strlen($module) - 4);
  386. }
  387. $dirsociete = array_merge(array('/societe/core/models/'), $conf->societe_modules);
  388. foreach ($dirsociete as $dirroot) {
  389. $res = dol_include_once($dirroot . $module . ".php");
  390. if ($res)
  391. break;
  392. }
  393. $modCodeClient = new $module;
  394. $module = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
  395. if (!$module)
  396. $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
  397. if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
  398. $module = substr($module, 0, dol_strlen($module) - 4);
  399. }
  400. $dirsociete = array_merge(array('/societe/core/models/'), $conf->societe_modules);
  401. foreach ($dirsociete as $dirroot) {
  402. $res = dol_include_once($dirroot . $module . ".php");
  403. if ($res)
  404. break;
  405. }
  406. $modCodeFournisseur = new $module;
  407. //if ($_GET["type"]=='cp') { $object->client=3; }
  408. if (GETPOST("type") != 'f') {
  409. $object->client = 3;
  410. }
  411. if (GETPOST("type") == 'c') {
  412. $object->client = 1;
  413. }
  414. if (GETPOST("type") == 'p') {
  415. $object->client = 2;
  416. }
  417. if ($conf->fournisseur->enabled && (GETPOST("type") == 'f' || GETPOST("type") == '')) {
  418. $object->fournisseur = 1;
  419. }
  420. if (GETPOST("private") == 1) {
  421. $object->particulier = 1;
  422. }
  423. $object->name = $_POST["nom"];
  424. $object->firstname = $_POST["prenom"];
  425. $object->particulier = GETPOST('private', 'int');
  426. $object->prefix_comm = $_POST["prefix_comm"];
  427. $object->client = $_POST["client"] ? $_POST["client"] : $object->client;
  428. $object->code_client = $_POST["code_client"];
  429. $object->fournisseur = $_POST["fournisseur"] ? $_POST["fournisseur"] : $object->fournisseur;
  430. $object->code_fournisseur = $_POST["code_fournisseur"];
  431. $object->address = $_POST["adresse"];
  432. $object->zip = $_POST["zipcode"];
  433. $object->town = $_POST["town"];
  434. $object->state_id = $_POST["departement_id"];
  435. $object->tel = $_POST["tel"];
  436. $object->fax = $_POST["fax"];
  437. $object->email = $_POST["email"];
  438. $object->url = $_POST["url"];
  439. $object->capital = $_POST["capital"];
  440. $object->barcode = $_POST["barcode"];
  441. $object->idprof1 = $_POST["idprof1"];
  442. $object->idprof2 = $_POST["idprof2"];
  443. $object->idprof3 = $_POST["idprof3"];
  444. $object->idprof4 = $_POST["idprof4"];
  445. $object->typent_id = $_POST["typent_id"];
  446. $object->effectif_id = $_POST["effectif_id"];
  447. $object->civility_id = $_POST["civilite_id"];
  448. $object->tva_assuj = $_POST["assujtva_value"];
  449. $object->status = $_POST["status"];
  450. //Local Taxes
  451. $object->localtax1_assuj = $_POST["localtax1assuj_value"];
  452. $object->localtax2_assuj = $_POST["localtax2assuj_value"];
  453. $object->tva_intra = $_POST["tva_intra"];
  454. $object->commercial_id = $_POST["commercial_id"];
  455. $object->default_lang = $_POST["default_lang"];
  456. $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
  457. // Gestion du logo de la société
  458. $dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id . "/logos";
  459. $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
  460. if ($file_OK) {
  461. if (image_format_supported($_FILES['photo']['name'])) {
  462. dol_mkdir($dir);
  463. if (@is_dir($dir)) {
  464. $newfile = $dir . '/' . dol_sanitizeFileName($_FILES['photo']['name']);
  465. $result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1);
  466. if (!$result > 0) {
  467. $errors[] = "ErrorFailedToSaveFile";
  468. } else {
  469. // Create small thumbs for company (Ratio is near 16/9)
  470. // Used on logon for example
  471. $imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
  472. // Create mini thumbs for company (Ratio is near 16/9)
  473. // Used on menu or for setup page for example
  474. $imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
  475. }
  476. }
  477. }
  478. }
  479. // We set country_id, country_id and country for the selected country
  480. $object->country_id = $_POST["country_id"] ? $_POST["country_id"] : $mysoc->country_id;
  481. if ($object->country_id) {
  482. $tmparray = getCountry($object->country_id, 'all');
  483. $object->country_id = $tmparray['code'];
  484. $object->country = $tmparray['label'];
  485. }
  486. $object->forme_juridique_code = $_POST['forme_juridique_code'];
  487. /* Show create form */
  488. print_fiche_titre($langs->trans("NewCompany"));
  489. if ($conf->use_javascript_ajax) {
  490. print "\n" . '<script type="text/javascript">';
  491. print '$(document).ready(function () {
  492. id_te_private=8;
  493. id_ef15=1;
  494. is_private=' . (GETPOST("private") ? GETPOST("private") : 0) . ';
  495. if (is_private) {
  496. $(".individualline").show();
  497. } else {
  498. $(".individualline").hide();
  499. }
  500. $("#radiocompany").click(function() {
  501. $(".individualline").hide();
  502. $("#typent_id").val(0);
  503. $("#effectif_id").val(0);
  504. $("#TypeName").html(document.formsoc.ThirdPartyName.value);
  505. document.formsoc.private.value=0;
  506. });
  507. $("#radioprivate").click(function() {
  508. $(".individualline").show();
  509. $("#typent_id").val(id_te_private);
  510. $("#effectif_id").val(id_ef15);
  511. $("#TypeName").html(document.formsoc.LastName.value);
  512. document.formsoc.private.value=1;
  513. });
  514. $("#selectcountry_id").change(function() {
  515. document.formsoc.action.value="create";
  516. document.formsoc.submit();
  517. });
  518. });';
  519. print '</script>' . "\n";
  520. print "<br>\n";
  521. print $langs->trans("ThirdPartyType") . ': &nbsp; ';
  522. print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"' . (!GETPOST("private") ? ' checked="checked"' : '');
  523. print '> ' . $langs->trans("Company/Fundation");
  524. print ' &nbsp; &nbsp; ';
  525. print '<input type="radio" id="radioprivate" class="flat" name="private" value="1"' . (!GETPOST("private") ? '' : ' checked="checked"');
  526. print '> ' . $langs->trans("Individual");
  527. print ' (' . $langs->trans("ToCreateContactWithSameName") . ')';
  528. print "<br>\n";
  529. print "<br>\n";
  530. }
  531. dol_htmloutput_errors($error, $errors);
  532. print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">';
  533. print '<input type="hidden" name="action" value="add">';
  534. print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
  535. print '<input type="hidden" name="private" value=' . $object->particulier . '>';
  536. print '<input type="hidden" name="type" value=' . GETPOST("type") . '>';
  537. print '<input type="hidden" name="LastName" value="' . $langs->trans('LastName') . '">';
  538. print '<input type="hidden" name="ThirdPartyName" value="' . $langs->trans('ThirdPartyName') . '">';
  539. if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto)
  540. print '<input type="hidden" name="code_auto" value="1">';
  541. print '<table class="border" width="100%">';
  542. // Name, firstname
  543. if ($object->particulier || GETPOST("private")) {
  544. print '<tr><td><span id="TypeName" class="fieldrequired">' . $langs->trans('LastName') . '</span></td><td' . (empty($conf->global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '') . '><input type="text" size="30" maxlength="60" name="nom" value="' . $object->name . '"></td>';
  545. if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
  546. print '<td>' . $langs->trans('Prefix') . '</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="' . $object->prefix_comm . '"></td>';
  547. }
  548. print '</tr>';
  549. } else {
  550. print '<tr><td><span span id="TypeName" class="fieldrequired">' . $langs->trans('ThirdPartyName') . '</span></td><td' . (empty($conf->global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '') . '><input type="text" size="30" maxlength="60" name="nom" value="' . $object->name . '"></td>';
  551. if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
  552. print '<td>' . $langs->trans('Prefix') . '</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="' . $object->prefix_comm . '"></td>';
  553. }
  554. print '</tr>';
  555. }
  556. // If javascript on, we show option individual
  557. if ($conf->use_javascript_ajax) {
  558. print '<tr class="individualline"><td>' . $langs->trans('FirstName') . '</td><td><input type="text" size="30" name="prenom" value="' . $object->firstname . '"></td>';
  559. print '<td colspan=2>&nbsp;</td></tr>';
  560. print '<tr class="individualline"><td>' . $langs->trans("UserTitle") . '</td><td>';
  561. print $formcompany->select_civility($object->civility_id) . '</td>';
  562. print '<td colspan=2>&nbsp;</td></tr>';
  563. }
  564. // Prospect/Customer
  565. print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans('ProspectCustomer') . '</span></td><td width="25%"><select class="flat" name="client">';
  566. $selected = isset($_POST['client']) ? GETPOST('client') : $object->client;
  567. if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
  568. print '<option value="2"' . ($selected == 2 ? ' selected="selected"' : '') . '>' . $langs->trans('Prospect') . '</option>';
  569. if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
  570. print '<option value="3"' . ($selected == 3 ? ' selected="selected"' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>';
  571. print '<option value="1"' . ($selected == 1 ? ' selected="selected"' : '') . '>' . $langs->trans('Customer') . '</option>';
  572. print '<option value="0"' . ($selected == 0 ? ' selected="selected"' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>';
  573. print '</select></td>';
  574. print '<td width="25%">' . $langs->trans('CustomerCode') . '</td><td width="25%">';
  575. print '<table class="nobordernopadding"><tr><td>';
  576. $tmpcode = $object->code_client;
  577. if ($modCodeClient->code_auto)
  578. $tmpcode = $modCodeClient->getNextValue($object, 0);
  579. print '<input type="text" name="code_client" size="16" value="' . $tmpcode . '" maxlength="15">';
  580. print '</td><td>';
  581. $s = $modCodeClient->getToolTip($langs, $object, 0);
  582. print $form->textwithpicto('', $s, 1);
  583. print '</td></tr></table>';
  584. print '</td></tr>';
  585. if ($conf->fournisseur->enabled && !empty($user->rights->fournisseur->lire)) {
  586. // Supplier
  587. print '<tr>';
  588. print '<td><span class="fieldrequired">' . $langs->trans('Supplier') . '</span></td><td>';
  589. print $form->selectyesno("fournisseur", (isset($_POST['fournisseur']) ? GETPOST('fournisseur') : $object->fournisseur), 1);
  590. print '</td>';
  591. print '<td>' . $langs->trans('SupplierCode') . '</td><td>';
  592. print '<table class="nobordernopadding"><tr><td>';
  593. $tmpcode = $object->code_fournisseur;
  594. if ($modCodeFournisseur->code_auto)
  595. $tmpcode = $modCodeFournisseur->getNextValue($object, 1);
  596. print '<input type="text" name="code_fournisseur" size="16" value="' . $tmpcode . '" maxlength="15">';
  597. print '</td><td>';
  598. $s = $modCodeFournisseur->getToolTip($langs, $object, 1);
  599. print $form->textwithpicto('', $s, 1);
  600. print '</td></tr></table>';
  601. print '</td></tr>';
  602. // Category
  603. /* if ($object->fournisseur)
  604. {
  605. $load = $object->LoadSupplierCateg();
  606. if ( $load == 0)
  607. {
  608. if (count($object->SupplierCategories) > 0)
  609. {
  610. print '<tr>';
  611. print '<td>'.$langs->trans('SupplierCategory').'</td><td colspan="3">';
  612. print $form->selectarray("fournisseur_categorie",$object->SupplierCategories,$_POST["fournisseur_categorie"],1);
  613. print '</td></tr>';
  614. }
  615. }
  616. } */
  617. }
  618. // Status
  619. print '<tr><td>' . $langs->trans('Status') . '</td><td colspan="3">';
  620. print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1);
  621. print '</td></tr>';
  622. // Barcode
  623. if ($conf->global->MAIN_MODULE_BARCODE) {
  624. print '<tr><td>' . $langs->trans('Gencod') . '</td><td colspan="3"><input type="text" name="barcode" value="' . $object->barcode . '">';
  625. print '</td></tr>';
  626. }
  627. // Address
  628. print '<tr><td valign="top">' . $langs->trans('Address') . '</td><td colspan="3"><textarea name="adresse" cols="40" rows="3" wrap="soft">';
  629. print $object->address;
  630. print '</textarea></td></tr>';
  631. // Zip / Town
  632. print '<tr><td>' . $langs->trans('Zip') . '</td><td>';
  633. print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'departement_id'), 6);
  634. print '</td><td>' . $langs->trans('Town') . '</td><td>';
  635. print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'departement_id'));
  636. print '</td></tr>';
  637. // Country
  638. print '<tr><td width="25%">' . $langs->trans('Country') . '</td><td colspan="3">';
  639. print $form->select_country($object->country_id, 'country_id');
  640. if ($user->admin)
  641. print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"), 1);
  642. print '</td></tr>';
  643. // State
  644. if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
  645. print '<tr><td>' . $langs->trans('State') . '</td><td colspan="3">';
  646. if ($object->country_id)
  647. print $formcompany->select_state($object->state_id, $object->country_id, 'departement_id');
  648. else
  649. print $countrynotdefined;
  650. print '</td></tr>';
  651. }
  652. // Phone / Fax
  653. print '<tr><td>' . $langs->trans('Phone') . '</td><td><input type="text" name="tel" value="' . $object->tel . '"></td>';
  654. print '<td>' . $langs->trans('Fax') . '</td><td><input type="text" name="fax" value="' . $object->fax . '"></td></tr>';
  655. print '<tr><td>' . $langs->trans('EMail') . ($conf->global->SOCIETE_MAIL_REQUIRED ? '*' : '') . '</td><td><input type="text" name="email" size="32" value="' . $object->email . '"></td>';
  656. print '<td>' . $langs->trans('Web') . '</td><td><input type="text" name="url" size="32" value="' . $object->url . '"></td></tr>';
  657. // Prof ids
  658. $i = 1;
  659. $j = 0;
  660. while ($i <= 6) {
  661. $idprof = $langs->transcountry('ProfId' . $i, $object->country_id);
  662. if ($idprof != '-') {
  663. if (($j % 2) == 0)
  664. print '<tr>';
  665. print '<td>' . $idprof . '</td><td>';
  666. $key = 'idprof' . $i;
  667. print $formcompany->get_input_id_prof($i, 'idprof' . $i, $object->$key, $object->country_id);
  668. print '</td>';
  669. if (($j % 2) == 1)
  670. print '</tr>';
  671. $j++;
  672. }
  673. $i++;
  674. }
  675. if ($j % 2 == 1)
  676. print '<td colspan="2"></td></tr>';
  677. // Assujeti TVA
  678. $form = new Form($db);
  679. print '<tr><td>' . $langs->trans('VATIsUsed') . '</td>';
  680. print '<td>';
  681. print $form->selectyesno('assujtva_value', 1, 1); // Assujeti par defaut en creation
  682. print '</td>';
  683. print '<td nowrap="nowrap">' . $langs->trans('VATIntra') . '</td>';
  684. print '<td nowrap="nowrap">';
  685. $s = '<input type="text" class="flat" name="tva_intra" size="12" maxlength="20" value="' . $object->tva_intra . '">';
  686. if (empty($conf->global->MAIN_DISABLEVATCHECK)) {
  687. $s.=' ';
  688. if ($conf->use_javascript_ajax) {
  689. print "\n";
  690. print '<script language="JavaScript" type="text/javascript">';
  691. print "function CheckVAT(a) {\n";
  692. print "newpopup('" . DOL_URL_ROOT . "/societe/checkvat/checkVatPopup.php?vatNumber='+a,'" . dol_escape_js($langs->trans("VATIntraCheckableOnEUSite")) . "',500,230);\n";
  693. print "}\n";
  694. print '</script>';
  695. print "\n";
  696. $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">' . $langs->trans("VATIntraCheck") . '</a>';
  697. $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1);
  698. } else {
  699. $s.='<a href="' . $langs->transcountry("VATIntraCheckURL", $object->id_pays) . '" target="_blank">' . img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help') . '</a>';
  700. }
  701. }
  702. print $s;
  703. print '</td>';
  704. print '</tr>';
  705. // Type - Size
  706. print '<tr><td>' . $langs->trans("ThirdPartyType") . '</td><td>' . "\n";
  707. print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id);
  708. if ($user->admin)
  709. print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"), 1);
  710. print '</td>';
  711. print '<td>' . $langs->trans("Staff") . '</td><td>';
  712. print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id);
  713. if ($user->admin)
  714. print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"), 1);
  715. print '</td></tr>';
  716. // Legal Form
  717. print '<tr><td>' . $langs->trans('JuridicalStatus') . '</td>';
  718. print '<td colspan="3">';
  719. if ($object->country_id) {
  720. $formcompany->select_forme_juridique($object->forme_juridique_code, $object->country_id);
  721. } else {
  722. print $countrynotdefined;
  723. }
  724. print '</td></tr>';
  725. // Capital
  726. print '<tr><td>' . $langs->trans('Capital') . '</td><td colspan="3"><input type="text" name="capital" size="10" value="' . $object->capital . '"> ' . $langs->trans("Currency" . $conf->currency) . '</td></tr>';
  727. // Local Taxes
  728. // TODO add specific function by country
  729. if ($mysoc->country_id == 'ES') {
  730. if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
  731. print '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td>';
  732. print $form->selectyesno('localtax1assuj_value', 0, 1);
  733. print '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>';
  734. print $form->selectyesno('localtax2assuj_value', 0, 1);
  735. print '</td></tr>';
  736. } elseif ($mysoc->localtax1_assuj == "1") {
  737. print '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">';
  738. print $form->selectyesno('localtax1assuj_value', 0, 1);
  739. print '</td><tr>';
  740. } elseif ($mysoc->localtax2_assuj == "1") {
  741. print '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">';
  742. print $form->selectyesno('localtax2assuj_value', 0, 1);
  743. print '</td><tr>';
  744. }
  745. }
  746. if ($conf->global->MAIN_MULTILANGS) {
  747. print '<tr><td>' . $langs->trans("DefaultLang") . '</td><td colspan="3">' . "\n";
  748. print $formadmin->select_language(($object->default_lang ? $object->default_lang : $conf->global->MAIN_LANG_DEFAULT), 'default_lang', 0, 0, 1);
  749. print '</td>';
  750. print '</tr>';
  751. }
  752. if ($user->rights->societe->client->voir) {
  753. // Assign a Name
  754. print '<tr>';
  755. print '<td>' . $langs->trans("AllocateCommercial") . '</td>';
  756. print '<td colspan="3">';
  757. $form->select_users($object->commercial_id, 'commercial_id', 1);
  758. print '</td></tr>';
  759. }
  760. // Ajout du logo
  761. print '<tr>';
  762. print '<td>' . $langs->trans("Logo") . '</td>';
  763. print '<td colspan="3">';
  764. print '<input class="flat" type="file" name="photo" id="photoinput" />';
  765. print '</td>';
  766. print '</tr>';
  767. print '</table>' . "\n";
  768. print '<br><center>';
  769. print '<input type="submit" class="button" value="' . $langs->trans('AddThirdParty') . '">';
  770. print '</center>' . "\n";
  771. print '</form>' . "\n";
  772. } else {
  773. /*
  774. * Edition
  775. */
  776. try {
  777. $object->load($socid);
  778. } catch (Exception $e) {
  779. $error = "Something weird happened: " . $e->getMessage() . " (errcode=" . $e->getCode() . ")\n";
  780. print $error;
  781. exit;
  782. }
  783. // Load object modCodeTiers
  784. $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
  785. if (!$module)
  786. dolibarr_error('', $langs->trans("ErrorModuleThirdPartyCodeInCompanyModuleNotDefined"));
  787. if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
  788. $module = substr($module, 0, dol_strlen($module) - 4);
  789. }
  790. $dirsociete = array_merge(array('/societe/core/models/'), $conf->societe_modules);
  791. foreach ($dirsociete as $dirroot) {
  792. $res = dol_include_once($dirroot . $module . ".php");
  793. if ($res)
  794. break;
  795. }
  796. $modCodeClient = new $module;
  797. $module = $conf->global->SOCIETE_CODEFOURNISSEUR_ADDON;
  798. if (!$module)
  799. $module = $conf->global->SOCIETE_CODECLIENT_ADDON;
  800. if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') {
  801. $module = substr($module, 0, dol_strlen($module) - 4);
  802. }
  803. $dirsociete = array_merge(array('/societe/core/models/'), $conf->societe_modules);
  804. foreach ($dirsociete as $dirroot) {
  805. $res = dol_include_once($dirroot . $module . ".php");
  806. if ($res)
  807. break;
  808. }
  809. $modCodeFournisseur = new $module;
  810. if (!empty($_POST["ThirdPartyName"])) {
  811. // We overwrite with values if posted
  812. $object->ThirdPartyName = $_POST["ThirdPartyName"];
  813. $object->prefix_comm = $_POST["prefix_comm"];
  814. $object->client = $_POST["client"];
  815. $object->code_client = $_POST["code_client"];
  816. $object->fournisseur = $_POST["fournisseur"];
  817. $object->code_fournisseur = $_POST["code_fournisseur"];
  818. $object->address = $_POST["adresse"];
  819. $object->zip = $_POST["zipcode"];
  820. $object->town = $_POST["town"];
  821. $object->country_id = $_POST["country_id"] ? $_POST["country_id"] : $mysoc->country_id;
  822. $object->Country = $_POST["Country"] ? $_POST["Country"] : $mysoc->country_code;
  823. $object->state_id = $_POST["departement_id"];
  824. $object->tel = $_POST["tel"];
  825. $object->fax = $_POST["fax"];
  826. $object->email = $_POST["email"];
  827. $object->url = $_POST["url"];
  828. $object->capital = $_POST["capital"];
  829. $object->idprof1 = $_POST["idprof1"];
  830. $object->idprof2 = $_POST["idprof2"];
  831. $object->idprof3 = $_POST["idprof3"];
  832. $object->idprof4 = $_POST["idprof4"];
  833. $object->typent_id = $_POST["typent_id"];
  834. $object->effectif_id = $_POST["effectif_id"];
  835. $object->barcode = $_POST["barcode"];
  836. $object->forme_juridique_code = $_POST["forme_juridique_code"];
  837. $object->default_lang = $_POST["default_lang"];
  838. $object->tva_assuj = $_POST["assujtva_value"];
  839. $object->tva_intra = $_POST["tva_intra"];
  840. $object->status = $_POST["status"];
  841. //Local Taxes
  842. $object->localtax1_assuj = $_POST["localtax1assuj_value"];
  843. $object->localtax2_assuj = $_POST["localtax2assuj_value"];
  844. // We set country_id, and pays_code label of the chosen country
  845. // TODO move to DAO class
  846. if ($object->Country) {
  847. $sql = "SELECT code, libelle from " . MAIN_DB_PREFIX . "c_pays where code = '" . $object->Country . "'";
  848. $resql = $db->query($sql);
  849. if ($resql) {
  850. $obj = $db->fetch_object($resql);
  851. } else {
  852. dol_print_error($db);
  853. }
  854. $object->countryname = $langs->trans("Country" . $object->Country);
  855. }
  856. }
  857. dol_htmloutput_errors($error, $errors);
  858. ?>
  859. <!-- BEGIN PHP TEMPLATE thirdparty update card -->
  860. <script type="text/javascript">
  861. $(document).ready(function () {
  862. $("#selectCountry").change(function() {
  863. document.formsoc.action.value="edit";
  864. document.formsoc.submit();
  865. });
  866. })
  867. </script>
  868. <form id="validate_wizard" class="stepy-wizzard nice" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"] . '?id=' . $object->id; ?>" method="POST" name="formsoc">
  869. <input type="hidden" name="action" value="update">
  870. <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
  871. <input type="hidden" name="id" value="<?php echo $object->id; ?>">
  872. <?php if ($auto_customer_code->auto || $auto_supplier_code->auto): ?>
  873. <input type="hidden" name="code_auto" value="1">
  874. <?php endif; ?>
  875. <?php for ($i = 0; $i < count($object->fk_extrafields->place); $i++): ?>
  876. <fieldset title="<?php echo $langs->trans($object->fk_extrafields->block[$i]); ?>">
  877. <legend><?php echo $langs->trans($object->fk_extrafields->block[$i] . "Resume"); ?></legend>
  878. <div class="row">
  879. <div class="two columns">
  880. <div class="form_legend">
  881. <h4><?php echo $langs->trans($object->fk_extrafields->block[$i]); ?></h4>
  882. <p><?php echo $langs->trans($object->fk_extrafields->block[$i] . "Legend"); ?></p>
  883. </div>
  884. </div>
  885. <div class="ten columns">
  886. <div class="form_content"><!-- forms columns -->
  887. <div class="eight columns"><!-- center form -->
  888. <?php
  889. foreach ($object->fk_extrafields->place[$i][0] as $key) {
  890. $aRow = $object->fk_extrafields->fields->$key;
  891. print $object->form($aRow, $key, "large");
  892. }
  893. ?> </div><!-- end center form -->
  894. <div class="four columns"><!-- right form -->
  895. <?php
  896. foreach ($object->fk_extrafields->place[$i][1] as $key) {
  897. $aRow = $object->fk_extrafields->fields->$key;
  898. print $object->form($aRow, $key, "small");
  899. }
  900. ?>
  901. </div><!-- end right form -->
  902. </div><!-- end forms columns -->
  903. </div><!-- end ten columns -->
  904. </div><!-- end row -->
  905. </fieldset>
  906. <?php endfor; ?>
  907. <button type="submit" class="finish gh_button icon approve primary"><?php echo $langs->trans("Save"); ?></button>
  908. <script>
  909. $(document).ready(function() {
  910. $('#validate_wizard').stepy({
  911. backLabel : 'Previous',
  912. block : true,
  913. errorImage : true,
  914. nextLabel : 'Next',
  915. titleClick : true,
  916. validate : true
  917. });
  918. $('#validate_wizard').validate({
  919. errorPlacement: function(error, element) {
  920. error.appendTo( element.closest("div.elVal") );
  921. }, highlight: function(element) {
  922. $(element).closest('div.elVal').addClass("form-field error");
  923. }, unhighlight: function(element) {
  924. $(element).closest('div.elVal').removeClass("form-field error");
  925. }, rules: {
  926. <?php foreach ($object->fk_extrafields->fields as $key => $aRow) : ?>
  927. <?php if (isset($aRow->validate)) : ?>
  928. <?php echo "'" . $key . "'"; ?> : {
  929. <?php foreach ($aRow->validate as $idx => $row) : ?>
  930. <?php echo $idx . " : " . $row; ?>,
  931. <?php endforeach; ?>
  932. },
  933. <?php endif; ?>
  934. <?php endforeach; ?>
  935. },
  936. ignore: ':hidden'
  937. });
  938. <?php foreach ($object->fk_extrafields->fields as $key => $aRow) : ?>
  939. <?php if (isset($aRow->mask)) : ?>
  940. $("#<?php echo $key; ?>").inputmask("<?php echo $aRow->mask; ?>");
  941. <?php endif; ?>
  942. <?php if (isset($aRow->spinner)) : ?>
  943. $("#<?php echo $key; ?>").spin

Large files files are truncated, but you can click here to view the full file