$choice_cat = HtmlInput::default_value_request("choice_cat", 1); if ($choice_cat == 1) { $sel_card = new ISelect('cat'); $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' . ' where frd_id=' . FICHE_TYPE_CLIENT . ' order by fd_label ', 1); $sel_card->selected = isset($_GET['cat']) ? $_GET['cat'] : -1; $sel_card->javascript = ' onchange="submit(this);"'; echo _('Catégorie :') . $sel_card->input(); } else { $cat = HtmlInput::default_value_request('cat', ''); echo HtmlInput::hidden("cat", $cat); echo HtmlInput::hidden('choice_cat', 0); } $nooperation = new ICheckBox('noop'); $nooperation->selected = isset($_GET['noop']) ? true : false; echo Dossier::hidden(); echo _('Inclure les clients sans opération :') . $nooperation->input(); ?> <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche'); ?> "> <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']; ?> "> </form> </div> <?php $client = new Customer($cn); $search = isset($_GET['query']) ? $_GET['query'] : ""; $sql = "";
require_once NOALYSS_INCLUDE . '/class_fiche.php'; require_once NOALYSS_INCLUDE . '/class_lettering.php'; $gDossier = dossier::id(); $cn = new Database($gDossier); global $g_user, $g_failed; /** * Show first the form */ /* category */ $categorie = new ISelect('cat'); $categorie->value = $cn->make_array('select fd_id,fd_label from fiche_def order by fd_label'); $categorie->selected = isset($_GET['cat']) ? $_GET['cat'] : 0; $str_categorie = $categorie->input(); $icall = new ICheckBox("allcard", 1); $icall->selected = isset($_GET['allcard']) ? 1 : 0; $str_icall = $icall->input(); /* periode */ $exercice = $g_user->get_exercice(); $iperiode = new Periode($cn); list($first, $last) = $iperiode->get_limit($exercice); $periode_start = new IDate('start'); $periode_end = new IDate('end'); $periode_start->value = isset($_GET['start']) ? $_GET['start'] : $first->first_day(); $periode_end->value = isset($_GET['end']) ? $_GET['end'] : $last->last_day(); $str_start = $periode_start->input(); $str_end = $periode_end->input(); /* histo ou summary */ $histo = new ISelect('histo'); $histo->value = array(array('value' => -1, 'label' => _('Liste')), array('value' => 0, 'label' => _('Historique')), array('value' => 1, 'label' => _('Historique Lettré')), array('value' => 6, 'label' => _('Historique Lettré et montants différents')), array('value' => 2, 'label' => _('Historique non Lettré')), array('value' => 3, 'label' => _('Résumé')), array('value' => 4, 'label' => _('Balance')), array('value' => 6, 'label' => _('Balance âgée')), array('value' => 7, 'label' => _('Balance âgée en-cours')), array('value' => 5, 'label' => _('Balance non soldée'))); $histo->javascript = 'onchange="if (this.value==3 || this.value==-1) { g("trstart").style.display="none";g("trend").style.display="none";g("allcard").style.display="none";}
</tr> <?php for ($i = 0; $i < $limit; $i++) { ?> <?php $class = $i % 2 == 0 ? ' class="odd" ' : ' class="even"'; ?> <tr <?php echo $class; ?> > <td> <?php $ck = new ICheckBox('ag_id[]'); $ck->value = $a_row[$i]['ag_id']; echo $ck->input(); ?> </td> <td > <?php echo h($a_row[$i]['my_date']); ?> </td> <td> <?php echo h($a_row[$i]['ag_ref']); ?> </td> <td> <?php echo h($a_row[$i]['sub_ag_title']);
/** *create a hidden plus button to select the cat of ledger *@note the selected value is stored in the array p_cat */ static function select_cat($array_cat) { ob_start(); $ledger = new ISmallButton('l'); $ledger->label = _("Catégorie"); $ledger->javascript = " show_cat_choice()"; echo $ledger->input(); /* create a hidden div for the ledger */ echo '<div id="div_cat">'; echo '<h2 class="info">' . _('Choix des categories') . '</h2>'; $selected = isset($_GET['r_cat']) ? $_GET['r_cat'] : null; echo '<ul>'; for ($e = 0; $e < count($array_cat); $e++) { $row = $array_cat[$e]; $re = new ICheckBox('r_cat[' . $e . ']', $row['cat']); if ($selected != null && isset($selected[$e])) { $re->selected = true; } echo '<li style="list-style-type: none;">' . $re->input() . $row['name'] . '(' . $row['cat'] . ')</li>'; } echo '</ul>'; $hide = new IButton('l2'); $hide->label = _("Valider"); $hide->javascript = " hide_cat_choice() "; echo $hide->input(); echo '</div>'; $r = ob_get_contents(); ob_end_clean(); return $r; }
function input_base() { $r = ""; $r .= _('Label'); $label = new IText('label', $this->label); $r .= $label->input(); $r .= '<br>'; /* the accounting item */ $class_base = new IPoste('class_base', $this->class_base); $class_base->set_attribute('ipopup', 'ipop_account'); $class_base->set_attribute('account', 'class_base'); $class_base->set_attribute('label', 'acc_label'); $fd_description = new ITextarea('fd_description', $this->fd_description); $fd_description->width = 80; $fd_description->heigh = 4; $fd_description->style = 'class="itextarea" style="margin-left:0px;vertical-align:text-top"'; $r .= _('Poste Comptable de base') . ' : '; $r .= $class_base->input(); $r .= '<span id="acc_label"></span><br>'; $r .= '<br/>'; $r .= " Description " . $fd_description->input(); /* auto Create */ $r .= '<br/>'; $ck = new ICheckBox('create'); $ck->selected = $this->create_account == 'f' ? false : true; $r .= _('Chaque fiche aura automatiquement son propre poste comptable : '); $r .= $ck->input(); return $r; }
?> " onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')"> <?php echo _('Extourne'); ?> </a></li> </ul> <div id="modele_div_id"> <?php echo Pre_operation::save_propose(); ?> </div> <div id="reverse_div_id" style="display:none;height:185px;height:10rem"> <?php $reverse_date = new IDate('reverse_date'); $reverse_ck = new ICheckBox('reverse_ck'); echo _('Extourne opération') . " " . $reverse_ck->input() . " "; echo $reverse_date->input(); ?> </div> <div id="document_div_id" style="display:none;height:185px;height:10rem"> <?php $file = new IFile(); $file->table = 0; echo '<p class="decale">'; echo _("Ajoutez une pièce justificative "); echo $file->input("pj", ""); echo '</p>'; ?> </div> </div> <?php
<td><?php echo _("Ordre d'apparition"); ?> </td> <td><?php echo $p_order->input(); ?> </td> </tr> <tr> <td><?php echo _("Menu par défaut"); ?> </td> <td><?php echo $pm_default->input(); ?> </td> </tr> </table> <?php echo HtmlInput::submit('add_menubt', _("Valider")); echo '</form>'; return; } // for printing menu (export CSV or PDF) if ($type == 'pr') { $ame_code = $cn->make_array("\nselect me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,'')\n\tfrom\n\tmenu_ref\n\twhere me_type='PR'\n\tand me_code not in (select me_code from profile_menu where p_id=\$1)\n\torder by 1\n\t", 0, array($p_id)); $me_code = new ISelect('me_code'); $me_code->value = $ame_code;
printf(_('Recherche') . ' <input class="input_text" type="text" name="query" value="%s">', $a); $choice_cat = HtmlInput::default_value_request("choice_cat", 1); if ($choice_cat == 1) { $sel_card = new ISelect('cat'); $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' . ' where frd_id=$1' . ' order by fd_label ', 1, array(FICHE_TYPE_FIN)); $sel_card->selected = isset($_GET['cat']) ? $_GET['cat'] : -1; $sel_card->javascript = ' onchange="submit(this);"'; echo _('Catégorie :') . $sel_card->input(); } else { $cat = HtmlInput::default_value_request('cat', ''); echo HtmlInput::hidden("cat", $cat); echo HtmlInput::hidden('choice_cat', 0); } $nooperation = new ICheckBox('noop'); $nooperation->selected = isset($_GET['noop']) ? true : false; echo _('Inclure les banques sans opération :') . $nooperation->input(); ?> <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche'); ?> "> <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']; ?> "> </form> </div> <?php $supplier = new Bank($cn); $search = isset($_GET['query']) ? $_GET['query'] : ""; $sql = "";
function form($p_readonly = 0) { $wDate = new IDate("pdate", $this->date); $wDate->table = 1; $wDate->size = 10; $wDate->readonly = $p_readonly; $wDescription = new IText("pdesc"); $wDescription->table = 0; $wDescription->size = 80; $wDescription->readonly = $p_readonly; // Show an existing operation // if (isset($this->a_operation[0])) { $wDate->value = $this->a_operation[0]->oa_date; $wDescription->value = $this->a_operation[0]->oa_description; } $ret = ""; $ret .= '<table style="result" >'; $ret .= "<TR>" . $wDate->input() . "</tr>"; $ret .= '<tr><td>Description</td>' . '<td colspan="3">' . $wDescription->input() . "</td></tr>"; $Plan = new Anc_Plan($this->db); $aPlan = $Plan->get_list(); $max = count($this->a_operation) < $this->nMaxRow ? $this->nMaxRow : count($this->a_operation); $ret .= '</table><table id="ago" style="width: 100%;">'; /* show 10 rows */ $ret .= "<tr>"; foreach ($aPlan as $d) { $idx = $d['id']; /* array of possible value for the select */ $aPoste[$idx] = $this->db->make_array("select po_id as value," . " po_name||':'||coalesce(po_description,'-') as label " . " from poste_analytique " . " where pa_id = " . $idx . " order by po_name "); $ret .= "<th> Poste </th>"; } $ret .= "<th></th>" . "<th> Montant</th>" . "<th>Débit</th>" . "</tr>"; for ($i = 0; $i < $max; $i++) { $ret .= "<tr>"; foreach ($aPlan as $d) { $idx = $d['id']; // init variable $wSelect = new ISelect("pop" . $i . "plan" . $idx); $wSelect->value = $aPoste[$idx]; $wSelect->size = 12; $wSelect->readOnly = $p_readonly; if (isset($this->a_operation[$i])) { $wSelect->selected = $this->a_operation[$i]->po_id; } $ret .= td($wSelect->input()); } $wAmount = new INum("pamount{$i}", 0.0); $wAmount->size = 12; $wAmount->table = 1; $wAmount->javascript = " onChange=format_number(this);caod_checkTotal()"; $wAmount->readOnly = $p_readonly; $wDebit = new ICheckBox("pdeb{$i}"); $wDebit->readOnly = $p_readonly; $wDebit->javascript = " onChange=caod_checkTotal()"; if (isset($this->a_operation[$i])) { $wSelect->selected = $this->a_operation[$i]->po_id; $wAmount->value = $this->a_operation[$i]->oa_amount; $wDebit->value = $this->a_operation[$i]->oa_debit; if ($wDebit->value == 't') { $wDebit->selected = true; } } // build the table $ret .= "<TD></TD>"; $ret .= $wAmount->input(); $ret .= td($wDebit->input()); $ret .= "</tr>"; } $ret .= "</table>"; if ($p_readonly == false) { $add_row = new IButton('Ajouter'); $add_row->label = _('Ajouter une ligne'); $add_row->javascript = 'anc_add_row(\'ago\');'; $ret .= HtmlInput::hidden('nbrow', $max); $ret .= $add_row->input(); } return $ret; }
<tr> <td> <?php $checkbox = new ICheckBox("jrn[]"); ?> <?php $checkbox->value = $jrn[$i]['jrn_def_id']; ?> <?php $checkbox->selected = false; if ($post_jrn == -1 && $jrn[$i]['kl_id'] != "" || is_array($post_jrn) && in_array($jrn[$i]['jrn_def_id'], $post_jrn)) { $checkbox->selected = true; } ?> <?php echo $checkbox->input(); ?> </td> <td> <?php echo h($jrn[$i]['jrn_def_name']); ?> </td> <td> <?php echo h($jrn[$i]['jrn_def_description']); ?> </td> </tr> <?php }
function display_form_periode() { $str_dossier = dossier::get(); if ($this->jrn_def_id == 0) { $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice,\n (select count(jr_id) as count_op from jrn where jr_tech_per = p_id) as count_op\n from parm_periode\n order by p_start,p_end"); $Max = Database::num_row($Res); echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >'; echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST); echo '<TABLE ALIGN="CENTER">'; echo "</TR>"; echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>"; echo '<TH> Date début </TH>'; echo '<TH> Date fin </TH>'; echo '<TH> Exercice </TH>'; echo "</TR>"; for ($i = 0; $i < $Max; $i++) { $l_line = Database::fetch_array($Res, $i); $class = "even"; if ($i % 2 == 0) { $class = "odd"; } $style = ''; if ($l_line['p_closed'] == 't') { $style = "color:red"; } echo '<TR class="' . $class . '" style="' . $style . '">'; echo '<td>'; if ($l_line['p_closed'] == 'f') { $per_to_close = new ICheckBox('sel_per_close[]'); $per_to_close->value = $l_line['p_id']; echo $per_to_close->input(); } echo '</td>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>'; if ($l_line['p_closed'] == 't') { $closed = $l_line['p_central'] == 't' ? '<TD>Centralisée</TD>' : '<TD>Fermée</TD>'; $change = '<TD></TD>'; $remove = sprintf(_('Nombre opérations %d'), $l_line['count_op']); $remove = td($remove, ' class="mtitle" '); $change = td('<A class="mtitle" HREF="javascript:void(0)"' . ' onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'do.php?ac=' . $_REQUEST['ac'] . '&action=reopen&p_per=' . $l_line['p_id'] . '&' . $str_dossier . '\';} )"> Réouverture</A>', ' class="mtitle"'); } else { if ($l_line['count_op'] == 0) { $change = HtmlInput::display_periode($l_line['p_id']); } else { $change = "Non modifiable"; } $change = td($change, ' class="mtitle" '); $reopen = td(""); $remove = '<TD class="mtitle">'; if ($l_line['count_op'] == 0) { $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'delete_per', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id())); $remove .= '<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box (null,\'' . _('Confirmez effacement ?') . '\',function() { window.location=\'' . $go . '\'});" >' . ' Efface</A>'; } else { $remove .= sprintf(_('Nombre opérations %d'), $l_line['count_op']); } $remove .= '</td>'; } echo $change; echo $remove; echo '</TR>'; } echo '</table>'; echo '<p style="text-align:center">'; echo HtmlInput::hidden("close_per", 1); echo HtmlInput::submit('close_per_bt', 'Fermeture des périodes sélectionnées'); echo '</p>'; echo '</form>'; $but = new IButton('show_per_add', 'Ajout d\'une période'); $but->javascript = "\$('periode_add_div').show();"; echo $but->input(); echo '<div class="inner_box" style="width:40%;" id="periode_add_div">'; echo HtmlInput::title_box("Ajout d'une période", "periode_add_div", "hide"); echo '<FORM METHOD="POST">'; echo dossier::hidden(); $istart = new IDate('p_date_start'); $iend = new IDate('p_date_end'); $iexercice = new INum('p_exercice'); $iexercice->size = 5; echo '<table>'; echo '<TR> '; echo td('Date de début'); echo td($istart->input()); echo '</tr><tr>'; echo td('Date de fin'); echo td($iend->input()); echo '</tr><tr>'; echo td('Exercice'); echo td($iexercice->input()); echo '</TABLE>'; echo HtmlInput::submit('add_per', 'Valider'); echo '</FORM>'; echo '</div>'; echo create_script("\$('periode_add_div').hide();new Draggable('periode_add_div',{starteffect:function()\n {\n new Effect.Highlight(obj.id,{scroll:window,queue:'end'});\n }}\n );"); } else { $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,status,p_exercice\n from parm_periode join jrn_periode using (p_id) where jrn_def_id=" . $this->jrn_def_id . "\n order by p_start,p_end"); $Max = Database::num_row($Res); $r = $this->cn->exec_sql('select jrn_Def_name from jrn_Def where jrn_Def_id=' . $this->jrn_def_id); $jrn_name = Database::fetch_result($r, 0, 0); echo '<h2> Journal ' . $jrn_name . '</h2>'; echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >'; echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST); echo '<TABLE ALIGN="CENTER">'; echo "</TR>"; echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>"; echo '<TH> Date début </TH>'; echo '<TH> Date fin </TH>'; echo '<TH> Exercice </TH>'; echo "</TR>"; for ($i = 0; $i < $Max; $i++) { $l_line = Database::fetch_array($Res, $i); if ($l_line['status'] != 'OP') { echo '<TR style="COLOR:RED">'; } else { echo '<TR>'; } echo '<td>'; if ($l_line['status'] == 'OP') { $per_to_close = new ICheckBox('sel_per_close[]'); $per_to_close->value = $l_line['p_id']; echo $per_to_close->input(); } echo '</td>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>'; $closed = ""; if ($l_line['status'] != 'OP') { $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'reopen', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id(), 'jrn_def_id' => $this->jrn_def_id)); $closed = td('<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'' . $go . '\';} );"> Réouverture</A>', ' class="mtitle"'); } echo "{$closed}"; echo '</TR>'; } echo '</TABLE>'; echo '<p style="text-align:center">'; echo HtmlInput::submit('close_per', 'Fermeture des périodes sélectionnées'); echo '</p>'; echo '</form>'; } }
static function toggle_checkbox($p_name, $p_form) { $a = new ICheckBox($p_name); $a->javascript = 'onclick="toggle_checkbox(\'' . $p_form . '\')"'; return $a->input(); }
if ($op == 'modele_drop') { // ask to confirm the removal a folder $cn = new Database(); $name = $cn->get_value('select mod_name from modeledef where mod_id=$1', array($dossier)); ob_start(); echo HtmlInput::title_box(_('Efface'), 'folder_admin_div'); echo '<form action="admin_repo.php" method="post">'; echo HtmlInput::hidden('m', $dossier); echo HtmlInput::hidden('sa', 'remove'); echo HtmlInput::hidden('action', 'modele_mgt'); echo '<h2 class="error">' . _('Etes vous sure et certain de vouloir effacer ') . $name . ' ?</h2>'; $confirm = new ICheckBox(); $confirm->name = "p_confirm"; echo '<p>'; echo _('Cochez la case si vous êtes sûr de vouloir effacer ce modèle'); echo $confirm->input(); echo '</p>'; echo '<p style="text-align:center">'; echo HtmlInput::submit('remove', 'Effacer'); echo '</p>'; echo '</form>'; $content = ob_get_clean(); $status = 'OK'; } else { if ($op == 'modele_modify') { // Modify the description or the name of a template $cn = new Database(); ob_start(); echo HtmlInput::title_box(_('Modification'), 'folder_admin_div'); echo '<form method="post">'; $name = $cn->get_value("select mod_name from modeledef where " . " mod_id=\$1", array($dossier));
echo HtmlInput::request_to_hidden(array('ac')); $choice_cat = HtmlInput::default_value_request("choice_cat", 1); if ($choice_cat == 1) { $sel_card = new ISelect('cat'); $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' . ' where frd_id=' . FICHE_TYPE_EMPL . ' order by fd_label ', 1); $sel_card->selected = isset($_GET['cat']) ? $_GET['cat'] : -1; $sel_card->javascript = ' onchange="submit(this);"'; echo _('Catégorie :') . $sel_card->input(); } else { $cat = HtmlInput::default_value_request('cat', ''); echo HtmlInput::hidden("cat", $cat); echo HtmlInput::hidden('choice_cat', 0); } $nooperation = new ICheckBox('noop'); $nooperation->selected = isset($_GET['noop']) ? true : false; echo _('Inclure les employés sans opération :') . $nooperation->input(); ?> <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche'); ?> "> <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']; ?> "> </form> </div> <?php $supplier = new Manager($cn); $search = isset($_GET['query']) ? $_GET['query'] : ""; $sql = "";
$to_poste->set_attribute('label', 'to_poste_label'); $to_poste->set_attribute('account', 'to_poste'); $to_poste->value = isset($_GET['to_poste']) ? $_GET['to_poste'] : ""; $to_span = new ISpan("to_poste_label", ""); echo "<div>"; echo _("Plage de postes") . " :" . $from_poste->input(); echo $from_span->input(); echo " " . _("jusque") . " :" . $to_poste->input(); echo $to_span->input(); echo "</div>"; echo '<div>'; echo '<p>'; echo _("Uniquement comptes non soldés") . " " . $unsold->input(); echo '</p>'; echo '<p>'; echo _("Avec la balance de l'année précédente") . " " . $previous_exc->input(); echo '</p>'; echo '</div>'; echo '</div>'; echo HtmlInput::submit("view", _("Visualisation")); echo '</form>'; echo '<hr>'; //----------------------------------------------------- // Form //----------------------------------------------------- // Show the export button if (isset($_GET['view'])) { $hid = new IHidden(); echo "<table>"; echo '<TR>'; echo '<TD><form method="GET" ACTION="export.php">' . dossier::hidden() . HtmlInput::submit('bt_pdf', "Export PDF") . HtmlInput::hidden("ac", $_REQUEST['ac']) . HtmlInput::hidden("act", "PDF:balance") . HtmlInput::hidden("from_periode", $_GET['from_periode']) . HtmlInput::hidden("to_periode", $_GET['to_periode']);
/* * Display only the last ac */ $a_code = explode('/', $a_bookmark[$i]['b_action']); $idx = count($a_code); $code = $a_code[$idx - 1]; ?> <tr class="<?php echo $i % 2 == 0 ? 'odd' : 'even'; ?> "> <td> <?php $ch = new ICheckBox('book[]'); $ch->value = $a_bookmark[$i]['b_id']; echo $ch->input(); ?> </td> <td> <a class='mtitle' style='text-decoration: underline' href="<?php echo $url . "&ac=" . $a_bookmark[$i]['b_action']; ?> "> <?php echo $code; ?> </a> </td> <td> <?php echo $a_bookmark[$i]['me_description'];
printf(_('Recherche') . ' <input class="input_text" type="text" name="query" value="%s">', $a); $choice_cat = HtmlInput::default_value_request("choice_cat", 1); if ($choice_cat == 1) { $sel_card = new ISelect('cat'); $sel_card->value = $cn->make_array('select fd_id, fd_label from fiche_def ' . ' where frd_id=' . FICHE_TYPE_FOURNISSEUR . ' order by fd_label ', 1); $sel_card->selected = isset($_GET['cat']) ? $_GET['cat'] : -1; $sel_card->javascript = ' onchange="submit(this);"'; echo _('Catégorie :') . $sel_card->input(); } else { $cat = HtmlInput::default_value_request('cat', ''); echo HtmlInput::hidden("cat", $cat); echo HtmlInput::hidden('choice_cat', 0); } $nooperation = new ICheckBox('noop'); $nooperation->selected = isset($_GET['noop']) ? true : false; echo _('Inclure les fournisseurs sans opération :') . $nooperation->input(); ?> <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche'); ?> "> <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']; ?> "> </form> </div> <?php $supplier = new Supplier($cn); $search = isset($_GET['query']) ? $_GET['query'] : ""; $sql = "";
?> </td> </tr> <tr> <td align="right">Poste comptable utilisés format :debit,credit</td> <td> <?php $w = new IText(); $w->size = 20; echo $w->input('tva_poste', $tva_array[$index]['tva_poste']); ?> </td> </Tr> <tr> <td align="right">Utilisé au débit et au crédit afin d'annuler cette tva </td> <td> <?php $w = new ICheckBox("both", $tva_array[$index]['tva_both_side']); $w->selected = $tva_array[$index]['tva_both_side']; $w->size = 20; echo $w->input('both', ''); ?> </td> </Tr> </table> <input type="submit" class="button" value="Confirme" name="confirm_mod"> <input type="submit" class="button" value="Cancel" name="no"> </FORM> </fieldset> <?php } echo '</div>';
function display_html() { $r = ""; //---Html $array = $this->load(); if (is_array($array) == false || empty($array)) { return 0; } $r .= '<table class="result" style="width:100%">'; $ix = 0; $prev = 'xx'; $idx = 0; $tot_deb = $tot_cred = 0; bcscale(2); foreach ($array as $row) { if ($prev != $row['po_name']) { if ($ix > 0) { $r .= '<tr>'; $tot_solde = bcsub($tot_cred, $tot_deb); $sign = " " . ($tot_solde > 0) ? 'C' : 'D'; $r .= td('') . td('') . td(''); $r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"'); } $r .= '<tr>' . '<td colspan="7" style="width:auto">' . '<h2>' . h($row['po_name'] . ' ' . $row['po_description']) . '</td></tr>'; $r .= '<tr>' . '<th>' . '</th>' . '<th>' . _('Date') . '</th>' . '<th>' . _('Poste') . '</th>' . '<th>' . _('Quick_code') . '</th>' . '<th>' . _('Libellé') . '</th>' . '<th>' . '</th>' . '<th>' . _('Pièce') . '</th>' . '<th>' . _('Interne') . '</th>' . '<th style="text-align:right">' . _('Débit') . '</th>' . '<th style="text-align:right">' . _('Crédit') . '</th>' . '<th style="text-align:right">' . _('Prog.') . '</th>' . '</tr>'; $tot_deb = $tot_cred = 0; $prev = $row['po_name']; $ix++; } $class = $idx % 2 == 0 ? 'even' : 'odd'; $idx++; $r .= '<tr class="' . $class . '">'; $detail = $row['jr_id'] != null ? HtmlInput::detail_op($row['jr_id'], $row['jr_internal']) : ''; $post_detail = $row['j_poste'] != null ? HtmlInput::history_account($row['j_poste'], $row['j_poste']) : ''; $card_detail = $row['f_id'] != null ? HtmlInput::history_card($row['f_id'], $row['qcode']) : ''; $amount_deb = $row['oa_debit'] == 't' ? $row['oa_amount'] : 0; $amount_cred = $row['oa_debit'] == 'f' ? $row['oa_amount'] : 0; $tot_deb = bcadd($tot_deb, $amount_deb); $tot_cred = bcadd($tot_cred, $amount_cred); $tot_solde = bcsub($tot_cred, $tot_deb); /* * Checked button */ $str_ck = ""; $str_document = ""; if ($row['jr_id'] != null) { /* * Get receipt info */ $str_document = HtmlInput::show_receipt_document($row['jr_id']); if ($str_document != "") { $ck = new ICheckBox('ck[]', $row['jr_id']); $str_ck = $ck->input(); } } $r .= '<td>' . $str_ck . '</td>' . '<td>' . $row['oa_date'] . '</td>' . td($post_detail) . td($card_detail) . td($row['jr_comment']) . '<td>' . $str_document . '</td>' . td($row['jr_pj_number']) . '<td>' . $detail . '</td>' . '<td class="num">' . nbm($amount_deb) . '</td>' . '<td class="num">' . nbm($amount_cred) . '</td>' . '<td class="num">' . nbm($tot_solde) . '</td>'; $r .= '</tr>'; } $r .= '<tr>'; $tot_solde = bcsub($tot_cred, $tot_deb); $sign = $tot_solde > 0 ? 'C' : 'D'; $r .= td('') . td('') . td(''); $r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"'); $r .= '</table>'; return $r; }
function display($p_array) { global $g_parameter, $g_user; require_once NOALYSS_INCLUDE . '/class_acc_ledger.php'; $legder = new Acc_Ledger($this->db, $this->jrn_def_id); $legder->nb = $legder->get_min_row(); if ($p_array != null) { extract($p_array); } $add_js = ""; $ret = ""; if ($g_user->check_action(FICADD) == 1) { /* Add button */ $f_add_button = new IButton('add_card'); $f_add_button->label = _('Créer une nouvelle fiche'); $f_add_button->set_attribute('ipopup', 'ipop_newcard'); $f_add_button->set_attribute('jrn', $legder->id); $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);"; $f_add_button->input(); } $nb_row = isset($nb_item) ? $nb_item : $legder->nb; $ret .= HtmlInput::hidden('nb_item', $nb_row); $ret .= HtmlInput::hidden('p_jrn', $this->jrn_def_id); $ret .= dossier::hidden(); $ret .= dossier::hidden(); $ret .= HtmlInput::hidden('jrn_type', $legder->get_type()); $info = HtmlInput::infobulle(0); $info_poste = HtmlInput::infobulle(9); if ($g_user->check_action(FICADD) == 1) { $ret .= $f_add_button->input(); } $ret .= '<table id="quick_item" style="width:100%">'; $ret .= '<tr>' . '<th style="text-align:left">Quickcode' . $info . '</th>' . '<th style="text-align:left">' . _('Poste') . $info_poste . '</th>' . '<th style="text-align:left">' . _('Libellé') . '</th>' . '<th style="text-align:left">' . _('Montant') . '</th>' . '<th style="text-align:left">' . _('Débit') . '</th>' . '</tr>'; for ($i = 0; $i < $nb_row; $i++) { // Quick Code $quick_code = new ICard('qc_' . $i); $quick_code->set_dblclick("fill_ipopcard(this);"); $quick_code->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $quick_code->set_attribute('label', "ld" . $i); $quick_code->set_attribute('jrn', $legder->id); // name of the field to update with the name of the card $quick_code->set_attribute('typecard', 'filter'); // Add the callback function to filter the card on the jrn $quick_code->set_callback('filter_card'); $quick_code->set_function('fill_data'); $quick_code->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $quick_code->name); $quick_code->jrn = $legder->id; $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : ""; $label = ''; if ($quick_code->value != '') { $Fiche = new Fiche($legder->db); $Fiche->get_by_qcode($quick_code->value); $label = $Fiche->strAttribut(ATTR_DEF_NAME); } // Account $poste = new IPoste(); $poste->name = 'poste' . $i; $poste->set_attribute('jrn', $legder->id); $poste->set_attribute('ipopup', 'ipop_account'); $poste->set_attribute('label', 'ld' . $i); $poste->set_attribute('account', 'poste' . $i); $poste->set_attribute('dossier', Dossier::id()); $poste->value = isset(${'poste' . $i}) ? ${"poste" . $i} : ''; $poste->dbl_click_history(); if ($poste->value != '') { $Poste = new Acc_Account($legder->db); $Poste->set_parameter('value', $poste->value); $label = $Poste->get_lib(); } // Description of the line $line_desc = new IText(); $line_desc->name = 'ld' . $i; $line_desc->size = 30; $line_desc->value = isset(${"ld" . $i}) ? ${"ld" . $i} : $label; // Amount $amount = new INum(); $amount->size = 10; $amount->name = 'amount' . $i; $amount->value = isset(${'amount' . $i}) ? ${"amount" . $i} : ''; $amount->javascript = ' onChange="format_number(this);checkTotalDirect()"'; // D/C $deb = new ICheckBox(); $deb->name = 'ck' . $i; $deb->selected = isset(${'ck' . $i}) ? true : false; $deb->javascript = ' onChange="checkTotalDirect()"'; $ret .= '<tr>'; $ret .= '<td>' . $quick_code->input() . $quick_code->search() . '</td>'; $ret .= '<td>' . $poste->input() . '<script> document.getElementById(\'poste' . $i . '\').onblur=function(){ if (trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . '\').value="";}}</script>' . '</td>'; $ret .= '<td>' . $line_desc->input() . '</td>'; $ret .= '<td>' . $amount->input() . '</td>'; $ret .= '<td>' . $deb->input() . '</td>'; $ret .= '</tr>'; // If readonly == 1 then show CA } $ret .= '</table>'; return $ret; }
$r .= td($js); $amount = $cn->get_value('select qf_amount from quant_fin where jr_id=$1', array($row['jr_id'])); $r .= '<td class="num" class="sorttable_numeric" sorttable_customkey="' . $amount . '" style="text-align:right">' . nbm($amount) . '</td>'; $diff = bcadd($diff, $amount); $tot_not_reconcilied += $row['jr_montant']; $iradio->value = $row['jr_id']; $iradio->selected = false; if (isset($_POST['op'])) { for ($x = 0; $x < count($_POST['op']); $x++) { if ($row['jr_id'] == $_POST['op'][$x]) { $iradio->selected = true; break; } } } $r .= td(HtmlInput::hidden('jrid[' . $i . ']', $row['jr_id']) . $iradio->input(), ' style="text-align:center" '); if ($i % 2 == 0) { echo tr($r, ' class="odd" '); } else { echo tr($r, ' class="even" '); } } echo '</table>'; $bk_card = new Fiche($cn); $bk_card->id = $Ledger->get_bank(); $filter_year = " j_tech_per in (select p_id from parm_periode where p_exercice='" . $g_user->get_exercice() . "')"; /* get saldo for not reconcilied operations */ $saldo_not_reconcilied = $bk_card->get_solde_detail($filter_year . " and j_grpt in (select jr_grpt_id from jrn where trim(jr_pj_number) ='' or jr_pj_number is null)"); /* get saldo for reconcilied operation */ $saldo_reconcilied = $bk_card->get_solde_detail($filter_year . " and j_grpt in (select jr_grpt_id from jrn where trim(jr_pj_number) != '' and jr_pj_number is not null)"); /* solde compte */
function myList() { $s = dossier::get(); $sql = "select md_id,md_name,md_affect,dt_value from document_modele join document_type on(dt_id=md_type) order by md_name"; $Res = $this->cn->exec_sql($sql); $all = Database::fetch_all($Res); $r = ''; if (Database::num_row($Res) != 0) { $r .= '<p><form method="post">'; $r .= dossier::hidden(); $r .= "<table>"; $r .= "<tr> "; $r .= th(_('Nom')); $r .= th(_('Catégorie')); $r .= th(_('Affect.')); $r .= th(_('Fichier')); $r .= th(_('Effacer')); $r .= "</tr>"; foreach ($all as $row) { $r .= "<tr>"; $r .= "<td>"; $r .= h($row['md_name']); $r .= "</td>"; $r .= "<td>"; $r .= $row['dt_value']; $r .= "</td>"; $r .= td(h($row['md_affect'])); $r .= "<td>"; $r .= '<A HREF="show_document_modele.php?md_id=' . $row['md_id'] . '&' . $s . '">Document</a>'; $r .= "</td>"; $r .= "<TD>"; $c = new ICheckBox(); $c->name = "dm_remove_" . $row['md_id']; $r .= $c->input(); $r .= "</td>"; $r .= td(HtmlInput::detail_modele_document($row['md_id'], 'Modifier')); $r .= "</tr>"; } $r .= "</table>"; // need hidden parameter for subaction $a = new IHidden(); $a->name = "sa"; $a->value = "rm_template"; $r .= $a->input(); $r .= HtmlInput::submit("rm_template", "Effacer la sélection"); } $b = new IButton('show'); $b->label = "Ajout d'un document"; $b->javascript = "\$('add_modele').style.display='block';new Draggable('add_modele',{starteffect:function(){\n new Effect.Highlight(obj.id,{scroll:window,queue:'end'});}});"; $r .= $b->input(); $r .= "</form></p>"; return $r; }
print '</TR>'; print '<TR>'; $date_from = new IDate('from_periode'); $date_to = new IDate('to_periode'); $year = $g_user->get_exercice(); $date_from->value = isset($_REQUEST['from_periode']) ? $_REQUEST['from_periode'] : "01.01." . $year; $date_to->value = isset($_REQUEST['to_periode']) ? $_REQUEST['to_periode'] : "31.12." . $year; echo td(_('Depuis') . $date_from->input()); echo td(_('Jusque ') . $date_to->input()); // print "<TR><TD>"; $all = new ICheckBox(); $all->label = "Tous les postes qui en dépendent"; $all->disabled = false; $all->selected = isset($_REQUEST['poste_fille']) ? true : false; echo $all->input("poste_fille"); echo '</TD></TR><TR><TD>'; $detail = new ICheckBox(); $detail->label = "Détail des opérations"; $detail->disabled = false; $detail->selected = isset($_REQUEST['oper_detail']) ? true : false; echo $detail->input("oper_detail"); echo '</td></tr>'; $a_let = array(array('value' => 0, 'label' => 'Toutes les opérations'), array('value' => 1, 'label' => ' Opérations lettrées'), array('value' => 2, 'label' => ' Opérations non lettrées')); echo '</TABLE>'; $salet = new ISelect('ople'); $salet->value = $a_let; $salet->selected = isset($_GET['ople']) ? $_GET['ople'] : 0; echo $salet->input(); print HtmlInput::submit('bt_html', 'Visualisation'); echo '</FORM>';
echo _("Description"); ?> </td> <td><?php echo $me_description->input(); ?> </td> </tr> <tr> <TD><?php echo _("Fichier"); ?> </td> <td><?php echo $me_file->input(); ?> </td> </tr> </table> <?php if ($new == 1) { echo HtmlInput::hidden('save_plugin', 1); echo HtmlInput::submit("save_plugin_sbt", _("Ajouter ce plugin")); } else { $delete = new ICheckBox('delete_pl'); echo "<p>" . _("Voulez-vous effacer ce plugin ?") . " " . $delete->input() . "</p>"; echo HtmlInput::hidden('mod_plugin', 1); echo HtmlInput::submit("mod_plugin_sbt", _("Modifier ce plugin")); } ?> </form>
<?php echo $p_array[$i]['use_login']; ?> </td> <td> <?php echo $p_array[$i]['use_name']; ?> </td> <td> <?php echo $p_array[$i]['use_first_name']; ?> </td> <td> <?php $check = new ICheckBox('use_login' . $p_array[$i]['use_login'] . "_" . $this->tl_id); if ($this->is_shared_with($p_array[$i]['use_login']) != 0) { $check->selected = true; } $check->javascript = " onclick=\"todo_list_set_share({$this->tl_id},'{$p_array[$i]['use_login']}','{$dossier}')\""; echo $check->input(); ?> </td> </tr> <?php } ?> </tr> </table>
/** * @brief Show the form to encode your operation * @param$p_array if you correct or use a predef operation (default = null) * @param$p_readonly 1 for readonly 0 for writable (default 0) *@exception if ledger not found * \return a string containing the form */ function input($p_array = null, $p_readonly = 0) { global $g_parameter, $g_user; $this->nb = $this->get_min_row(); if ($p_readonly == 1) { return $this->confirm($p_array); } if ($p_array != null) { extract($p_array); } $add_js = ""; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $add_js = "update_pj();"; } if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $add_js .= 'get_last_date();'; } $add_js .= 'update_row("quick_item");'; $ret = ""; if ($g_user->check_action(FICADD) == 1) { /* Add button */ $f_add_button = new IButton('add_card'); $f_add_button->label = _('Créer une nouvelle fiche'); $f_add_button->set_attribute('ipopup', 'ipop_newcard'); $f_add_button->set_attribute('jrn', $this->id); $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);"; $f_add_button->input(); } $wLedger = $this->select_ledger('ODS', 2); if ($wLedger == null) { throw new Exception(_('Pas de journal disponible')); } $wLedger->javascript = "onChange='update_name();update_predef(\"ods\",\"t\",\"" . $_REQUEST['ac'] . "\");{$add_js}'"; $label = " Journal " . HtmlInput::infobulle(2); $ret .= $label . $wLedger->input(); // Load the javascript // $ret .= "<table>"; $ret .= '<tr ><td colspan="2" style="width:auto">'; $wDate = new IDate('e_date'); $wDate->readonly = $p_readonly; $e_date = isset($e_date) && trim($e_date) != '' ? $e_date : ''; $wDate->value = $e_date; $ret .= _("Date") . ' : ' . $wDate->input(); $ret .= '</td>'; /* insert periode if needed */ // Periode //-- if ($this->check_periode() == true) { $l_user_per = $g_user->get_periode(); $def = isset($periode) ? $periode : $l_user_per; $period = new IPeriod("period"); $period->user = $g_user; $period->cn = $this->db; $period->value = $def; $period->type = OPEN; try { $l_form_per = $period->input(); } catch (Exception $e) { if ($e->getCode() == 1) { echo _("Aucune période ouverte"); exit; } } $label = HtmlInput::infobulle(3); $f_periode = _("Période comptable") . " {$label} " . $l_form_per; $ret .= td($f_periode); } $wPJ = new IText('e_pj'); $wPJ->readonly = false; $wPJ->size = 10; /* suggest PJ ? */ $default_pj = ''; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $default_pj = $this->guess_pj(); } $wPJ->value = isset($e_pj) ? $e_pj : $default_pj; $ret .= '</tr>'; $ret .= '<tr >'; $ret .= '<td colspan="2" style="width:auto"> ' . _('Pièce') . ' : ' . $wPJ->input(); $ret .= HtmlInput::hidden('e_pj_suggest', $default_pj); $ret .= '</tr>'; $ret .= '</td>'; $ret .= '<tr>'; $ret .= '<td colspan="2" style="width:auto">'; $ret .= _('Libellé'); $wDescription = new IText('desc'); $wDescription->readonly = $p_readonly; $wDescription->size = "50"; $wDescription->value = isset($desc) ? $desc : ''; $ret .= $wDescription->input(); $ret .= '</td>'; $ret .= '</tr>'; $ret .= '</table>'; $nb_row = isset($nb_item) ? $nb_item : $this->nb; $ret .= HtmlInput::hidden('nb_item', $nb_row); $ret .= dossier::hidden(); $ret .= dossier::hidden(); $ret .= HtmlInput::hidden('jrn_type', $this->get_type()); $info = HtmlInput::infobulle(0); $info_poste = HtmlInput::infobulle(9); if ($g_user->check_action(FICADD) == 1) { $ret .= $f_add_button->input(); } $ret .= '<table id="quick_item" style="position:float;width:100%">'; $ret .= '<tr>' . '<th style="text-align:left">Quickcode' . $info . '</th>' . '<th style="text-align:left">' . _('Poste') . $info_poste . '</th>' . '<th style="text-align:left">' . _('Libellé') . '</th>' . '<th style="text-align:left">' . _('Montant') . '</th>' . '<th style="text-align:left">' . _('Débit') . '</th>' . '</tr>'; for ($i = 0; $i < $nb_row; $i++) { // Quick Code $quick_code = new ICard('qc_' . $i); $quick_code->set_dblclick("fill_ipopcard(this);"); $quick_code->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $quick_code->set_attribute('label', "ld" . $i); // name of the field to update with the name of the card $quick_code->set_attribute('typecard', 'filter'); // Add the callback function to filter the card on the jrn $quick_code->set_callback('filter_card'); $quick_code->set_function('fill_data'); $quick_code->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $quick_code->name); $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : ""; $quick_code->readonly = $p_readonly; $label = ''; if ($quick_code->value != '') { $Fiche = new Fiche($this->db); $Fiche->get_by_qcode($quick_code->value); $label = $Fiche->strAttribut(ATTR_DEF_NAME); } // Account $poste = new IPoste(); $poste->name = 'poste' . $i; $poste->set_attribute('jrn', $this->id); $poste->set_attribute('ipopup', 'ipop_account'); $poste->set_attribute('label', 'ld' . $i); $poste->set_attribute('account', 'poste' . $i); $poste->set_attribute('dossier', Dossier::id()); $poste->value = isset(${'poste' . $i}) ? ${"poste" . $i} : ''; $poste->dbl_click_history(); $poste->readonly = $p_readonly; if ($poste->value != '') { $Poste = new Acc_Account($this->db); $Poste->set_parameter('value', $poste->value); $label = $Poste->get_lib(); } // Description of the line $line_desc = new IText(); $line_desc->name = 'ld' . $i; $line_desc->size = 30; $line_desc->value = isset(${"ld" . $i}) ? ${"ld" . $i} : $label; // Amount $amount = new INum(); $amount->size = 10; $amount->name = 'amount' . $i; $amount->value = isset(${'amount' . $i}) ? ${"amount" . $i} : ''; $amount->readonly = $p_readonly; $amount->javascript = ' onChange="format_number(this);checkTotalDirect()"'; // D/C $deb = new ICheckBox(); $deb->name = 'ck' . $i; $deb->selected = isset(${'ck' . $i}) ? true : false; $deb->readonly = $p_readonly; $deb->javascript = ' onChange="checkTotalDirect()"'; $ret .= '<tr>'; $ret .= '<td>' . $quick_code->input() . $quick_code->search() . '</td>'; $ret .= '<td>' . $poste->input() . '<script> document.getElementById(\'poste' . $i . '\').onblur=function(){ if (trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . '\').value="";}}</script>' . '</td>'; $ret .= '<td>' . $line_desc->input() . '</td>'; $ret .= '<td>' . $amount->input() . '</td>'; $ret .= '<td>' . $deb->input() . '</td>'; $ret .= '</tr>'; // If readonly == 1 then show CA } $ret .= '</table>'; if (isset($this->with_concerned) && $this->with_concerned == true) { $oRapt = new Acc_Reconciliation($this->db); $w = $oRapt->widget(); $w->name = 'jrn_concerned'; $w->value = isset($jrn_concerned) ? $jrn_concerned : ""; $ret .= "Réconciliation/rapprochements : " . $w->input(); } $ret .= create_script("\$('" . $wDate->id . "').focus()"); return $ret; }
* @brief * @param type $name Descriptionara */ echo HtmlInput::title_box("Poste comptable", "acc_update", "hide"); ?> <span id="acc_update_info" class="notice"></span> <form method="post" id="acc_update_frm_id" onsubmit="pcmn_save();return false;"> <table style="width:100%"> <?php $r = td(_('Poste comptable'), 'style="width:20em;width:15rem;text-align:right"') . td($val->input()); echo tr($r); $r = td(_('Description'), 'style="width:auto;text-align:right"') . td($lib->input()); echo tr($r); $r = td(_('Parent'), 'style="width:auto;text-align:right"') . td($parent->input()); echo tr($r); $r = td(_('Type'), 'style="width:auto;text-align:right"') . td($type->input()); echo tr($r); ?> </table> <?php echo HtmlInput::hidden('p_oldu', $pcmn_val); echo HtmlInput::hidden('p_action', $action); echo dossier::hidden(); $checkbox = new ICheckBox("delete_acc"); echo _('Cocher pour effacer') . " " . $checkbox->input(); echo '<hr>'; echo HtmlInput::submit('update', _('Sauve')); echo HtmlInput::button('hide', _('Annuler'), 'onClick="$(\'acc_update\').hide();return true;"'); ?> </form>
<?php echo h($a_plugin[$e]->me_file); ?> </td> <td> <?php for ($w = 0; $w < $nb_profile; $w++) { ?> <span style="display:block"> <?php $a = new ICheckBox('plugin[' . $a_plugin[$e]->me_code . '][' . $a_profile[$w]['p_id'] . ']'); if ($a_profile[$w]['cnt'] > 0) { $a->selected = true; } echo $a->input(); echo $a_profile[$w]['p_name']; ?> </span> <?php } ?> </td> </tr> <?php } ?> </table> <?php echo HtmlInput::submit('save_plugin', _('Valider'));
<?php $itext = new IText('lib'); $itext->value = strip_tags($obj->det->jr_comment); $itext->size = 40; echo td(_('Libellé')) . td($itext->input(), ' colspan="2" '); ?> </td> </tr> <tr> <td></td> <td>Payé</td> <td> <?php $ipaid = new ICheckBox("ipaid", 'paid'); $ipaid->selected = $obj->det->jr_rapt == 'paid'; echo $ipaid->input(); ?> </td> </tr> </table> </td> <td style="width:50%;height:100%;vertical-align:top;text-align: center"> <table style="width:99%;height:8rem;vertical-align:top;"> <tr style="height: 5%"> <td style="text-align:center;vertical-align: top"> Note </td></tr> <tr> <td style="text-align:center;vertical-align: top"> <?php
/** * myList($p_base, $p_filter = "", $p_search = "") * Show list of action by default if sorted on date * @param $p_base base url with ac... * @param $p_filter filters on the document_type * @param $p_search must a valid sql command ( ex 'and ag_title like upper('%hjkh%')) * @return string containing html code */ function myList($p_base, $p_filter = "", $p_search = "") { // for the sort $url = HtmlInput::get_to_string(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "only_internal", "state", "qcode", "ag_dest_query", "action_query", "tdoc", "date_start", "date_end", "hsstate", "searchtag")) . '&' . $p_base; $table = new Sort_Table(); $table->add('Date Doc.', $url, 'order by ag_timestamp asc', 'order by ag_timestamp desc', 'da', 'dd'); $table->add('Date Comm.', $url, 'order by last_comment', 'order by last_comment desc', 'dca', 'dcd'); $table->add('Date Limite', $url, 'order by ag_remind_date asc', 'order by ag_remind_date desc', 'ra', 'rd'); $table->add('Tag', $url, 'order by tags asc', 'order by tags desc', 'taa', 'tad'); $table->add('Réf.', $url, 'order by ag_ref asc', 'order by ag_ref desc', 'ra', 'rd'); $table->add('Groupe', $url, "order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe')", "order by coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') desc", 'dea', 'ded'); $table->add('Dest/Exp', $url, 'order by name asc', 'order by name desc', 'ea', 'ed'); $table->add('Titre', $url, 'order by ag_title asc', 'order by ag_title desc', 'ta', 'td'); $ord = !isset($_GET['ord']) ? "dcd" : $_GET['ord']; $sort = $table->get_sql_order($ord); if (strlen(trim($p_filter)) != 0) { $p_filter_doc = " dt_id in ( {$p_filter} )"; } else { $p_filter_doc = " 1=1 "; } $sql = "\n select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,\n to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,\n to_char(coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp),'DD.MM.YY') as str_last_comment,\n coalesce((select max(agc_date) from action_gestion_comment as agc where agc.ag_id=ag.ag_id),ag_timestamp) as last_comment,\n f_id_dest,\n s_value,\n ag_title,dt_value,ag_ref, ag_priority,ag_state,\n coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,\n (select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,\n array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags\n from action_gestion as ag\n join document_type on (ag_type=dt_id)\n join document_state on (ag_state=s_id)\n where {$p_filter_doc} {$p_search} {$sort}"; $max_line = $this->db->count_sql($sql); $step = $_SESSION['g_pagesize']; $page = isset($_GET['offset']) ? $_GET['page'] : 1; $offset = isset($_GET['offset']) ? Database::escape_string($_GET['offset']) : 0; if ($step != -1) { $limit = " LIMIT {$step} OFFSET {$offset} "; } else { $limit = ''; } $bar = navigation_bar($offset, $max_line, $step, $page); $Res = $this->db->exec_sql($sql . $limit); $a_row = Database::fetch_all($Res); $r = ""; $r .= '<p>' . $bar . '</p>'; $r .= '<table class="document">'; $r .= "<tr>"; $r .= '<th name="ag_id_td" style="display:none" >' . ICheckBox::toggle_checkbox('ag', 'list_ag_frm') . '</th>'; $r .= '<th>' . $table->get_header(0) . '</th>'; $r .= '<th>' . $table->get_header(1) . '</th>'; $r .= '<th>' . $table->get_header(2) . '</th>'; $r .= '<th>' . $table->get_header(3) . '</th>'; $r .= '<th>' . $table->get_header(4) . '</th>'; $r .= '<th>' . $table->get_header(5) . '</th>'; $r .= '<th>' . $table->get_header(6) . '</th>'; $r .= '<th>' . $table->get_header(7) . '</th>'; $r .= th('Priorité'); $r .= "</tr>"; // if there are no records return a message if (sizeof($a_row) == 0 or $a_row == false) { $r = '<div style="clear:both">'; $r .= '<hr>Aucun enregistrement trouvé'; $r .= "</div>"; return $r; } $today = date('d.m.Y'); $i = 0; $checkbox = new ICheckBox("mag_id[]"); //show the sub_action foreach ($a_row as $row) { $href = '<A class="document" HREF="do.php?' . $p_base . HtmlInput::get_to_string(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "only_internal", "state", "gDossier", "qcode", "ag_dest_query", "action_query", "tdoc", "date_start", "date_end", "hsstate", "searchtag", "ac"), "&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">'; $i++; $tr = $i % 2 == 0 ? 'even' : 'odd'; if ($row['ag_priority'] < 2) { $tr = 'priority1'; } $st = ''; if ($row['my_date'] == $today) { $st = ' style="font-weight:bold; border:2px solid orange;"'; } $date_remind = format_date($row['my_remind'], 'DD.MM.YYYY', 'YYYYMMDD'); $date_today = date('Ymd'); if ($date_remind != "" && $date_remind == $date_today && $row['ag_state'] != 1 && $row['ag_state'] != 3) { $st = ' style="font-weight:bold;background:orange"'; } if ($date_remind != "" && $date_remind < $date_today && $row['ag_state'] != 1 && $row['ag_state'] != 3) { $st = ' style="font-weight:bold;background:#FF0000;color:white;"'; } $r .= "<tr class=\"{$tr}\" {$st}>"; $checkbox->value = $row['ag_id']; $r .= '<td name="ag_id_td" style="display:none">' . $checkbox->input() . '</td>'; $r .= "<td>" . $href . smaller_date($row['my_date']) . '</a>' . "</td>"; $r .= "<td>" . $href . $row['str_last_comment'] . '</a>' . "</td>"; $r .= "<td>" . $href . smaller_date($row['my_remind']) . '</a>' . "</td>"; $r .= "<td>" . $href . h($row['tags']) . '</a>' . "</td>"; $r .= "<td>" . $href . $row['ag_ref'] . '</a>' . "</td>"; $r .= "<td>" . $href . h($row['dest']) . '</a>' . "</td>"; // Expediteur $fexp = new Fiche($this->db); $fexp->id = $row['f_id_dest']; $qcode_dest = $fexp->strAttribut(ATTR_DEF_QUICKCODE); $qexp = $qcode_dest == NOTFOUND ? "Interne" : $qcode_dest; $jsexp = sprintf("javascript:showfiche('%s')", $qexp); if ($qexp != 'Interne') { $r .= "<td>{$href}" . $qexp . " : " . $fexp->getName() . '</a></td>'; } else { $r .= "<td>{$href} Interne </a></td>"; } $ref = ""; $r .= '<td>' . $href . h($row['ag_title']) . "</A></td>"; /* * State */ switch ($row['ag_priority']) { case 1: $priority = 'Haute'; break; case 2: $priority = "Moyenne"; break; case 3: $priority = "Important"; break; } $r .= td($priority); $r .= "<td>" . $ref . "</td>"; $r .= "</tr>"; } $r .= "</table>"; $r .= '<p>' . $bar . '</p>'; return $r; }