diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index de6210ba531..89df1ec2aa4 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -225,7 +225,7 @@ class PrestaShopWebservice * @param string $response String from a CURL response * @return SimpleXMLElement|boolean status_code, response * - * @throw PrestaShopWebserviceException + * @throws PrestaShopWebserviceException */ protected function parseXML($response) { @@ -257,7 +257,7 @@ class PrestaShopWebservice * @param array $options Options * @return SimpleXMLElement|boolean status_code, response * - * @throw PrestaShopWebserviceException + * @throws PrestaShopWebserviceException */ public function add($options) { @@ -310,7 +310,7 @@ class PrestaShopWebservice * @param array $options Array representing resource to get. * @return SimpleXMLElement|boolean status_code, response * - * @throw PrestaShopWebserviceException + * @throws PrestaShopWebserviceException */ public function get($options) { @@ -351,7 +351,7 @@ class PrestaShopWebservice * @param array $options Array representing resource for head request. * @return SimpleXMLElement status_code, response * - * @throw PrestaShopWebserviceException + * @throws PrestaShopWebserviceException */ public function head($options) { @@ -393,7 +393,7 @@ class PrestaShopWebservice * @param array $options Array representing resource to edit. * @return SimpleXMLElement|boolean status_code, response * - * @throw PrestaShopWebserviceException + * @throws PrestaShopWebserviceException */ public function edit($options) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b0e024f699b..cb1b76c2144 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2252,16 +2252,17 @@ class ExtraFields if (in_array($key_type, array('date'))) { $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; - if (GETPOSTISSET($dateparamname_start . 'year') || GETPOSTISSET($dateparamname_end . 'year')) { + + if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { $value_key = array(); // values provided as a component year, month, day, etc. - if (GETPOSTISSET($dateparamname_start . 'year')) { + if (GETPOST($dateparamname_start . 'year')) { $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); } - if (GETPOSTISSET($dateparamname_start . 'year')) { + if (GETPOST($dateparamname_start . 'year')) { $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); } - } elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) { + } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters $value_key = dol_mktime(12, 0, 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); } else { @@ -2270,7 +2271,7 @@ class ExtraFields } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; - if (GETPOSTISSET($dateparamname_start . 'year') && GETPOSTISSET($dateparamname_end . 'year')) { + if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; @@ -2286,7 +2287,7 @@ class ExtraFields 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') ); } - } elseif (GETPOSTISSET($keysuffix."options_".$key.$keyprefix."year")) { + } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters if ($key_type == 'datetimegmt') { $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'gmt'); @@ -2307,7 +2308,7 @@ class ExtraFields $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); } } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); @@ -2315,7 +2316,7 @@ class ExtraFields $value_arr = (array) $value_arr; $value_key = implode(',', $value_arr); } elseif (in_array($key_type, array('price', 'double', 'int'))) { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); @@ -2325,19 +2326,19 @@ class ExtraFields $value_key = $value_arr; } } elseif (in_array($key_type, array('boolean'))) { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { $value_key = ''; } else { $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); $value_key = $value_arr; } } elseif (in_array($key_type, array('html'))) { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } $value_key = dol_htmlcleanlastbr(GETPOST($keysuffix."options_".$key.$keyprefix, 'restricthtml')); } else { - if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index d7eee999b0a..263edddc2b3 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -68,6 +68,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('proj $date_start_event = dol_mktime(GETPOST('date_start_eventhour', 'int'), GETPOST('date_start_eventmin', 'int'), GETPOST('date_start_eventsec', 'int'), GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); $date_end_event = dol_mktime(GETPOST('date_end_eventhour', 'int'), GETPOST('date_end_eventmin', 'int'), GETPOST('date_end_eventsec', 'int'), GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); $location = GETPOST('location', 'alphanohtml'); +$fk_project = GETPOST('fk_project', 'int'); $mine = GETPOST('mode') == 'mine' ? 1 : 0; @@ -205,6 +206,7 @@ if (empty($reshook)) { $db->begin(); $object->ref = GETPOST('ref', 'alphanohtml'); + $object->fk_project = GETPOST('fk_project', 'int'); $object->title = GETPOST('title', 'alphanohtml'); $object->socid = GETPOST('socid', 'int'); $object->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is @@ -304,6 +306,7 @@ if (empty($reshook)) { $old_start_date = $object->date_start; $object->ref = GETPOST('ref', 'alpha'); + $object->fk_project = GETPOST('fk_project', 'int'); $object->title = GETPOST('title', 'alphanohtml'); // Do not use 'alpha' here, we want field as it is $object->statut = GETPOST('status', 'int'); $object->socid = GETPOST('socid', 'int'); @@ -603,6 +606,14 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { // Label print '
| ';
+ print ' '.$langs->trans('Sub-projects').' ';
+ print ' |
| '.$subproject->getNomUrl(1, 'project').' | '; + print ''.$child->title.' | '; + print ''.$subproject->getLibStatut(5).' | '; + print '