$h_add_card_b->javascript = "dis_blank_card({gDossier:{$gDossier},fd_id:{$fd_id},ref:2})"; $str_add_card = $g_user->check_action(FICADD) == 1 ? $h_add_card_b->input() : ""; /* * You show now the result */ if ($array == null) { echo '<div class="content">'; echo '<h2 class="info2"> ' . _('Aucune fiche trouvée') . '</h2>'; echo $str_add_card; echo '</div>'; return; } $allcard = isset($_GET['allcard']) ? 1 : 0; if ($allcard == 0) { $fiche_def = new Fiche_Def($cn, $_GET['cat']); $fiche_def->get(); echo h1($fiche_def->label, ""); echo h2($fiche_def->fd_description, ""); } echo '<div class="content">'; /* * ********************************************************************************************************************************* * Liste * * ******************************************************************************************************************************** */ if ($_GET['histo'] == -1) { $write = $g_user->check_action(FICADD); /** * If ask for move or delete */ if (isset($_POST['action'])) { if ($write == 1) {
function remove($silent = false) { if ($this->id == 0) { return; } // verify if that card has not been used is a ledger // if the card has its own account in PCMN // Get the fiche_def.fd_id from fiche.f_id $this->Get(); $fiche_def = new Fiche_Def($this->cn, $this->fiche_def); $fiche_def->get(); // if the card is used do not removed it $qcode = $this->strAttribut(ATTR_DEF_QUICKCODE); if ($this->cn->count_sql("select * from jrnx where j_qcode='" . Database::escape_string($qcode) . "'") != 0) { if (!$silent) { alert(_('Impossible cette fiche est utilisée dans un journal')); } return 1; } $this->delete(); return 0; }