dolibarr  7.0.0-beta
objectonoff.php
1 <?php
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
22 if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
23 if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
24 if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
25 if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
26 if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
27 if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
28 
29 require '../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php';
31 
32 $action=GETPOST('action','alpha');
33 $id=GETPOST('id', 'int');
34 $value=GETPOST('value', 'int');
35 $field=GETPOST('field', 'alpha');
36 $element=GETPOST('element', 'alpha');
37 
38 $object = new GenericObject($db);
39 /*
40  * View
41  */
42 
43 top_httphead();
44 
45 print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
46 
47 // Registering new values
48 if (($action == 'set') && ! empty($id))
49  $object->setValueFrom($field, $value, $element, $id);
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
Class of a generic business object.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html')
Show HTTP header.
Definition: main.inc.php:1052