Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions | Static Public Member Functions
Formulaire_Formula Class Reference

display the formula : depending of the type of formula, a factory is used and an object RAPAV_Formula, RAPAV_Account_TVA or RAPAV_compute will be used for the display of the details More...

Inheritance diagram for Formulaire_Formula:
Inheritance graph
Collaboration diagram for Formulaire_Formula:
Collaboration graph

Public Member Functions

 __construct (formulaire_param_sql $e)
 
 display ()
 
 make_object ($p_index)
 return an object following the key type_detail of the array passed in parameter More...
 
 input ()
 input value More...
 

Static Public Member Functions

static load_all ($p_id)
 load all the row from formulaire_param_detail, children of formulaire_param return an array of objects Formulaire_Param_Detail More...
 

Detailed Description

display the formula : depending of the type of formula, a factory is used and an object RAPAV_Formula, RAPAV_Account_TVA or RAPAV_compute will be used for the display of the details

Definition at line 351 of file class_formulaire_param.php.

Constructor & Destructor Documentation

Formulaire_Formula::__construct ( formulaire_param_sql  $e)

Definition at line 354 of file class_formulaire_param.php.

References Formulaire_Row\load_all().

355  {
356  $this->obj = $e;
357  $this->id = $e->p_id;
358  $this->parametre = Formulaire_Row::load_all($this->id);
359  }
static load_all($p_id)
load all the row from formulaire_param_detail, children of formulaire_param return an array of object...

Member Function Documentation

Formulaire_Formula::display ( )

Definition at line 361 of file class_formulaire_param.php.

362  {
363  echo $this->obj->p_libelle;
364  }
Formulaire_Formula::input ( )

input value

Definition at line 398 of file class_formulaire_param.php.

References $_REQUEST, $max, and make_object().

399  {
400  echo '<h4 class="title">' . $this->obj->p_libelle . "(" . $this->obj->p_code . ")" . '</h4>';
401  echo HtmlInput::hidden('p_id[]', $this->obj->p_id);
402  $max = count($this->parametre);
403  echo HtmlInput::hidden("count_" . $this->id, $max);
404  //echo '<h5 class="title">' . 'code ' . $this->obj->p_code . '</h5>';
405  echo '<p>';
406  echo '<table id="table_' . $this->id . '">';
407  for ($i = 0; $i < $max; $i++)
408  {
409  $formula = $this->make_object($i);
410 
411  echo '<tr id="tr_' . $formula->fp_id . '">';
412  echo '<td>';
413  echo $formula->display_row();
414  echo '</td>';
415  echo $formula->button_delete();
416  echo $formula->button_modify();
417  echo '</tr>';
418  }
419  if ($max == 0)
420  echo '<tr></tr>';
421  echo "</table>";
422  echo '</p>';
423  echo HtmlInput::button_anchor(
424  "Ajout d'une ligne", "javascript:void(0)", "add_row" . $this->id, sprintf("onclick=\"add_param_detail('%s','%s','%s','%s');\"", $_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'], $this->id)
425  );
426  }
make_object($p_index)
return an object following the key type_detail of the array passed in parameter
$_REQUEST['sb']
Definition: am_print.php:39
static Formulaire_Row::load_all (   $p_id)
staticinherited

load all the row from formulaire_param_detail, children of formulaire_param return an array of objects Formulaire_Param_Detail

Parameters
type$p_id

Definition at line 250 of file class_formulaire_param.php.

References $cn.

Referenced by __construct().

251  {
252  global $cn;
253  $a_value = $cn->get_array("select fp_id,type_detail from rapport_advanced.formulaire_param_detail where p_id=$1", array($p_id));
254  return $a_value;
255  }
global $cn
Formulaire_Formula::make_object (   $p_index)

return an object following the key type_detail of the array passed in parameter

Parameters
type$p_index
Returns
RAPAV_Formula| RAPAV_Account_Tva| RAPAV_Compute

Definition at line 372 of file class_formulaire_param.php.

Referenced by input().

373  {
374  $elt = $this->parametre[$p_index]['type_detail'];
375  switch ($elt)
376  {
377  case '1':
378  return new RAPAV_Formula($this->parametre[$p_index]['fp_id']);
379  break;
380  case '2':
381  return new RAPAV_Account_Tva($this->parametre[$p_index]['fp_id']);
382  break;
383  case '3':
384  return new RAPAV_Compute($this->parametre[$p_index]['fp_id']);
385  break;
386  case '4':
387  return new RAPAV_Account($this->parametre[$p_index]['fp_id']);
388  break;
389  case '5':
390  return new RAPAV_Reconcile($this->parametre[$p_index]['fp_id']);
391  break;
392  }
393  }
poste comptable utilisé avec le poste comptable, choix entre diff crédit - debit, diff débit-crédit...
poste comptable utilisé avec le poste comptable, choix entre diff crédit - debit, diff débit-crédit...

The documentation for this class was generated from the following file: