/** 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 language: prioritize and delete */ function language_actions($language_id) { $CI =& get_instance(); $c = $CI->languageModel->get_language_by_id($language_id); $d_link = anchor('language/delete/' . $c->id, img_delete(), warning(lang('sure_delete_language'))); return $d_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)); }
/** 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)); }
/** Possible actions for a testinvite: edit, view scores, delete */ function testinvite_actions($testinvite_id) { $CI =& get_instance(); $testinvite = $CI->testInviteModel->get_testinvite_by_id($testinvite_id); $scores = $CI->scoreModel->get_scores_by_testinvite($testinvite_id); $reminder_available = !$testinvite->datecompleted && $testinvite->datereminder; $reminder_link = anchor('testinvite/manual_reminder/' . $testinvite_id, img_email(lang('manual_reminder'), FALSE)); $score_link = anchor('score/testinvite/' . $testinvite_id, img_scores(empty($scores))); $reminder_link = $reminder_available ? $reminder_link : img_email('', TRUE); $delete_link = anchor('testinvite/delete/' . $testinvite_id, img_delete(), warning(lang('sure_delete_testinvite'))); if (is_caller()) { $actions = array($reminder_link, $delete_link); } if (is_leader()) { $actions = array($score_link, $reminder_link); } if (is_admin()) { $actions = array($score_link, $reminder_link, $delete_link); } return implode(' ', $actions); }
/** * \file htdocs/lib/bookmark.lib.php * \brief List of functions for bookmark module * \version $Id: bookmark.lib.php,v 1.6 2011/07/31 23:25:41 eldy Exp $ * * Ensemble de fonctions de base de dolibarr sous forme d'include */ function showArrayOfBookmark($fac) { $sql = "SELECT s.rowid as socid, s.nom, b.rowid as bid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; $sql .= " WHERE b.fk_soc = s.rowid AND b.fk_user = "******" ORDER BY lower(s.nom) ASC"; $resql = $db->query($sql); if ( $resql ) { $num = $db->num_rows($resql); $i = 0; if ($num) { print '<table class="noborder" width="100%">'; print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Bookmarks")."</td></tr>\n"; $var = True; while ($i < $num) { $obj = $db->fetch_object($resql); $var = !$var; print "<tr $bc[$var]>"; print '<td><a href="fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>'; print '<td align="right"><a href="index.php?action=del_bookmark&bid='.$obj->bid.'">'.img_delete().'</a></td>'; print '</tr>'; $i++; } print '</table>'; } $db->free($resql); } else { dol_print_error($db); } }
{ 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>'; }
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>'; // Date operation print '<td align="center">' . ($objp->num_chq ? $objp->num_chq : ' ') . '</td>'; print '<td>' . dol_trunc($objp->emetteur, 24) . '</td>'; print '<td>' . dol_trunc($objp->banque, 24) . '</td>'; print '<td align="right">' . price($objp->amount) . '</td>'; print '<td align="center">'; $accountlinestatic->rowid = $objp->rowid; if ($accountlinestatic->rowid) { print $accountlinestatic->getNomUrl(1); } else { print ' '; } print '</td>'; if ($object->statut == 0) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=remove&lineid=' . $objp->rowid . '">' . img_delete() . '</a></td>'; } else { print '<td> </td>'; } print '</tr>'; $var = !$var; $i++; } print "</table>"; } else { dol_print_error($db); } dol_fiche_end(); } /* * Boutons Actions
/** * 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; }
} } print '</td>'; print '<td>'; $label = $langs->trans("Notify_" . $obj->code) != "Notify_" . $obj->code ? $langs->trans("Notify_" . $obj->code) : $obj->label; print $label; print '</td>'; print '<td>'; if ($obj->type == 'email') { print $langs->trans("Email"); } if ($obj->type == 'sms') { print $langs->trans("SMS"); } print '</td>'; print '<td align="right"><a href="fiche.php?socid=' . $socid . '&action=delete&actid=' . $obj->rowid . '">' . img_delete() . '</a></td>'; print '</tr>'; $i++; } $db->free($resql); } else { dol_print_error($db); } print '</table>'; print '<br>'; // List of notifications done print_fiche_titre($langs->trans("ListOfNotificationsDone"), '', ''); $var = true; // Line with titles print '<table width="100%" class="noborder">'; print '<tr class="liste_titre">';
$result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; $total = 0; $var=True; while ($i < $num) { $objp = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; print '<td><a href="'.DOL_URL_ROOT.'/compta/bank/budget.php?bid='.$objp->rowid.'">'.$objp->rowid.'</a></td>'; print "<td>$objp->label</td>"; print '<td style="text-align: center;"><a href="categ.php?categid='.$objp->rowid.'&action=delete">'.img_delete().'</a></td>'; print "</tr>"; $i++; } $db->free($result); } /* * Affichage ligne ajout de categorie */ $var=!$var; print "<tr $bc[$var]>"; print "<td> </td><td><input name=\"label\" type=\"text\" size=45></td>"; print '<td align="center"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>'; print "</table></form>";
/** * Output list all export models * TODO Move this into a class htmlxxx.class.php * * @return void */ function list_export_model() { global $conf, $langs; $sql = "SELECT em.rowid, em.field, em.label, em.type, em.filter"; $sql .= " FROM " . MAIN_DB_PREFIX . "export_model as em"; $sql .= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($result); $keyModel = array_search($obj->type, $this->array_export_code); print "<tr>"; print '<td><a href=export.php?step=2&action=select_model&exportmodelid=' . $obj->rowid . '&datatoexport=' . $obj->type . '>' . $obj->label . '</a></td>'; print '<td>'; print img_object($this->array_export_module[$keyModel]->getName(), $this->array_export_icon[$keyModel]) . ' '; print $this->array_export_module[$keyModel]->getName() . ' - '; // recuperation du nom de l'export $string = $langs->trans($this->array_export_label[$keyModel]); print $string != $this->array_export_label[$keyModel] ? $string : $this->array_export_label[$keyModel]; print '</td>'; //print '<td>'.$obj->type.$keyModel.'</td>'; print '<td>' . str_replace(',', ' , ', $obj->field) . '</td>'; if (!empty($obj->filter)) { $filter = json_decode($obj->filter, true); print '<td>' . str_replace(',', ' , ', $filter['field']) . '</td>'; print '<td>' . str_replace(',', ' , ', $filter['value']) . '</td>'; } // suppression de l'export print '<td align="right">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=deleteprof&id=' . $obj->rowid . '">'; print img_delete(); print '</a>'; print "</tr>"; $i++; } } else { dol_print_error($this->db); } }
print '<td align="right">' . price($line->price) . "</td>"; print '<td align="right">' . price($line->price_ttc) . "</td>"; print '<td align="right">' . price($line->price_min) . '</td>'; 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');
$invoice = new Facture($db); while ($i < $num) { $obj = $db->fetch_object($resql); $invoice->fetch($obj->fk_facture_source); print '<tr><td colspan="' . $nbcols . '" align="right">'; if ($invoice->type == Facture::TYPE_CREDIT_NOTE) { print $langs->trans("CreditNote") . ' '; } if ($invoice->type == Facture::TYPE_DEPOSIT) { print $langs->trans("Deposit") . ' '; } print $invoice->getNomUrl(0); print ' :</td>'; print '<td align="right">' . price($obj->amount_ttc) . '</td>'; print '<td align="right">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&action=unlinkdiscount&discountid=' . $obj->rowid . '">' . img_delete() . '</a>'; print '</td></tr>'; $i++; if ($invoice->type == Facture::TYPE_CREDIT_NOTE) { $creditnoteamount += $obj->amount_ttc; } if ($invoice->type == Facture::TYPE_DEPOSIT) { $depositamount += $obj->amount_ttc; } } } else { dol_print_error($db); } // Paye partiellement 'escompte' if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat') { print '<tr><td colspan="' . $nbcols . '" align="right" class="nowrap">';
echo $bc[$var]; ?> > <td><?php echo $objectlink->getNomUrl(1); ?> </td> <td align="center"><?php echo dol_print_date($objectlink->date_contrat, 'day'); ?> </td> <td align="right"> </td> <td align="right"><?php echo $objectlink->getLibStatut(6); ?> </td> <td align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&dellinkid=' . $key; ?> "><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?> </a></td> </tr> <?php } ?> </table> <!-- END PHP TEMPLATE -->
} 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 { dol_print_error($db); } print '</table>'; print '</form>'; } else { /*
print '<td>'; print $obj->description; print '</td>'; } print '<td class="nowrap">' . $langs->trans("NotConsumed") . '</td>'; print '<td align="right">' . price($obj->amount_ht) . '</td>'; print '<td align="right">' . price2num($obj->tva_tx, 'MU') . '%</td>'; print '<td align="right">' . price($obj->amount_ttc) . '</td>'; print '<td align="center">'; print '<a href="' . DOL_URL_ROOT . '/user/fiche.php?id=' . $obj->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $obj->login . '</a>'; print '</td>'; if ($user->rights->societe->creer || $user->rights->facture->creer) { print '<td class="nowrap">'; print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $objsoc->id . '&action=split&remid=' . $obj->rowid . '">' . img_picto($langs->trans("SplitDiscount"), 'split') . '</a>'; print ' '; print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $objsoc->id . '&action=remove&remid=' . $obj->rowid . '">' . img_delete($langs->trans("RemoveDiscount")) . '</a>'; print '</td>'; } else { print '<td> </td>'; } print '</tr>'; if ($_GET["action"] == 'split' && $_GET['remid'] == $obj->rowid) { print "<tr " . $bc[$var] . ">"; print '<td colspan="8">'; $amount1 = price2num($obj->amount_ttc / 2, 'MT'); $amount2 = $obj->amount_ttc - $amount1; $formquestion = array('text' => $langs->trans('TypeAmountOfEachNewDiscount'), array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC") . ' 1', 'value' => $amount1, 'size' => '5'), array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC") . ' 2', 'value' => $amount2, 'size' => '5')); $langs->load("dict"); print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $objsoc->id . '&remid=' . $obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($obj->amount_ttc), $langs->transnoentities("Currency" . $conf->currency)), 'confirm_split', $formquestion, 0, 0); print '</td>'; print '</tr>';
if (!empty($groupslist)) { $var = true; foreach ($groupslist as $group) { $var = !$var; print "<tr " . $bc[$var] . ">"; print '<td>'; if ($caneditgroup) { print '<a href="' . DOL_URL_ROOT . '/user/group/fiche.php?id=' . $group->id . '">' . img_object($langs->trans("ShowGroup"), "group") . ' ' . $group->nom . '</a>'; } else { print img_object($langs->trans("ShowGroup"), "group") . ' ' . $group->nom; } print '</td>'; print '<td align="right">'; if ($caneditgroup) { print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $fuser->id . '&action=removegroup&group=' . $group->id . '&entity=' . $group->usergroup_entity . '">'; print img_delete($langs->trans("RemoveFromGroup")); } else { print " "; } print "</td></tr>\n"; } } else { print '<tr ' . $bc[false] . '><td colspan=2>' . $langs->trans("None") . '</td></tr>'; } print "</table>"; print "<br>"; } } /* * Fiche en mode edition */
print '<input type="text" id="note_' . $i . '" class="flat inputforupdate" size="40" name="const[' . $i . '][note]" value="' . htmlspecialchars($obj->note, 1) . '">'; print '</td>'; // Entity limit to superadmin if (!empty($conf->multicompany->enabled) && !$user->entity) { print '<td>'; print '<input type="text" class="flat" size="1" name="const[' . $i . '][entity]" value="' . $obj->entity . '">'; print '</td>'; print '<td align="center">'; } else { print '<td align="center">'; print '<input type="hidden" name="const[' . $i . '][entity]" value="' . $obj->entity . '">'; } if ($conf->use_javascript_ajax) { print '<input type="checkbox" class="flat checkboxfordelete" id="check_' . $i . '" name="const[' . $i . '][check]" value="1">'; } else { print '<a href="' . $_SERVER['PHP_SELF'] . '?rowid=' . $obj->rowid . '&entity=' . $obj->entity . '&action=delete' . (empty($user->entity) && $debug ? '&debug=1' : '') . '">' . img_delete() . '</a>'; } print "</td></tr>\n"; print "\n"; $i++; } } print '</table>'; if ($conf->use_javascript_ajax) { print '<br>'; print '<div id="updateconst" align="right">'; print '<input type="submit" name="update" class="button" value="' . $langs->trans("Modify") . '">'; print '</div>'; print '<div id="delconst" align="right">'; print '<input type="submit" name="delete" class="button" value="' . $langs->trans("Delete") . '">'; print '</div>';
/** Possible actions for a leader: delete */ function leader_actions($leader_id) { return anchor('leader/delete/' . $leader_id, img_delete(), warning(lang('sure_delete_leader'))); }
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 '<tr>';
$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">';
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 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>"; } } llxFooter(); $db->close();
if ($typeid == Categorie::TYPE_PRODUCT) { $permission = $user->rights->produit->creer || $user->rights->service->creer; } if ($typeid == Categorie::TYPE_SUPPLIER) { $permission = $user->rights->societe->creer; } if ($typeid == Categorie::TYPE_CUSTOMER) { $permission = $user->rights->societe->creer; } if ($typeid == Categorie::TYPE_MEMBER) { $permission = $user->rights->adherent->creer; } if ($typeid == Categorie::TYPE_CONTACT) { $permission = $user->rights->societe->creer; } if ($permission) { print "<a href= '" . $_SERVER['PHP_SELF'] . "?" . (empty($socid) ? 'id' : 'socid') . "=" . $object->id . "&type=" . $typeid . "&removeelem=" . $contact->id . "'>"; print img_delete($langs->trans("DeleteFromCat")) . ' '; print $langs->trans("DeleteFromCat") . "</a>"; } print '</td>'; print "</tr>\n"; } } else { print "<tr " . $bc[false] . "><td>" . $langs->trans("ThisCategoryHasNoContact") . "</td></tr>"; } print "</table>\n"; } } llxFooter(); $db->close();
print '<select class="flat" name="cat1">' . $options . '</select> '; print '<input type="submit" class="button" value="' . $langs->trans("Add") . '"></td>'; } print '</tr>'; $sql = "SELECT c.label, c.rowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank_class as a, " . MAIN_DB_PREFIX . "bank_categ as c"; $sql .= " WHERE a.lineid=" . $rowid . " AND a.fk_categ = c.rowid"; $sql .= " ORDER BY c.label"; $result = $db->query($sql); if ($result) { $var = True; $num = $db->num_rows($result); $i = 0; $total = 0; while ($i < $num) { $objp = $db->fetch_object($result); $var = !$var; print "<tr " . $bc[$var] . ">"; print "<td>" . $objp->label . "</td>"; print "<td align=\"center\"><a href=\"budget.php?bid=" . $objp->rowid . "\">" . $langs->trans("ListBankTransactions") . "</a></td>"; if ($user->rights->banque->modifier) { print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=delete_categ&rowid=' . $rowid . '&fk_categ=' . $objp->rowid . '">' . img_delete($langs->trans("Remove")) . '</a></td>'; } print '</tr>'; $i++; } $db->free($result); } print '</table></form>'; llxFooter(); $db->close();
echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); } ?> <?php //if ($object->statut >= 0) echo '</a>'; ?> </div> <div class="tagtd nowrap" align="right"> <?php if ($permission) { ?> <a href="<?php echo $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=deletecontact&lineid=' . $tab[$i]['rowid']; ?> "><?php echo img_delete(); ?> </a> <?php } ?> </div> </form> <?php $i++; } } ?> </div>
dol_fiche_end(); print '<div class="center">'; print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">'; print ' '; print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">'; print '</div>'; print '</form>'; } else { dol_fiche_head($head, 'translation', $titre, 0, $picto); dol_banner_tab($object, 'ref', '', $user->societe_id ? 0 : 1, 'ref'); $cnt_trans = 0; if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $cnt_trans++; $s = picto_from_langcode($key); print "<br>" . ($s ? $s . ' ' : '') . " <b>" . $langs->trans('Language_' . $key) . ":</b> " . '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&langtodelete=' . $key . '">' . img_delete('', '') . "</a><br>"; print '<table class="border" width="100%">'; print '<tr><td width="15%">' . $langs->trans('Label') . '</td><td>' . $object->multilangs[$key]["label"] . '</td></tr>'; print '<tr><td width="15%">' . $langs->trans('Description') . '</td><td>' . $object->multilangs[$key]["description"] . '</td></tr>'; print '<tr><td width="15%">' . $langs->trans('Note') . '</td><td>' . $object->multilangs[$key]["note"] . '</td></tr>'; print '</table>'; } } if (!$cnt_trans) { print '<br>' . $langs->trans('NoTranslation'); } dol_fiche_end(); } /* ************************************************************************** */ /* */ /* Barre d'action */