dolibarr  13.0.2
projects.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
3  * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2007-2020 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2014-2015 Marcos GarcĂ­a <marcosgdf@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
26 if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
27 if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
28 if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
29 if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
30 if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
31 if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
32 if (empty($_GET['keysearch']) && !defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
33 
34 require '../../main.inc.php';
35 
36 $htmlname = GETPOST('htmlname', 'aZ09');
37 $socid = GETPOST('socid', 'int');
38 $discard_closed = GETPOST('discardclosed', 'int');
39 
40 
41 /*
42  * View
43  */
44 
45 dol_syslog("Call ajax projet/ajax/projects.php");
46 //dol_syslog(join(',', $_GET));
47 
48 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
49 
50 top_httphead();
51 
52 if (empty($htmlname) && !GETPOST('mode', 'aZ09')) return;
53 
54 // Mode to get list of projects
55 if (!GETPOST('mode', 'aZ09') || GETPOST('mode', 'aZ09') != 'gettasks') {
56  // When used from jQuery, the search term is added as GET param "term".
57  $searchkey = (GETPOSTISSET($htmlname) ? GETPOST($htmlname, 'aZ09') : '');
58 
59  $formproject = new FormProjets($db);
60  $arrayresult = $formproject->select_projects_list($socid, '', $htmlname, 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey);
61 }
62 
63 // Mode to get list of tasks
64 if (GETPOST('mode', 'aZ09') == 'gettasks') {
65  $formproject = new FormProjets($db);
66  $formproject->selectTasks((!empty($$socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), '');
67  return;
68 }
69 
70 
71 $db->close();
72 
73 print json_encode($arrayresult);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1214
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage building of HTML components.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.
Definition: index.php:89