/** Possible actions for a caller: delete */ function percentile_actions($percentile_id) { $CI =& get_instance(); $edit_link = anchor('percentile/edit/' . $percentile_id, img_edit()); $delete_link = anchor('percentile/delete/' . $percentile_id, img_delete(), warning(lang('sure_delete_percentile'))); return implode(' ', array($edit_link, $delete_link)); }
/** Possible actions for a testsurvey: edit, view scores, delete */ function testsurvey_actions($testsurvey_id) { $inspect_link = anchor('testsurvey/get/' . $testsurvey_id, img_zoom('testsurvey')); $find_link = anchor('testsurvey/find/' . $testsurvey_id, img_email(lang('testinvite'))); $edit_link = anchor('testsurvey/edit/' . $testsurvey_id, img_edit()); $delete_link = anchor('testsurvey/delete/' . $testsurvey_id, img_delete(), warning(lang('sure_delete_testsurvey'))); return implode(' ', array($inspect_link, $find_link, $edit_link, $delete_link)); }
/** Possible actions for a user: edit, view participants, call, archive, delete */ function user_actions($user_id) { $CI =& get_instance(); $u = $CI->userModel->get_user_by_id($user_id); $edit_link = anchor('user/edit/' . $u->id, img_edit()); $act_link = is_activated($u) ? anchor('user/deactivate/' . $u->id, img_active(TRUE)) : anchor('user/activate/' . $u->id, img_active(FALSE)); $delete_link = is_admin($u) ? img_delete(TRUE) : anchor('user/delete/' . $u->id, img_delete(), warning(lang('sure_delete_user'))); return implode(' ', array($edit_link, $act_link, $delete_link)); }
/** Possible actions for a testcat: edit, show scores and delete */ function testcat_actions($testcat_id) { $CI =& get_instance(); $scores = $CI->scoreModel->get_scores_by_testcat($testcat_id); $edit_link = anchor('testcat/edit/' . $testcat_id, img_edit()); $score_link = count($scores) > 0 ? anchor('score/testcat/' . $testcat_id, img_scores()) : img_scores(TRUE); $delete_link = anchor('testcat/delete/' . $testcat_id, img_delete(), warning(lang('sure_delete_testcat'))); return implode(' ', array($edit_link, $score_link, $delete_link)); }
/** * Output key field for an editable field * @param text Text of label * @param htmlname Name of select field * @param preselected Preselected value for parameter * @param paramkey Key of parameter (unique if there is several parameter to show) * @param paramvalue Value of parameter * @param perm Permission to allow button to edit parameter * @param typeofdata Type of data (string by default, email, ...) * @return string HTML edit field * TODO no GET or POST in class file, use a param */ function editfieldkey($text,$htmlname,$preselected,$paramkey,$paramvalue,$perm,$typeofdata='string') { global $langs; $ret=''; $ret.='<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">'; $ret.=$langs->trans($text); $ret.='</td>'; if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&'.$paramkey.'='.$paramvalue.'">'.img_edit($langs->trans('Edit'),1).'</a></td>'; $ret.='</tr></table>'; return $ret; }
/** Possible actions for a comment: prioritize and delete */ function comment_actions($comment_id) { $CI =& get_instance(); $c = $CI->commentModel->get_comment_by_id($comment_id); $p = $CI->participantModel->get_participant_by_id($c->participant_id); $prio_link = anchor('comment/prioritize/' . $comment_id . ($c->priority ? '/0' : ''), img_star(!$c->priority)); $handled_link = anchor('comment/mark_handled/' . $comment_id . ($c->handled ? '/0' : ''), img_accept(lang('mark_handled'), !$c->handled)); $edit_link = anchor('comment/edit/' . $comment_id, img_edit()); $p_link = anchor('participant/edit/' . $c->participant_id, img_edit_participant($p)); $d_link = anchor('comment/delete/' . $comment_id, img_delete(), warning(lang('sure_delete_comment'))); return implode(' ', array($prio_link, $handled_link, $edit_link, $p_link, $d_link)); }
print '</td></tr></table>'; print '</td>'; print '<td colspan="3">'; print $object->display_rib(); print '</td></tr>'; } // Parent company if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) { print '<tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>'; print $langs->trans('ParentCompany'); print '<td><td align="right">'; if ($user->rights->societe->creer) print '<a href="'.DOL_URL_ROOT.'/societe/lien.php?socid='.$object->id.'">'.img_edit() .'</a>'; else print ' '; print '</td></tr></table>'; print '</td>'; print '<td colspan="3">'; if ($object->parent) { $socm = new Societe($db); $socm->load($object->parent); print $socm->getNomUrl(1).' '.($socm->code_client?"(".$socm->code_client.")":""); print $socm->town?' - '.$socm->town:''; } else { print $langs->trans("NoParentCompany"); }
print '<td align="center">' . $langs->trans("Unique") . '</td>'; print '<td align="center">' . $langs->trans("Required") . '</td>'; print '<td width="80"> </td>'; print "</tr>\n"; $var = True; foreach ($extrafields->attribute_type as $key => $value) { $var = !$var; print "<tr " . $bc[$var] . ">"; print "<td>" . $extrafields->attribute_pos[$key] . "</td>\n"; print "<td>" . $extrafields->attribute_label[$key] . "</td>\n"; print "<td>" . $key . "</td>\n"; print "<td>" . $type2label[$extrafields->attribute_type[$key]] . "</td>\n"; print '<td align="right">' . $extrafields->attribute_size[$key] . "</td>\n"; print '<td align="center">' . yn($extrafields->attribute_unique[$key]) . "</td>\n"; print '<td align="center">' . yn($extrafields->attribute_required[$key]) . "</td>\n"; print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=edit&attrname=' . $key . '">' . img_edit() . '</a>'; print " <a href=\"" . $_SERVER["PHP_SELF"] . "?action=delete&attrname={$key}\">" . img_delete() . "</a></td>\n"; print "</tr>"; // $i++; } print "</table>"; dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { print '<div class="tabsAction">'; print "<a class=\"butAction\" href=\"" . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . "</a>"; print "</div>"; } /* ************************************************************************** */ /* */ /* Creation d'un champ optionnel
print '<td>'; if ($soc->id) { print $soc->getNomUrl(1); } print '</td></tr>'; // Project if (!empty($conf->projet->enabled)) { $langs->load('projects'); print '<tr>'; print '<td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('Project'); print '</td>'; if ($action != 'classify' && $user->rights->deplacement->creer) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=classify&id=' . $object->id . '">'; print img_edit($langs->trans('SetProject'), 1); print '</a></td>'; } print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'classify') { $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } else { $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0); } print '</td>'; print '</tr>'; } // Statut print '<tr><td>' . $langs->trans("Status") . '</td><td>' . $object->getLibStatut(4) . '</td></tr>'; // Other attributes
if ($user->rights->societe->creer) { print '<a href="' . DOL_URL_ROOT . '/comm/multiprix.php?id=' . $objsoc->id . '">' . img_edit($langs->trans("Modify")) . '</a>'; } print '</td></tr></table>'; print '</td><td colspan="3">' . $objsoc->price_level . "</td>"; print '</tr>'; } // Old way to define delivery address (deprecated). // Now all addresses types (like delivery addresses, invoices addresses,...) are saved as contacts. if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) { print '<tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print $langs->trans("DeliveriesAddress"); print '<td><td align="right">'; if ($user->rights->societe->creer) { print '<a href="' . DOL_URL_ROOT . '/comm/address.php?socid=' . $objsoc->id . '">' . img_edit($langs->trans("Modify")) . '</a>'; } print '</td></tr></table>'; print '</td><td colspan="3">'; $sql = "SELECT count(rowid) as nb"; $sql .= " FROM " . MAIN_DB_PREFIX . "societe_address"; $sql .= " WHERE fk_soc =" . $objsoc->id; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $objal = $db->fetch_object($resql); print $objal->nb ? $objal->nb : $langs->trans("NoOtherDeliveryAddress"); } else { dol_print_error($db); } print '</td>';
print '<input type="hidden" name="action" value="setdate">'; $form->select_date($object->date_bordereau, 'datecreate_', '', '', '', "setdate"); print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '</form>'; } else { print $object->date_bordereau ? dol_print_date($object->date_bordereau, 'day') : ' '; } print '</td>'; print '</tr>'; // External ref print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('RefExt'); print '</td>'; if ($action != 'editrefext') { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editrefext&id=' . $object->id . '">' . img_edit($langs->trans('SetRefExt'), 1) . '</a></td>'; } print '</tr></table>'; print '</td><td colspan="2">'; if ($action == 'editrefext') { print '<form name="setrefext" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="setrefext">'; print '<input type="text" name="ref_ext" value="' . $object->ref_ext . '">'; print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '</form>'; } else { print $object->ref_ext; } print '</td>'; print '</tr>';
else { $html->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); } print '</td></tr>'; // Project if ($conf->projet->enabled) { $langs->load("projects"); print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('Project').'</td>'; if (1 == 2 && $user->rights->propale->creer) { if ($_GET['action'] != 'classer') print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=classer&id='.$object->id.'">'.img_edit($langs->trans('SetProject')).'</a></td>'; print '</tr></table>'; print '</td><td colspan="3">'; if ($_GET['action'] == 'classer') { $html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); } else { $html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); } print '</td></tr>'; } else { print '</td></tr></table>';
} else { print '<td align="left" class="nowrap">'; if ($objp->cotisation == 'yes') { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) { print " " . img_warning(); } } else { print ' '; } print '</td>'; } // Actions print '<td align="center">'; if ($user->rights->adherent->creer) { print '<a href="card.php?rowid=' . $objp->rowid . '&action=edit&return=list.php">' . img_edit() . '</a>'; } print ' '; if ($user->rights->adherent->supprimer) { print '<a href="card.php?rowid=' . $objp->rowid . '&action=resign&return=list.php">' . img_picto($langs->trans("Resiliate"), 'disable.png') . '</a>'; } print "</td>"; print "</tr>\n"; $i++; } print "</table>\n"; if ($num > $conf->liste_limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); } } else { dol_print_error($db);
// Price quantity print '<td align="right">'; print $objp->price?price($objp->price):""; print '</td>'; // Unit price print '<td align="right">'; print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" "); print '</td>'; // Modify-Remove print '<td align="center">'; if ($user->rights->produit->creer || $user->rights->service->creer) { print '<a href="fournisseurs.php?id='.$product->id.'&socid='.$objp->socid.'&action=add_price&rowid='.$objp->rowid.'">'.img_edit()."</a>"; print '<a href="fournisseurs.php?id='.$product->id.'&socid='.$objp->socid.'&action=remove_pf&rowid='.$objp->rowid.'">'.img_picto($langs->trans("Remove"),'disable.png').'</a>'; } print '</td>'; print '</tr>'; $i++; } $db->free($resql); } else { dol_print_error($db); }
print $company->getNomUrl(1); } else { print $langs->trans("NoThirdPartyAssociatedToMember"); } } print '</td></tr>'; } // Login Dolibarr print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans("LinkedToDolibarrUser"); print '</td>'; if ($action != 'editlogin' && $user->rights->adherent->creer) { print '<td align="right">'; if ($user->rights->user->user->creer) { print '<a href="' . $_SERVER["PHP_SELF"] . '?action=editlogin&rowid=' . $object->id . '">' . img_edit($langs->trans('SetLinkToUser'), 1) . '</a>'; } print '</td>'; } print '</tr></table>'; print '</td><td colspan="2" class="valeur">'; if ($action == 'editlogin') { $form->form_users($_SERVER['PHP_SELF'] . '?rowid=' . $object->id, $object->user_id, 'userid', ''); } else { if ($object->user_id) { $form->form_users($_SERVER['PHP_SELF'] . '?rowid=' . $object->id, $object->user_id, 'none'); } else { print $langs->trans("NoDolibarrAccess"); } } print '</td></tr>';
/** * Assign custom values for canvas (for example into this->tpl to be used by templates) * * @param string $action Type of action * @param string $id Id of object * @param string $ref Ref of object * @return void */ function assign_values(&$action, $id = 0, $ref = '') { global $conf, $langs, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; if ($action == 'add' || $action == 'update') { $this->assign_post($action); } if ($_GET["type"] == 'f') { $this->object->fournisseur = 1; } if ($_GET["type"] == 'c') { $this->object->client = 1; } if ($_GET["type"] == 'p') { $this->object->client = 2; } if ($_GET["type"] == 'cp') { $this->object->client = 3; } if ($_REQUEST["private"] == 1) { $this->object->particulier = 1; } foreach ($this->object as $key => $value) { $this->tpl[$key] = $value; } $this->tpl['error'] = get_htmloutput_errors($this->object->error, $this->object->errors); if (is_array($GLOBALS['errors'])) { $this->tpl['error'] = get_htmloutput_mesg('', $GLOBALS['errors'], 'error'); } if ($action == 'create') { if ($conf->use_javascript_ajax) { $this->tpl['ajax_selecttype'] = "\n" . '<script type="text/javascript" language="javascript"> $(document).ready(function () { $("#radiocompany").click(function() { document.formsoc.action.value="create"; document.formsoc.canvas.value="company"; document.formsoc.private.value=0; document.formsoc.submit(); }); $("#radioprivate").click(function() { document.formsoc.action.value="create"; document.formsoc.canvas.value="individual"; document.formsoc.private.value=1; document.formsoc.submit(); }); }); </script>' . "\n"; } } if ($action == 'create' || $action == 'edit') { if ($conf->use_javascript_ajax) { $this->tpl['ajax_selectcountry'] = "\n" . '<script type="text/javascript" language="javascript"> $(document).ready(function () { $("#selectcountry_id").change(function() { document.formsoc.action.value="' . $action . '"; document.formsoc.canvas.value="' . $canvas . '"; document.formsoc.submit(); }); }) </script>' . "\n"; } // Load object modCodeClient $module = !empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { $res = dol_include_once($dirroot . $module . '.php'); if ($res) { break; } } $modCodeClient = new $module($db); $this->tpl['auto_customercode'] = $modCodeClient->code_auto; // We verified if the tag prefix is used if ($modCodeClient->code_auto) { $this->tpl['prefix_customercode'] = $modCodeClient->verif_prefixIsUsed(); } // TODO create a function $this->tpl['select_customertype'] = '<select class="flat" name="client">'; $this->tpl['select_customertype'] .= '<option value="2"' . ($this->object->client == 2 ? ' selected="selected"' : '') . '>' . $langs->trans('Prospect') . '</option>'; $this->tpl['select_customertype'] .= '<option value="3"' . ($this->object->client == 3 ? ' selected="selected"' : '') . '>' . $langs->trans('ProspectCustomer') . '</option>'; $this->tpl['select_customertype'] .= '<option value="1"' . ($this->object->client == 1 ? ' selected="selected"' : '') . '>' . $langs->trans('Customer') . '</option>'; $this->tpl['select_customertype'] .= '<option value="0"' . ($this->object->client == 0 ? ' selected="selected"' : '') . '>' . $langs->trans('NorProspectNorCustomer') . '</option>'; $this->tpl['select_customertype'] .= '</select>'; // Customer $this->tpl['customercode'] = $this->object->code_client; if ((!$this->object->code_client || $this->object->code_client == -1) && $modCodeClient->code_auto) { $this->tpl['customercode'] = $modCodeClient->getNextValue($this->object, 0); } $this->tpl['ismodifiable_customercode'] = $this->object->codeclient_modifiable(); $s = $modCodeClient->getToolTip($langs, $this->object, 0); $this->tpl['help_customercode'] = $form->textwithpicto('', $s, 1); if (!empty($conf->fournisseur->enabled)) { $this->tpl['supplier_enabled'] = 1; // Load object modCodeFournisseur $module = $conf->global->SOCIETE_CODECLIENT_ADDON; if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); } $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { $res = dol_include_once($dirroot . $module . '.php'); if ($res) { break; } } $modCodeFournisseur = new $module(); $this->tpl['auto_suppliercode'] = $modCodeFournisseur->code_auto; // We verified if the tag prefix is used if ($modCodeFournisseur->code_auto) { $this->tpl['prefix_suppliercode'] = $modCodeFournisseur->verif_prefixIsUsed(); } // Supplier $this->tpl['yn_supplier'] = $form->selectyesno("fournisseur", $this->object->fournisseur, 1); $this->tpl['suppliercode'] = $this->object->code_fournisseur; if ((!$this->object->code_fournisseur || $this->object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { $this->tpl['suppliercode'] = $modCodeFournisseur->getNextValue($this->object, 1); } $this->tpl['ismodifiable_suppliercode'] = $this->object->codefournisseur_modifiable(); $s = $modCodeFournisseur->getToolTip($langs, $this->object, 1); $this->tpl['help_suppliercode'] = $form->textwithpicto('', $s, 1); $this->object->LoadSupplierCateg(); $this->tpl['suppliercategory'] = $this->object->SupplierCategories; } // Zip $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); // Town $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); // Country $this->object->country_id = $this->object->country_id ? $this->object->country_id : $mysoc->country_id; $this->object->country_code = $this->object->country_code ? $this->object->country_code : $mysoc->country_code; $this->tpl['select_country'] = $form->select_country($this->object->country_id, 'country_id'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')'; if ($user->admin) { $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } // State if ($this->object->country_id) { $this->tpl['select_state'] = $formcompany->select_state($this->object->state_id, $this->object->country_code); } else { $this->tpl['select_state'] = $countrynotdefined; } // Language if (!empty($conf->global->MAIN_MULTILANGS)) { $this->tpl['select_lang'] = $formadmin->select_language($this->object->default_lang ? $this->object->default_lang : $conf->global->MAIN_LANG_DEFAULT, 'default_lang', 0, 0, 1); } // VAT $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value', $this->tpl['tva_assuj'], 1); // Assujeti par defaut en creation // Select users $this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1); // Local Tax // TODO mettre dans une classe propre au pays if ($mysoc->country_code == 'ES') { $this->tpl['localtax'] = ''; if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td>'; $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td>'; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td></tr>'; } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td><td colspan="3">'; $this->tpl['localtax'] .= $form->selectyesno('localtax1assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><tr>'; } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td><td colspan="3">'; $this->tpl['localtax'] .= $form->selectyesno('localtax2assuj_value', $this->object->localtax1_assuj, 1); $this->tpl['localtax'] .= '</td><tr>'; } } } else { $head = societe_prepare_head($this->object); $this->tpl['showhead'] = dol_get_fiche_head($head, 'card', '', 0, 'company'); $this->tpl['showend'] = dol_get_fiche_end(); $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom'); $this->tpl['checkcustomercode'] = $this->object->check_codeclient(); $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur(); $this->tpl['address'] = dol_nl2br($this->object->address); $img = picto_from_langcode($this->object->country_code); if ($this->object->isInEEC()) { $this->tpl['country'] = $form->textwithpicto(($img ? $img . ' ' : '') . $this->object->country, $langs->trans("CountryIsInEEC"), 1, 0); } $this->tpl['country'] = ($img ? $img . ' ' : '') . $this->object->country; $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX'); $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 'AC_EMAIL'); $this->tpl['url'] = dol_print_url($this->object->url); $this->tpl['tva_assuj'] = yn($this->object->tva_assuj); // Third party type $arr = $formcompany->typent_array(1); $this->tpl['typent'] = $arr[$this->object->typent_code]; if (!empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; //$s=picto_from_langcode($this->default_lang); //print ($s?$s.' ':''); $langs->load("languages"); $this->tpl['default_lang'] = $this->default_lang ? $langs->trans('Language_' . $this->object->default_lang) : ''; } $this->tpl['image_edit'] = img_edit(); $this->tpl['display_rib'] = $this->object->display_rib(); // Sales representatives $this->tpl['sales_representatives'] = ''; $listsalesrepresentatives = $this->object->getSalesRepresentatives($user); $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 3) { $this->tpl['sales_representatives'] .= '<a href="' . DOL_URL_ROOT . '/societe/commerciaux.php?socid=' . $this->object->id . '">'; $this->tpl['sales_representatives'] .= $nbofsalesrepresentative; $this->tpl['sales_representatives'] .= '</a>'; } else { if ($nbofsalesrepresentative > 0) { $userstatic = new User($this->db); $i = 0; foreach ($listsalesrepresentatives as $val) { $userstatic->id = $val['id']; $userstatic->lastname = $val['name']; $userstatic->firstname = $val['firstname']; $this->tpl['sales_representatives'] .= $userstatic->getNomUrl(1); $i++; if ($i < $nbofsalesrepresentative) { $this->tpl['sales_representatives'] .= ', '; } } } else { $this->tpl['sales_representatives'] .= $langs->trans("NoSalesRepresentativeAffected"); } } // Linked member if (!empty($conf->adherent->enabled)) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); if ($result > 0) { $adh->ref = $adh->getFullName($langs); $this->tpl['linked_member'] = $adh->getNomUrl(1); } else { $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } // Local Tax // TODO mettre dans une classe propre au pays if ($mysoc->country_code == 'ES') { $this->tpl['localtax'] = ''; if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax1_assuj) . '</td>'; $this->tpl['localtax'] .= '<td>' . $langs->trans("LocalTax2IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td>' . yn($this->object->localtax2_assuj) . '</td></tr>'; } elseif ($mysoc->localtax1_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax1IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax1_assuj) . '</td></tr>'; } elseif ($mysoc->localtax2_assuj == "1") { $this->tpl['localtax'] .= '<tr><td>' . $langs->trans("LocalTax2IsUsedES") . '</td>'; $this->tpl['localtax'] .= '<td colspan="3">' . yn($this->object->localtax2_assuj) . '</td></tr>'; } } } }
print '<tr ' . $bc[$var] . '>'; print '<td colspan="2" align="center">' . $lit->nbRes . ' ' . $langs->trans("TranslationsFound") . '</td>'; print '</tr>'; } print '</table>'; print '</form>'; if (!empty($lit->searchRes)) { print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td>' . $langs->trans("File") . '</td>' . "\n"; print '<td>' . $langs->trans("TranslationKey") . '</td>' . "\n"; print '<td>' . $langs->trans("OfficialTranslation") . '</td>' . "\n"; print '<td>' . $langs->trans("CustomizedTranslation") . '</td>' . "\n"; print '<td width="40"> </td>' . "\n"; print '</tr>'; $btedit = '<a class="edittrans">' . img_edit() . '</a>'; $btreset = '<a class="resettrans">' . img_picto($langs->trans('ResetToOfficialTranslation'), 'disable.png') . '</a>'; $pattern = '/' . $word . '/'; if (!empty($other_options['case_insensitive'])) { $pattern .= 'i'; } $replace = '<span class="highlight">$0</span>'; foreach ($lit->searchRes as $langfile => $trads) { foreach ($trads as $key => $val) { // Textarea pour personnaliser la traduction $input = '<div class="formcustomtrans"><form method="POST">'; $input .= '<input type="hidden" name="action" value="save_translation" />'; $input .= '<input type="hidden" name="langtosearch" value="' . $langtosearch . '" />'; $input .= '<input type="hidden" name="word" value="' . $word . '" />'; $input .= '<input type="hidden" name="langfile" value="' . $langfile . '" />'; $input .= '<input type="hidden" name="key" value="' . $key . '" />';
$sql .= " FROM " . MAIN_DB_PREFIX . "menu as m"; $sql .= " WHERE menu_handler = '" . $menu_handler_to_search . "'"; $sql .= " AND entity = " . $conf->entity; $sql .= " AND fk_menu >= 0"; $sql .= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same) $res = $db->query($sql); if ($res) { $num = $db->num_rows($res); $i = 1; while ($menu = $db->fetch_array($res)) { if (!empty($menu['langs'])) { $langs->load($menu['langs']); } $titre = $langs->trans($menu['titre']); $data[] = array('rowid' => $menu['rowid'], 'fk_menu' => $menu['fk_menu'], 'title' => $titre, 'mainmenu' => $menu['mainmenu'], 'leftmenu' => $menu['leftmenu'], 'fk_mainmenu' => $menu['fk_mainmenu'], 'fk_leftmenu' => $menu['fk_leftmenu'], 'entry' => '<table class="nobordernopadding centpercent"><tr><td>' . '<strong> <a href="edit.php?menu_handler=' . $menu_handler_to_search . '&action=edit&menuId=' . $menu['rowid'] . '">' . $titre . '</a></strong>' . '</td><td align="right">' . '<a href="edit.php?menu_handler=' . $menu_handler_to_search . '&action=edit&menuId=' . $menu['rowid'] . '">' . img_edit('default', 0, 'class="menuEdit" id="edit' . $menu['rowid'] . '"') . '</a> ' . '<a href="edit.php?menu_handler=' . $menu_handler_to_search . '&action=create&menuId=' . $menu['rowid'] . '">' . img_edit_add('default') . '</a> ' . '<a href="index.php?menu_handler=' . $menu_handler_to_search . '&action=delete&menuId=' . $menu['rowid'] . '">' . img_delete('default') . '</a> ' . ' ' . '<a href="index.php?menu_handler=' . $menu_handler_to_search . '&action=up&menuId=' . $menu['rowid'] . '">' . img_picto("Monter", "1uparrow") . '</a><a href="index.php?menu_handler=' . $menu_handler_to_search . '&action=down&menuId=' . $menu['rowid'] . '">' . img_picto("Descendre", "1downarrow") . '</a>' . '</td></tr></table>'); $i++; } } // Appelle de la fonction recursive (ammorce) // avec recherche depuis la racine. //var_dump($data); tree_recur($data, $data[0], 0); print '</td>'; print '</tr>'; print '</table>'; print '</div>'; /* * Boutons actions */ print '<div class="tabsAction">';
/** * Show array with linked files * * @param Object $object Object * @param int $permtodelete Deletion is allowed * @param string $action Action * @param string $selected ??? * @param string $param More param to add into URL * @return int Number of links */ public function listOfLinks($object, $permtodelete = 1, $action = null, $selected = null, $param = '') { global $user, $conf, $langs, $user; global $bc; global $sortfield, $sortorder; $langs->load("link"); require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; $link = new Link($this->db); $links = array(); if ($sortfield == "name") { $sortfield = "label"; } elseif ($sortfield == "date") { $sortfield = "datea"; } else { $sortfield = null; } $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); $param .= isset($object->id) ? '&id=' . $object->id : ''; // Show list of associated links print load_fiche_titre($langs->trans("LinkedFiles")); print '<form action="' . $_SERVER['PHP_SELF'] . ($param ? '?' . $param : '') . '" method="POST">'; print '<table width="100%" class="liste">'; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Links"), $_SERVER['PHP_SELF'], "name", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("", "", "", "", "", 'align="right"'); print_liste_field_titre($langs->trans("Date"), $_SERVER['PHP_SELF'], "date", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER['PHP_SELF'], "", "", $param, 'align="center"'); print_liste_field_titre('', '', ''); print '</tr>'; $nboflinks = count($links); if ($nboflinks > 0) { include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; } $var = true; foreach ($links as $link) { $var = !$var; print '<tr ' . $bc[$var] . '>'; //edit mode if ($action == 'update' && $selected === $link->id) { print '<td>'; print '<input type="hidden" name="id" value="' . $object->id . '">'; print '<input type="hidden" name="linkid" value="' . $link->id . '">'; print '<input type="hidden" name="action" value="confirm_updateline">'; print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">'; print '</td>'; print '<td>'; print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">'; print '</td>'; print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>'; print '<td align="right"></td>'; print '<td align="right">'; print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">'; print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">'; print '</td>'; } else { print '<td>'; print '<a data-ajax="false" href="' . $link->url . '" target="_blank">'; print $link->label; print '</a>'; print '</td>' . "\n"; print '<td align="right"></td>'; print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; print '<td align="center"></td>'; print '<td align="right">'; print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param if ($permtodelete) { print ' <a href="' . $_SERVER['PHP_SELF'] . '?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param } else { print ' '; } print '</td>'; } print "</tr>\n"; } if ($nboflinks == 0) { print '<tr ' . $bc[false] . '><td colspan="5">'; print $langs->trans("NoLinkFound"); print '</td></tr>'; } print "</table>"; print '</form>'; return $nboflinks; }
// User $userstatic = new User($db); $userstatic->fetch($line->fk_user); print '<td align="right">'; print $userstatic->getLoginUrl(1); print '</td>'; // Todo Edit or delete button // Action if ($user->rights->produit->creer || $user->rights->service->creer) { print '<td align="right">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=showlog_customer_price&socid=' . $object->id . '&prodid=' . $line->fk_product . '">'; print img_info(); print '</a>'; print ' '; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=edit_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">'; print img_edit('default', 0, 'style="vertical-align: middle;"'); print '</a>'; print ' '; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">'; print img_delete('default', 'style="vertical-align: middle;"'); print '</a>'; print '</td>'; } print "</tr>\n"; } } else { print '<tr ' . $bc[false] . '><td colspan="10">' . $langs->trans('NoPriceSpecificToCustomer') . '</td></tr>'; } print "</table>"; print "</form>"; }
foreach($aRow as $key1 => $value) { if(is_object($value)) { print "<tr>"; print '<td align="center">'.$value->position.'</td>'; print "<td>".(empty($value->label)?$langs->trans($key1):$langs->trans($value->label))."</td>"; print "<td>".$key1."</td>"; print "<td>".$value->type."</td>"; print '<td align="right">'.$value->length.'</td>'; print '<td class "content_actions" align="right">'; print '<a class="sepV_a" href="'.$_SERVER["PHP_SELF"].'?'.'&fields='.$key.'&attrname='.$key1.'&action='.$acts[$value->enable].'">'.$actl[$value->enable].'</a>'; if($aRow->edit) { print '<a class="sepV_a" href="'.$_SERVER["PHP_SELF"].'?action=edit&fields='.$key.'&attrname='.$key1.'">'.img_edit().'</a>'; print '<a class="sepV_a" href="'.$_SERVER["PHP_SELF"].'?action=delete&fields='.$key.'&attrname='.$key1.'">'.img_delete().'</a>'; } print '</td>'; print "</tr>"; } } print "</tbody>"; print "</table>"; print "</div>"; print $extrafields->_datatables($obj,$key); print end_box(); print '</div>';
// Depth print '<tr><td>' . $html->editfieldkey("Depth", 'trueDepth', $object->trueDepth, 'id', $object->id, $user->rights->expedition->creer) . '</td><td colspan="3">'; print $html->editfieldval("Depth", 'trueDepth', $object->trueDepth, 'id', $object->id, $user->rights->expedition->creer); print $object->trueDepth ? measuring_units_string($object->depth_units, "size") : ''; print '</td></tr>'; // Status print '<tr><td>' . $langs->trans("Status") . '</td>'; print '<td colspan="3">' . $object->getLibStatut(4) . "</td>\n"; print '</tr>'; // Sending method print '<tr><td height="10">'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('SendingMethod'); print '</td>'; if ($_GET['action'] != 'editexpedition_method_id') { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editexpedition_method_id&id=' . $object->id . '">' . img_edit($langs->trans('SetSendingMethod'), 1) . '</a></td>'; } print '</tr></table>'; print '</td><td colspan="2">'; if ($_GET['action'] == 'editexpedition_method_id') { print '<form name="setexpedition_method_id" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="setexpedition_method_id">'; $object->fetch_delivery_methods(); print $html->selectarray("expedition_method_id", $object->meths, $object->expedition_method_id, 1, 0, 0, "", 1); print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '</form>'; } else { if ($object->expedition_method_id > 0) { // Get code using getLabelFromKey $code = $langs->getLabelFromKey($db, $object->expedition_method_id, 'c_shipment_mode', 'rowid', 'code');
} else { if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) { print $langs->trans("Deprecated"); } else { if (isset($obj->type) && in_array($obj->type, array('system')) && !empty($obj->active) && $obj->code != 'AC_OTH') { print $langs->trans("UsedOnlyWithTypeOption"); } else { print $langs->trans("AlwaysActive"); } } } } print "</td>"; // Modify link if ($iserasable) { print '<td align="center"><a class="reposition" href="' . $url . 'action=edit">' . img_edit() . '</a></td>'; } else { print '<td> </td>'; } // Delete link if ($iserasable) { print '<td align="center"><a href="' . $url . 'action=delete">' . img_delete() . '</a></td>'; } else { print '<td> </td>'; } print "</tr>\n"; } $i++; } } } else {
// Charges ???? if ($conf->global->PRODUCT_CHARGES) { if (!empty($conf->margin->enabled)) { print '<td align="right">'; print $productfourn->fourn_unitcharges ? price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty ? price($productfourn->fourn_charges / $productfourn->fourn_qty) : " "); print '</td>'; } } if (is_object($hookmanager)) { $parameters = array('id_pfp' => $productfourn->product_fourn_price_id, 'id_fourn' => $id_fourn, 'prod_id' => $object->id); $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); } // Modify-Remove print '<td align="center">'; if ($user->rights->produit->creer || $user->rights->service->creer) { print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $productfourn->fourn_id . '&action=add_price&rowid=' . $productfourn->product_fourn_price_id . '">' . img_edit() . "</a>"; print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $productfourn->fourn_id . '&action=remove_pf&rowid=' . $productfourn->product_fourn_price_id . '">' . img_picto($langs->trans("Remove"), 'disable.png') . '</a>'; } print '</td>'; print '</tr>'; } } print '</table>'; } } } } else { print $langs->trans("ErrorUnknown"); } // End of page llxFooter();
$code = ""; if ($entry->fk_variable > 0) { $res = $price_globals->fetch($entry->fk_variable); if ($res > 0) { $code = $price_globals->code; } } $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td>' . $code . '</td>'; print '<td>' . $entry->description . '</td>'; print '<td>' . $langs->trans("GlobalVariableUpdaterType" . $entry->type) . '</td>'; print '<td style="max-width: 250px; word-wrap: break-word; white-space: pre-wrap;">' . $entry->parameters . '</td>'; print '<td>' . $entry->update_interval . '</td>'; print '<td>' . $entry->getLastUpdated() . '</td>'; print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=edit_updater&selection=' . $entry->id . '">' . img_edit() . '</a> '; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_updater&selection=' . $entry->id . '">' . img_delete() . '</a></td>'; print '</tr>'; } print '</table>'; } //Updater editor if ($action == 'create_updater' || $action == 'edit_updater') { //Form print '<form id="updaterform" action="' . $_SERVER["PHP_SELF"] . '" method="post">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="' . $action . '">'; print '<input type="hidden" name="selection" value="' . $selection . '">'; //Table print '<br><table summary="listofattributes" class="border centpercent">'; //Code
print '</td>'; print '</tr>'; // Customer if (is_null($object->client)) { $object->fetch_thirdparty(); } print "<tr><td>" . $langs->trans("Company") . "</td>"; print '<td colspan="3">' . $object->client->getNomUrl(1) . '</td></tr>'; // Delivery address if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) { print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('DeliveryAddress'); print '</td>'; if ($action != 'editdelivery_address' && $object->brouillon) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editdelivery_address&socid=' . $object->socid . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'), 1) . '</a></td>'; } print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editdelivery_address') { $formother->form_address($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_delivery_address, $object->socid, 'fk_address', 'propal', $object->id); } else { $formother->form_address($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_delivery_address, $object->socid, 'none', 'propal', $object->id); } print '</td></tr>'; } print "</table>"; print '</div>'; print '<br>'; // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
if ($action == 'classify') { $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } else { $form->form_project($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0); } print '</td>'; print '</tr>'; } // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>'; print $langs->trans('IncotermLabel'); print '<td><td align="right">'; if ($user->rights->facture->creer) { print '<a href="' . DOL_URL_ROOT . '/compta/facture.php?facid=' . $object->id . '&action=editincoterm">' . img_edit() . '</a>'; } else { print ' '; } print '</td></tr></table>'; print '</td>'; print '<td colspan="3">'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); } else { print $form->select_incoterms(!empty($object->fk_incoterms) ? $object->fk_incoterms : '', !empty($object->location_incoterms) ? $object->location_incoterms : '', $_SERVER['PHP_SELF'] . '?id=' . $object->id); } print '</td></tr>'; } // Other attributes $cols = 5;
{ print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); } else { print ' '; } print '</td>'; } // Actions print '<td align="center">'; if ($user->rights->adherent->creer) { print "<a href=\"fiche.php?rowid=$objp->rowid&action=edit&return=liste.php\">".img_edit()."</a>"; } print ' '; if ($user->rights->adherent->supprimer) { print "<a href=\"fiche.php?rowid=$objp->rowid&action=resign&return=liste.php\">".img_picto($langs->trans("Resiliate"),'disable.png')."</a>"; } print "</td>"; print "</tr>\n"; $i++; } print "</table>\n"; if ($num > $conf->liste_limit)
print '<td align="right">' . price($line->price_min_ttc) . '</td>'; // User $userstatic = new User($db); $userstatic->fetch($line->fk_user); print '<td align="right">'; print $userstatic->getLoginUrl(1); print '</td>'; // Todo Edit or delete button // Action if ($user->rights->produit->creer || $user->rights->service->creer) { print '<td align="right">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_customer_price&socid=' . $soc->id . '&lineid=' . $line->id . '">'; print img_delete(); print '</a>'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=edit_customer_price&socid=' . $soc->id . '&lineid=' . $line->id . '">'; print img_edit(); print '</a>'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=showlog_customer_price&socid=' . $soc->id . '&prodid=' . $line->fk_product . '">'; print img_info(); print '</a>'; print '</td>'; } print "</tr>\n"; } print "</table>"; print "</form>"; } else { print $langs->trans('None'); } /* ************************************************************************** */ /* */
} } print '</td>'; print '</tr>'; // Tracking Number print '<tr><td>' . $form->editfieldkey("TrackingNumber", 'trackingnumber', $object->tracking_number, $object, $user->rights->expedition->creer) . '</td><td colspan="3">'; print $form->editfieldval("TrackingNumber", 'trackingnumber', $object->tracking_url, $object, $user->rights->expedition->creer, 'string', $object->tracking_number); print '</td></tr>'; // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>'; print $langs->trans('IncotermLabel'); print '<td><td align="right">'; if ($user->rights->expedition->creer) { print '<a href="' . DOL_URL_ROOT . '/expedition/card.php?id=' . $object->id . '&action=editincoterm">' . img_edit() . '</a>'; } else { print ' '; } print '</td></tr></table>'; print '</td>'; print '<td colspan="3">'; if ($action != 'editincoterm') { print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1); } else { print $form->select_incoterms(!empty($object->fk_incoterms) ? $object->fk_incoterms : '', !empty($object->location_incoterms) ? $object->location_incoterms : '', $_SERVER['PHP_SELF'] . '?id=' . $object->id); } print '</td></tr>'; } // Other attributes $cols = 3;