noalyss Version-9
forecast_item_mtable-input.php
Go to the documentation of this file.
1<?php
2/*
3* This file is part of NOALYSS.
4*
5* NOALYSS is free software; you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation; either version 2 of the License, or
8* (at your option) any later version.
9*
10* NOALYSS is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with NOALYSS; if not, write to the Free Software
17* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@noalyss.eu
21
22/**
23 * \file
24 * \brief display, add, delete and modify forecast_item, All rows are in $a_row
25 * \see Forecast_Item_MTable::input
26 */
27
29$forecast = new Forecast_SQL($cn, $this->get_forecast_id());
30$forecast->load();
31$str_name = $forecast->getp('f_name');
32$str_start = $forecast->getp('f_start_date');
33$str_end = $forecast->getp('f_end_date');
34
35$aPeriode = $cn->make_array("select p_id,to_char(p_start,'MM.YYYY') as label from parm_periode
36 where p_start >= (select p_start from parm_periode where p_id=$str_start)
37 and p_end <= (select p_end from parm_periode where p_id=$str_end)
38 order by p_start");
39$aPeriode[] = array('value' => 0, 'label' => 'Mensuel');
40$category = new ISelect("fc_id");
41$category->value = $cn->make_array("select fc_id,fc_desc from
42 forecast_category
43 where f_id=$1 order by 2",
44 0, [$this->get_forecast_id()]);
45$category->selected = $object->getp("fc_id");
46
47$amount = new INum("fi_amount");
48$amount->value = $object->getp("fi_amount");
49$amount->value=($amount->value=="")?0:$amount->value;
50
51$forecast_text = new IText("fi_text");
52$forecast_text->value = $object->getp("fi_text");
53
54/* Accounting*/
55$account = new ITextarea('fi_account');
56$account->value=$object->getp("fi_account");
57$account->id=uniqid("fi_account");
58$account->nb_row=3;
59$account->extra=' style = "margin-left:0px;width:100%;" class="input_text"';
60$account->size="80rem";
61
62$isPeriode = new ISelect('fi_pid');
63$isPeriode->value = $aPeriode;
64$isPeriode->selected = $object->getp("fi_pid");
65
66$amount_initial= new INum("fi_amount_initial");
67$amount_initial->value=$object->getp("fi_amount_initial");
68$amount_initial->value=($amount_initial->value=='')?0:$amount_initial->value;
69
70?>
71<table style="width:50rem">
72 <tr>
73 <td><?= _("Categorie") ?></td>
74 <td><?= $category->input(); ?></td>
75 </tr>
76
77 <tr>
78 <td>
79 <?= _("Periode") ?>
80 </td>
81 <td>
82 <?= $isPeriode->input() ?>
83 </td>
84 </tr>
85
86 <tr>
87 <td><?=$this->show_error("fi_text")?> <?= _("Intitulé") ?></td>
88 <td><?= $forecast_text->input(); ?></td>
89 </tr>
90
91 <tr>
92 <td>
93 <?=$this->show_error("fi_account")?>
94 <?= _("Formule") ?>
95 ( <a href="https://wiki.noalyss.eu/doku.php?id=tutoriaux:les_rapports#un_mot_d_explication" target="_blank">
96 Aide</a> )
97
98 </td>
99 <td>
100 <?= $account->input() ?>
101 <?= HtmlInput::button_action(_("Cherche poste, fiche , analytique"),
102 sprintf('search_account_card({gDossier:%s,target:\'%s\'})',Dossier::id(),
103 $account->id))
104 ?>
105 </td>
106 </tr>
107 <tr>
108 <td><?= _("Montant") ?></td>
109 <td><?= $amount->input(); ?></td>
110 </tr>
111 <tr>
112 <td>
113 <?=_("Montant initial")?>
114 </td>
115 <td>
116 <?=$amount_initial->input()?>
117 </td>
118 </tr>
119
120</table>
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
catch(Exception $e) $object
$opd_description style
static id()
return the 'gDossier' value after a check
ORM abstract of the table public.forecast.
static button_action($action, $javascript, $id=NULL, $p_class="button", $p_symbole="")
button Html with javascript
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: inum.class.php:42
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: itext.class.php:30
Manage the TEXTAREA html element.
$all table