Fixing style errors.
This commit is contained in:
parent
92aab677e9
commit
ad84aaacc6
@ -397,8 +397,8 @@ if (empty($reshook))
|
|||||||
$object->note = $object->note_private;
|
$object->note = $object->note_private;
|
||||||
}
|
}
|
||||||
$object->customcode = GETPOST('customcode', 'alpha');
|
$object->customcode = GETPOST('customcode', 'alpha');
|
||||||
$object->country_id = GETPOST('country_id', 'int');
|
$object->country_id = GETPOST('country_id', 'int');
|
||||||
$object->state_id = GETPOST('state_id', 'int');
|
$object->state_id = GETPOST('state_id', 'int');
|
||||||
$object->status = GETPOST('statut', 'int');
|
$object->status = GETPOST('statut', 'int');
|
||||||
$object->status_buy = GETPOST('statut_buy', 'int');
|
$object->status_buy = GETPOST('statut_buy', 'int');
|
||||||
$object->status_batch = GETPOST('status_batch', 'aZ09');
|
$object->status_batch = GETPOST('status_batch', 'aZ09');
|
||||||
@ -868,7 +868,7 @@ llxHeader('', $title, $helpurl);
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
$formproduct = new FormProduct($db);
|
$formproduct = new FormProduct($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
@ -903,18 +903,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
}
|
}
|
||||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||||
$objcanvas->display_canvas($action); // Show template
|
$objcanvas->display_canvas($action); // Show template
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// When used in standard mode
|
// When used in standard mode
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
if ($action == 'create' && $usercancreate)
|
if ($action == 'create' && $usercancreate)
|
||||||
{
|
{
|
||||||
|
|
||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function() {
|
$("#selectcountry_id").change(function() {
|
||||||
document.formprod.action.value="create";
|
document.formprod.action.value="create";
|
||||||
@ -934,7 +932,7 @@ print '<script type="text/javascript">';
|
|||||||
{
|
{
|
||||||
$modCodeProduct = new $module();
|
$modCodeProduct = new $module();
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_set_focus('input[name="ref"]');
|
dol_set_focus('input[name="ref"]');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formprod">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formprod">';
|
||||||
@ -956,7 +954,7 @@ print '<script type="text/javascript">';
|
|||||||
}
|
}
|
||||||
$linkback = "";
|
$linkback = "";
|
||||||
print load_fiche_titre($title, $linkback, $picto);
|
print load_fiche_titre($title, $linkback, $picto);
|
||||||
|
|
||||||
// We set country_id, country_code and country for the selected country
|
// We set country_id, country_code and country for the selected country
|
||||||
$object->country_id = GETPOST('country_id') ?GETPOST('country_id') : null;
|
$object->country_id = GETPOST('country_id') ?GETPOST('country_id') : null;
|
||||||
if ($object->country_id)
|
if ($object->country_id)
|
||||||
@ -1150,7 +1148,7 @@ print '<script type="text/javascript">';
|
|||||||
|
|
||||||
// State
|
// State
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_STATE))
|
if (empty($conf->global->PRODUCT_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
if ($conf->browser->layout == 'phone') print '</tr><tr>';
|
if ($conf->browser->layout == 'phone') print '</tr><tr>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
{
|
{
|
||||||
@ -1159,7 +1157,7 @@ print '<script type="text/javascript">';
|
|||||||
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print $formcompany->select_state($object->state_id, $object->country_code);
|
print $formcompany->select_state($object->state_id, $object->country_code);
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1365,9 +1363,6 @@ print '<script type="text/javascript">';
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} elseif ($object->id > 0) {
|
} elseif ($object->id > 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Product card
|
* Product card
|
||||||
*/
|
*/
|
||||||
@ -1376,8 +1371,8 @@ print '<script type="text/javascript">';
|
|||||||
{
|
{
|
||||||
//WYSIWYG Editor
|
//WYSIWYG Editor
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
$("#selectcountry_id").change(function() {
|
$("#selectcountry_id").change(function() {
|
||||||
document.formprod.action.value="edit";
|
document.formprod.action.value="edit";
|
||||||
@ -1385,17 +1380,17 @@ print '<script type="text/javascript">';
|
|||||||
});
|
});
|
||||||
});';
|
});';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
|
|
||||||
// We set country_id, country_code and country for the selected country
|
// We set country_id, country_code and country for the selected country
|
||||||
$object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id;
|
$object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id;
|
||||||
if ($object->country_id)
|
if ($object->country_id)
|
||||||
{
|
{
|
||||||
$tmparray = getCountry($object->country_id, 'all');
|
$tmparray = getCountry($object->country_id, 'all');
|
||||||
$object->country_code = $tmparray['code'];
|
$object->country_code = $tmparray['code'];
|
||||||
$object->country = $tmparray['label'];
|
$object->country = $tmparray['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$type = $langs->trans('Product');
|
$type = $langs->trans('Product');
|
||||||
if ($object->isService()) $type = $langs->trans('Service');
|
if ($object->isService()) $type = $langs->trans('Service');
|
||||||
//print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), "");
|
//print load_fiche_titre($langs->trans('Modify').' '.$type.' : '.(is_object($object->oldcopy)?$object->oldcopy->ref:$object->ref), "");
|
||||||
@ -1411,7 +1406,7 @@ print '<script type="text/javascript">';
|
|||||||
$titre = $langs->trans("CardProduct".$object->type);
|
$titre = $langs->trans("CardProduct".$object->type);
|
||||||
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
|
$picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product');
|
||||||
dol_fiche_head($head, 'card', $titre, 0, $picto);
|
dol_fiche_head($head, 'card', $titre, 0, $picto);
|
||||||
|
|
||||||
|
|
||||||
print '<table class="border allwidth">';
|
print '<table class="border allwidth">';
|
||||||
|
|
||||||
@ -1594,29 +1589,29 @@ print '<script type="text/javascript">';
|
|||||||
if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.$object->customcode.'"></td></tr>';
|
print '<tr><td>'.$langs->trans("CustomCode").'</td><td><input name="customcode" class="maxwidth100onsmartphone" value="'.$object->customcode.'"></td></tr>';
|
||||||
// Origin country
|
// Origin country
|
||||||
print '<td>'.$langs->trans("CountryOrigin").'</td>';
|
print '<td>'.$langs->trans("CountryOrigin").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||||
print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
|
print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// State
|
// State
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_STATE))
|
if (empty($conf->global->PRODUCT_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
if ($conf->browser->layout == 'phone') print '</tr><tr>';
|
if ($conf->browser->layout == 'phone') print '</tr><tr>';
|
||||||
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
{
|
{
|
||||||
print '<td>'.$form->editfieldkey('Region-StateOrigine', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
print '<td>'.$form->editfieldkey('Region-StateOrigine', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
||||||
} else {
|
} else {
|
||||||
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
print '<td>'.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).'</td><td colspan="3">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print $formcompany->select_state($object->state_id, $object->country_code);
|
print $formcompany->select_state($object->state_id, $object->country_code);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"', 'cols' => 3);
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => 3);
|
||||||
@ -2113,8 +2108,8 @@ print '<script type="text/javascript">';
|
|||||||
|
|
||||||
// Origin country code
|
// Origin country code
|
||||||
print '<tr><td>'.$langs->trans("Origin").'</td><td colspan="2">'.getCountry($object->country_id, 0, $db);
|
print '<tr><td>'.$langs->trans("Origin").'</td><td colspan="2">'.getCountry($object->country_id, 0, $db);
|
||||||
if (!empty($object->state_id)) print ' - '.getState($object->state_id, 0, $db);
|
if (!empty($object->state_id)) print ' - '.getState($object->state_id, 0, $db);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
|
|||||||
@ -882,7 +882,7 @@ class Product extends CommonObject
|
|||||||
if (empty($this->country_id)) {
|
if (empty($this->country_id)) {
|
||||||
$this->country_id = 0;
|
$this->country_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->state_id)) {
|
if (empty($this->state_id)) {
|
||||||
$this->state_id = 0;
|
$this->state_id = 0;
|
||||||
}
|
}
|
||||||
@ -1004,7 +1004,7 @@ class Product extends CommonObject
|
|||||||
$sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null');
|
$sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null');
|
||||||
$sql .= ", customcode = '".$this->db->escape($this->customcode)."'";
|
$sql .= ", customcode = '".$this->db->escape($this->customcode)."'";
|
||||||
$sql .= ", fk_country = ".($this->country_id > 0 ? (int) $this->country_id : 'null');
|
$sql .= ", fk_country = ".($this->country_id > 0 ? (int) $this->country_id : 'null');
|
||||||
$sql .= ", fk_state = ".($this->state_id > 0 ? (int) $this->state_id : 'null');
|
$sql .= ", fk_state = ".($this->state_id > 0 ? (int) $this->state_id : 'null');
|
||||||
$sql .= ", note = ".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : 'null');
|
$sql .= ", note = ".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : 'null');
|
||||||
$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
|
$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
|
||||||
$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
|
$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user