Skip to content

Commit

Permalink
Fix bug on Extrafield checkbox
Browse files Browse the repository at this point in the history
Fix bug on ActionComm Update
[ task #900 ] Review code of ficheinter.class.php
  • Loading branch information
FHenry committed May 18, 2013
1 parent 7a6a74f commit fefb21a
Show file tree
Hide file tree
Showing 10 changed files with 1,987 additions and 1,953 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -54,6 +54,7 @@ For users:
- New: [ task #741 ] Add intervention box.
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated.
- New: [ task #823 ] Shipping_validate email notification.
- New: [ task #900 ] Review code of ficheinter.class.php

For translators:
- Update language files.
Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/action/class/actioncomm.class.php
Expand Up @@ -188,8 +188,8 @@ function add($user,$notrigger=0)
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
$sql.= (isset($this->type_id)?$this->type_id:"null");
$sql.= (isset($this->code)?" '".$this->code."'":"null")."," ;
$sql.= (isset($this->type_id)?$this->type_id:"null").",";
$sql.= (isset($this->code)?" '".$this->code."'":"null").",";
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
$sql.= " '".$this->db->escape($this->note)."',";
Expand Down
4 changes: 4 additions & 0 deletions htdocs/comm/propal.php
Expand Up @@ -1845,7 +1845,11 @@

foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} else {
$value=$object->array_options["options_".$key];
}
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/class/commande.class.php
Expand Up @@ -2834,7 +2834,7 @@ function load_state_board()
}

/**
* Update value of extrafields on the proposal
* Update value of extrafields on order
*
* @param User $user Object user that modify
* @return int <0 if ko, >0 if ok
Expand Down
4 changes: 4 additions & 0 deletions htdocs/commande/fiche.php
Expand Up @@ -2145,7 +2145,11 @@

foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} else {
$value=$object->array_options["options_".$key];
}
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
Expand Down
6 changes: 5 additions & 1 deletion htdocs/compta/facture.php
Expand Up @@ -3291,7 +3291,11 @@

foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
if ($action == 'edit_extras') {
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} else {
$value=$object->array_options["options_".$key];
}
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/extrafields.class.php
Expand Up @@ -445,7 +445,7 @@ private function update_label($attrname,$label,$type,$size,$elementtype,$unique=

if(is_array($param) && count($param) > 0)
{
$param = serialize($param);
$param = $this->db->escape(serialize($param));
}

$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/tpl/admin_extrafields_add.tpl.php
Expand Up @@ -49,8 +49,8 @@ function init_typeoffields(type)
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").hide();jQuery("#helpsellist").show();}
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();jQuery("#helpselect").show();jQuery("#helpsellist").hide();}
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
else size.val('').attr('disabled','disabled');
}
Expand Down

0 comments on commit fefb21a

Please sign in to comment.