--- /tmp/dsg/dolibarr/htdocs/product/dynamic_price/github_19.0.3_editor.php +++ /tmp/dsg/dolibarr/htdocs/product/dynamic_price/client_editor.php @@ -24 +23,0 @@ -// Load Dolibarr environment @@ -37 +36 @@ -$action = GETPOST('action', 'aZ09'); +$action = GETPOST('action', 'alpha'); @@ -55 +54,2 @@ -if (empty($eid)) { //This also disables fetch when eid == 0 +if (empty($eid)) //This also disables fetch when eid == 0 +{ @@ -57 +57,3 @@ -} elseif ($action != 'delete') { +} +elseif ($action != 'delete') +{ @@ -66,2 +68,4 @@ -if ($action == 'add') { - if ($eid == 0) { +if ($action == 'add') +{ + if ($eid == 0) + { @@ -69,3 +73,3 @@ - if ($result == 0) { //No existing entry found with title, ok - // Check the expression validity by parsing it - require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; + if ($result == 0) //No existing entry found with title, ok + { + //Check the expression validity by parsing it @@ -76 +80,3 @@ - } else { + } + else + { @@ -80 +86,2 @@ - if ($result > 0) { //created successfully, set the eid to newly created entry + if ($result > 0) //created successfully, set the eid to newly created entry + { @@ -83 +90,3 @@ - } else { + } + else + { @@ -87 +96,3 @@ - } elseif ($result < 0) { + } + elseif ($result < 0) + { @@ -89 +100,3 @@ - } else { + } + else + { @@ -95,2 +108,4 @@ -if ($action == 'update') { - if ($eid != 0) { +if ($action == 'update') +{ + if ($eid != 0) + { @@ -98,3 +113,3 @@ - if ($result == 0 || $result == $eid) { //No existing entry found with title or existing one is the current one, ok - // Check the expression validity by parsing it - require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; + if ($result == 0 || $result == $eid) //No existing entry found with title or existing one is the current one, ok + { + //Check the expression validity by parsing it @@ -105 +120,3 @@ - } else { + } + else + { @@ -110 +127,2 @@ - if ($result < 0) { + if ($result < 0) + { @@ -112 +130,3 @@ - } else { + } + else + { @@ -116 +136,3 @@ - } elseif ($result < 0) { + } + elseif ($result < 0) + { @@ -118 +140,3 @@ - } else { + } + else + { @@ -124,2 +148,4 @@ -if ($action == 'delete') { - if ($eid != 0) { +if ($action == 'delete') +{ + if ($eid != 0) + { @@ -128 +154,2 @@ - if ($result < 0) { + if ($result < 0) + { @@ -151 +178 @@ -print dol_get_fiche_head(); +dol_fiche_head(); @@ -176 +203 @@ - $help_text .= '
#global_'.$entry->code.'# '.$entry->description.' = '.$entry->value; + $help_text .= '
#globals_'.$entry->code.'# '.$entry->description.' = '.$entry->value; @@ -187 +214 @@ -print dol_get_fiche_end(); +dol_fiche_end(); @@ -191 +218 @@ -print ''; +print ''; @@ -193 +220,2 @@ -if ($eid == 0) { +if ($eid == 0) +{ @@ -195,2 +223,4 @@ -} else { - print '
'.$langs->trans("Delete").'
'; +} +else +{ + print '
'.$langs->trans("Delete").'
'; @@ -210 +240 @@ - window.location = "'.str_replace('dynamic_price/editor.php', $tab.'.php', $_SERVER["PHP_SELF"]).'?id='.$id.($tab == 'price' ? '&action=edit_price&token='.newToken() : '').'"; + window.location = "'.str_replace('dynamic_price/editor.php', $tab.'.php', $_SERVER["PHP_SELF"]).'?id='.$id.($tab == 'price' ? '&action=edit_price' : '').'";