Skip to content

Commit

Permalink
#154 [RegistrationCertificate] add: stock json after api request
Browse files Browse the repository at this point in the history
  • Loading branch information
evarisk-theo committed Mar 31, 2023
1 parent 3ded322 commit f938998
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions class/registrationcertificatefr.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class RegistrationCertificateFr extends CommonObject
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1', 'label'=>'LinkedProduct', 'enabled'=>'1', 'position'=>13, 'notnull'=>0, 'visible'=>1, 'css'=>'maxwidth500'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>16, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'validate'=>'1',),
'fk_lot' => array('type'=>'integer:Productlot:product/stock/class/productlot.class.php:1', 'label'=>'DolicarBatch', 'enabled'=>'1', 'position'=>15, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'validate'=>'1',),
'json' => array('type'=>'text', 'label'=>'JSON', 'enabled'=>'1', 'position'=>15, 'notnull'=>-1, 'visible'=>3, 'index'=>1, 'css'=>'maxwidth500'),
);
// BEGIN MODULEBUILDER PROPERTIES
public $rowid;
Expand Down Expand Up @@ -222,6 +223,7 @@ class RegistrationCertificateFr extends CommonObject
public $z4_specific_details;
public $fk_project;
public $fk_lot;
public $json;
// END MODULEBUILDER PROPERTIES


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
$object->z2_specific_details = '';
$object->z3_specific_details = '';
$object->z4_specific_details = '';
$object->json = json_encode($registrationCertificateObject);

$registrationCertificateId = $object->create($user);

Expand Down Expand Up @@ -199,6 +200,7 @@
$_POST['z2_specific_details'] = '';
$_POST['z3_specific_details'] = '';
$_POST['z4_specific_details'] = '';
$_POST['json'] = json_encode($registrationCertificateObject);

$action = 'create';
}
Expand Down
3 changes: 2 additions & 1 deletion sql/llx_dolicar_registrationcertificatefr.sql
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ CREATE TABLE llx_dolicar_registrationcertificatefr(
z4_specific_details text,
fk_product integer NOT NULL,
fk_project integer,
fk_lot integer
fk_lot integer,
json longtext
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
3 changes: 2 additions & 1 deletion sql/update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ ALTER TABLE `llx_dolicar_registrationcertificatefr` ADD `fk_product` integer NOT
ALTER TABLE `llx_dolicar_registrationcertificatefr` DROP `d3_vehicle_model`;
ALTER TABLE `llx_dolicar_registrationcertificatefr` ADD `d3_vehicle_model` varchar(128) NULL AFTER `d21_vehicle_cnit`;

-- 0.0.2
-- 1.0.0
ALTER TABLE llx_dolicar_registrationcertificatefr CHANGE c4a_owner_vehicle `c4a_vehicle_owner` boolean;
ALTER TABLE llx_dolicar_registrationcertificatefr CHANGE c41_ownerNumber `c41_second_owner_number` integer;
ALTER TABLE llx_dolicar_registrationcertificatefr CHANGE f1_techincal_ptac `f1_technical_ptac` integer;
ALTER TABLE llx_dolicar_registrationcertificatefr CHANGE j_vehicleCategory `j_vehicle_category` varchar(128);
ALTER TABLE llx_dolicar_registrationcertificatefr CHANGE s1_seatingCapacity `s1_seating_capacity` integer;
ALTER TABLE `llx_dolicar_registrationcertificatefr` ADD `json` longtext AFTER `z4_specific_details`;
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@
$fieldName = 'field_' . strtolower($registrationCertificateCode);
$confName = 'DOLICAR_' . $registrationCertificateCode . '_VISIBLE';
if ($conf->global->$confName < 1) {

?>
<script>
$('.' + <?php echo json_encode($fieldName); ?>).hide()
Expand All @@ -300,6 +299,11 @@
}
}
}
?>
<script>
$('.' + <?php echo json_encode('field_json'); ?>).hide()
</script>
<?php

print '</form>';

Expand Down

0 comments on commit f938998

Please sign in to comment.