@@ -1003,7 +1003,9 @@ discard block |
||
| 1003 | 1003 | $files = dol_dir_list($newpathofdestdir); |
| 1004 | 1004 | if (!empty($files) && is_array($files)) { |
| 1005 | 1005 | foreach ($files as $key => $file) { |
| 1006 | - if (!file_exists($file["fullname"])) continue; |
|
| 1006 | + if (!file_exists($file["fullname"])) { |
|
| 1007 | + continue; |
|
| 1008 | + } |
|
| 1007 | 1009 | $filepath = $file["path"]; |
| 1008 | 1010 | $oldname = $file["name"]; |
| 1009 | 1011 | |
@@ -1718,7 +1720,9 @@ discard block |
||
| 1718 | 1720 | // Update index table of files (llx_ecm_files) |
| 1719 | 1721 | if ($donotupdatesession == 1) { |
| 1720 | 1722 | $sharefile = 0; |
| 1721 | - if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) $sharefile = 1; |
|
| 1723 | + if ($TFile['type'][$i] == 'application/pdf' && strpos($_SERVER["REQUEST_URI"], 'product') !== false && !empty($conf->global->PRODUCT_ALLOW_EXTERNAL_DOWNLOAD)) { |
|
| 1724 | + $sharefile = 1; |
|
| 1725 | + } |
|
| 1722 | 1726 | $result = addFileIntoDatabaseIndex($upload_dir, basename($destfile).($resupload == 2 ? '.noexe' : ''), $TFile['name'][$i], 'uploaded', $sharefile, $object); |
| 1723 | 1727 | if ($result < 0) { |
| 1724 | 1728 | if ($allowoverwrite) { |
@@ -1873,8 +1877,12 @@ discard block |
||
| 1873 | 1877 | dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); |
| 1874 | 1878 | return -1; |
| 1875 | 1879 | } |
| 1876 | - if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description; |
|
| 1877 | - if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords; |
|
| 1880 | + if (isset($object->src_object_description)) { |
|
| 1881 | + $ecmfile->description = $object->src_object_description; |
|
| 1882 | + } |
|
| 1883 | + if (isset($object->src_object_keywords)) { |
|
| 1884 | + $ecmfile->keywords = $object->src_object_keywords; |
|
| 1885 | + } |
|
| 1878 | 1886 | } |
| 1879 | 1887 | |
| 1880 | 1888 | if (!empty($conf->global->MAIN_FORCE_SHARING_ON_ANY_UPLOADED_FILE)) { |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | $return = move_uploaded_file($src_file_osencoded, $file_name_osencoded); |
| 1306 | 1306 | if ($return) { |
| 1307 | 1307 | dolChmod($file_name_osencoded); |
| 1308 | - dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=" . getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
| 1308 | + dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
| 1309 | 1309 | return $successcode; // Success |
| 1310 | 1310 | } else { |
| 1311 | 1311 | dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); |
@@ -1818,7 +1818,7 @@ discard block |
||
| 1818 | 1818 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
| 1819 | 1819 | $maxheightmini = $tmparraysize['maxheightmini']; |
| 1820 | 1820 | //$quality = $tmparraysize['quality']; |
| 1821 | - $quality = 50; // For thumbs, we force quality to 50 |
|
| 1821 | + $quality = 50; // For thumbs, we force quality to 50 |
|
| 1822 | 1822 | |
| 1823 | 1823 | // Generate thumbs. |
| 1824 | 1824 | if ($generatethumbs) { |
@@ -1997,7 +1997,7 @@ discard block |
||
| 1997 | 1997 | if (isset($object->table_element)) { |
| 1998 | 1998 | $ecmfile->src_object_type = $object->table_element; |
| 1999 | 1999 | } else { |
| 2000 | - dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); |
|
| 2000 | + dol_syslog('Error: object '.get_class($object).' has no table_element attribute.'); |
|
| 2001 | 2001 | return -1; |
| 2002 | 2002 | } |
| 2003 | 2003 | if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description; |
@@ -2197,9 +2197,9 @@ discard block |
||
| 2197 | 2197 | // Skip directories (they would be added automatically) |
| 2198 | 2198 | if (!$file->isDir()) { |
| 2199 | 2199 | // Get real and relative path for current file |
| 2200 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2200 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2201 | 2201 | $fileName = $file->getFilename(); |
| 2202 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2202 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2203 | 2203 | |
| 2204 | 2204 | //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1); |
| 2205 | 2205 | $relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1); |
@@ -2461,9 +2461,9 @@ discard block |
||
| 2461 | 2461 | // Skip directories (they would be added automatically) |
| 2462 | 2462 | if (!$file->isDir()) { |
| 2463 | 2463 | // Get real and relative path for current file |
| 2464 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2464 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
| 2465 | 2465 | $fileName = $file->getFilename(); |
| 2466 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2466 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
| 2467 | 2467 | |
| 2468 | 2468 | //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1); |
| 2469 | 2469 | $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1); |
@@ -2524,7 +2524,7 @@ discard block |
||
| 2524 | 2524 | function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(\.meta|_preview.*\.png)$', '^\.'), $nohook = false, $mode = '') |
| 2525 | 2525 | { |
| 2526 | 2526 | $tmparray = dol_dir_list($dir, 'files', 0, $regexfilter, $excludefilter, 'date', SORT_DESC, $mode, $nohook); |
| 2527 | - return isset($tmparray[0])?$tmparray[0]:null; |
|
| 2527 | + return isset($tmparray[0]) ? $tmparray[0] : null; |
|
| 2528 | 2528 | } |
| 2529 | 2529 | |
| 2530 | 2530 | /** |
@@ -335,7 +335,9 @@ |
||
| 335 | 335 | if ($AutoSendMail && !$error) { |
| 336 | 336 | // send a mail to the user |
| 337 | 337 | $returnSendMail = sendMail($result, $cancreate, $now, $autoValidation); |
| 338 | - if (!empty($returnSendMail->msg)) setEventMessage($returnSendMail->msg, $returnSendMail->style); |
|
| 338 | + if (!empty($returnSendMail->msg)) { |
|
| 339 | + setEventMessage($returnSendMail->msg, $returnSendMail->style); |
|
| 340 | + } |
|
| 339 | 341 | } |
| 340 | 342 | } |
| 341 | 343 | } |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | $action = GETPOST('action', 'aZ09'); |
| 47 | 47 | $cancel = GETPOST('cancel', 'alpha'); |
| 48 | 48 | $confirm = GETPOST('confirm', 'alpha'); |
| 49 | -$id = GETPOST('id', 'int'); |
|
| 50 | -$ref = GETPOST('ref', 'alpha'); |
|
| 49 | +$id = GETPOST('id', 'int'); |
|
| 50 | +$ref = GETPOST('ref', 'alpha'); |
|
| 51 | 51 | $fuserid = (GETPOST('fuserid', 'int') ?GETPOST('fuserid', 'int') : $user->id); |
| 52 | -$users = (GETPOST('users', 'array') ?GETPOST('users', 'array') : array($user->id)); |
|
| 52 | +$users = (GETPOST('users', 'array') ?GETPOST('users', 'array') : array($user->id)); |
|
| 53 | 53 | $groups = GETPOST('groups', 'array'); |
| 54 | 54 | $socid = GETPOST('socid', 'int'); |
| 55 | -$autoValidation = GETPOST('autoValidation', 'int'); |
|
| 56 | -$AutoSendMail = GETPOST('AutoSendMail', 'int'); |
|
| 55 | +$autoValidation = GETPOST('autoValidation', 'int'); |
|
| 56 | +$AutoSendMail = GETPOST('AutoSendMail', 'int'); |
|
| 57 | 57 | // Load translation files required by the page |
| 58 | 58 | $langs->loadLangs(array("other", "holiday", "mails", "trips")); |
| 59 | 59 | |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if (!$error) { |
| 166 | - $users = GETPOST('users', 'array'); |
|
| 167 | - $groups = GETPOST('groups', 'array'); |
|
| 166 | + $users = GETPOST('users', 'array'); |
|
| 167 | + $groups = GETPOST('groups', 'array'); |
|
| 168 | 168 | |
| 169 | 169 | $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); |
| 170 | 170 | $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); |
@@ -264,9 +264,9 @@ discard block |
||
| 264 | 264 | // usergroup select |
| 265 | 265 | // better perf on single sql |
| 266 | 266 | /** GROUPS */ |
| 267 | - $sql = ' SELECT DISTINCT u.rowid,u.lastname,u.firstname from ' . MAIN_DB_PREFIX . 'user as u'; |
|
| 268 | - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'usergroup_user as ug on ug.fk_user = u.rowid '; |
|
| 269 | - $sql .= ' WHERE fk_usergroup in (' .$db->sanitize(implode(',', $groups)) . ')'; |
|
| 267 | + $sql = ' SELECT DISTINCT u.rowid,u.lastname,u.firstname from '.MAIN_DB_PREFIX.'user as u'; |
|
| 268 | + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'usergroup_user as ug on ug.fk_user = u.rowid '; |
|
| 269 | + $sql .= ' WHERE fk_usergroup in ('.$db->sanitize(implode(',', $groups)).')'; |
|
| 270 | 270 | $resql = $db->query($sql); |
| 271 | 271 | |
| 272 | 272 | if ($resql) { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $result = $userError->fetch($u); |
| 291 | 291 | |
| 292 | 292 | if ($result) { |
| 293 | - setEventMessages($langs->trans("UseralreadyCPexist", $userError->firstname . ' '. $userError->lastname), null, 'errors'); |
|
| 293 | + setEventMessages($langs->trans("UseralreadyCPexist", $userError->firstname.' '.$userError->lastname), null, 'errors'); |
|
| 294 | 294 | } else { |
| 295 | 295 | setEventMessages($langs->trans("ErrorUserFetch", $u), null, 'errors'); |
| 296 | 296 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $htemp->statut = Holiday::STATUS_VALIDATED; |
| 328 | 328 | $resultValidated = $htemp->update($approverid); |
| 329 | 329 | |
| 330 | - if ($resultValidated < 0 ) { |
|
| 330 | + if ($resultValidated < 0) { |
|
| 331 | 331 | setEventMessages($object->error, $object->errors, 'errors'); |
| 332 | 332 | $error++; |
| 333 | 333 | } |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | print '<td>'; |
| 496 | 496 | print img_picto($langs->trans("groups"), 'group', 'class="pictofixedwidth"'); |
| 497 | 497 | |
| 498 | - $sql =' SELECT rowid, nom from '.MAIN_DB_PREFIX.'usergroup WHERE entity IN ('.getEntity('usergroup').')'; |
|
| 498 | + $sql = ' SELECT rowid, nom from '.MAIN_DB_PREFIX.'usergroup WHERE entity IN ('.getEntity('usergroup').')'; |
|
| 499 | 499 | $resql = $db->query($sql); |
| 500 | 500 | $Tgroup = array(); |
| 501 | 501 | while ($obj = $db->fetch_object($resql)) { |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | - print img_picto('', 'users') . $form->multiselectarray('users', $userlist, GETPOST('users', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); |
|
| 527 | + print img_picto('', 'users').$form->multiselectarray('users', $userlist, GETPOST('users', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); |
|
| 528 | 528 | print '</td>'; |
| 529 | 529 | |
| 530 | 530 | // Type |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | $objStd->error++; |
| 701 | 701 | $objStd->msg = $langs->trans('ErroremailTo'); |
| 702 | 702 | $objStd->status = 'error'; |
| 703 | - $objStd->style="warnings"; |
|
| 703 | + $objStd->style = "warnings"; |
|
| 704 | 704 | return $objStd; |
| 705 | 705 | } |
| 706 | 706 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | |
| 727 | 727 | // option to warn the validator in case of too short delay |
| 728 | 728 | if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY)) { |
| 729 | - $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
| 729 | + $delayForRequest = 0; // TODO Set delay depending of holiday leave type |
|
| 730 | 730 | if ($delayForRequest) { |
| 731 | 731 | $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd'); |
| 732 | 732 | |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | $endhalfdaykey = "Afternoon"; |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | - $link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id; |
|
| 765 | + $link = dol_buildpath("/holiday/card.php", 3).'?id='.$object->id; |
|
| 766 | 766 | |
| 767 | 767 | $message .= "<ul>"; |
| 768 | 768 | $message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n"; |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | if (!$result) { |
| 782 | 782 | $objStd->error++; |
| 783 | 783 | $objStd->msg = $langs->trans('ErroreSendmail'); |
| 784 | - $objStd->style="warnings"; |
|
| 784 | + $objStd->style = "warnings"; |
|
| 785 | 785 | $objStd->status = 'error'; |
| 786 | 786 | } else { |
| 787 | 787 | $objStd->msg = $langs->trans('mailSended'); |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $objStd->error++; |
| 793 | 793 | $objStd->msg = $langs->trans('ErroreVerif'); |
| 794 | 794 | $objStd->status = 'error'; |
| 795 | - $objStd->style="errors"; |
|
| 795 | + $objStd->style = "errors"; |
|
| 796 | 796 | return $objStd; |
| 797 | 797 | } |
| 798 | 798 | } |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | $objStd->error++; |
| 801 | 801 | $objStd->msg = $langs->trans('ErrorloadUserOnSendingMail'); |
| 802 | 802 | $objStd->status = 'error'; |
| 803 | - $objStd->style="warnings"; |
|
| 803 | + $objStd->style = "warnings"; |
|
| 804 | 804 | return $objStd; |
| 805 | 805 | } |
| 806 | 806 | |
@@ -115,9 +115,9 @@ |
||
| 115 | 115 | |
| 116 | 116 | $now = dol_now(); |
| 117 | 117 | |
| 118 | -$title = $object->ref . ' - ' . $langs->trans("Notes"); |
|
| 118 | +$title = $object->ref.' - '.$langs->trans("Notes"); |
|
| 119 | 119 | if (!empty($withproject)) { |
| 120 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
| 120 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 121 | 121 | } |
| 122 | 122 | $help_url = ''; |
| 123 | 123 | |
@@ -121,9 +121,9 @@ |
||
| 121 | 121 | */ |
| 122 | 122 | $form = new Form($db); |
| 123 | 123 | |
| 124 | -$title = $object->ref . ' - ' . $langs->trans("Documents"); |
|
| 124 | +$title = $object->ref.' - '.$langs->trans("Documents"); |
|
| 125 | 125 | if (!empty($withproject)) { |
| 126 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
| 126 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 127 | 127 | } |
| 128 | 128 | $help_url = ''; |
| 129 | 129 | |
@@ -146,9 +146,9 @@ |
||
| 146 | 146 | $userstatic = new User($db); |
| 147 | 147 | $result = $projectstatic->fetch($object->fk_project); |
| 148 | 148 | |
| 149 | -$title = $object->ref . ' - ' . $langs->trans("Contacts"); |
|
| 149 | +$title = $object->ref.' - '.$langs->trans("Contacts"); |
|
| 150 | 150 | if (!empty($withproject)) { |
| 151 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '') ; |
|
| 151 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
| 152 | 152 | } |
| 153 | 153 | $help_url = ''; |
| 154 | 154 | |
@@ -181,7 +181,9 @@ discard block |
||
| 181 | 181 | $sql .= " WHERE datef between ".$wheretail; |
| 182 | 182 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 183 | 183 | $sql .= " AND t.fk_statut <> ".Facture::STATUS_DRAFT; |
| 184 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 184 | + if (!empty($projectid)) { |
|
| 185 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 186 | + } |
|
| 185 | 187 | } |
| 186 | 188 | // Vendor invoices |
| 187 | 189 | if (GETPOST('selectsupplierinvoices') && !empty($listofchoices['selectsupplierinvoices']['perms'])) { |
@@ -193,7 +195,9 @@ discard block |
||
| 193 | 195 | $sql .= " WHERE datef between ".$wheretail; |
| 194 | 196 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 195 | 197 | $sql .= " AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT; |
| 196 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 198 | + if (!empty($projectid)) { |
|
| 199 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 200 | + } |
|
| 197 | 201 | } |
| 198 | 202 | // Expense reports |
| 199 | 203 | if (GETPOST('selectexpensereports') && !empty($listofchoices['selectexpensereports']['perms']) && empty($projectid)) { |
@@ -216,7 +220,9 @@ discard block |
||
| 216 | 220 | $sql .= " WHERE datedon between ".$wheretail; |
| 217 | 221 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 218 | 222 | $sql .= " AND t.fk_statut <> ".Don::STATUS_DRAFT; |
| 219 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 223 | + if (!empty($projectid)) { |
|
| 224 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 225 | + } |
|
| 220 | 226 | } |
| 221 | 227 | // Payments of salaries |
| 222 | 228 | if (GETPOST('selectpaymentsofsalaries') && !empty($listofchoices['selectpaymentsofsalaries']['perms'])) { |
@@ -228,7 +234,9 @@ discard block |
||
| 228 | 234 | $sql .= " WHERE datep between ".$wheretail; |
| 229 | 235 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 230 | 236 | //$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT; |
| 231 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 237 | + if (!empty($projectid)) { |
|
| 238 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 239 | + } |
|
| 232 | 240 | } |
| 233 | 241 | // Social contributions |
| 234 | 242 | if (GETPOST('selectsocialcontributions') && !empty($listofchoices['selectsocialcontributions']['perms'])) { |
@@ -240,7 +248,9 @@ discard block |
||
| 240 | 248 | $sql .= " WHERE t.date_ech between ".$wheretail; |
| 241 | 249 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 242 | 250 | //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; |
| 243 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 251 | + if (!empty($projectid)) { |
|
| 252 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 253 | + } |
|
| 244 | 254 | } |
| 245 | 255 | // Various payments |
| 246 | 256 | if (GETPOST('selectvariouspayment') && !empty($listofchoices['selectvariouspayment']['perms'])) { |
@@ -251,7 +261,9 @@ discard block |
||
| 251 | 261 | $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t"; |
| 252 | 262 | $sql .= " WHERE datep between ".$wheretail; |
| 253 | 263 | $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; |
| 254 | - if (!empty($projectid)) $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 264 | + if (!empty($projectid)) { |
|
| 265 | + $sql .= " AND fk_projet = ".((int) $projectid); |
|
| 266 | + } |
|
| 255 | 267 | } |
| 256 | 268 | // Loan payments |
| 257 | 269 | if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms']) && empty($projectid)) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)), |
| 143 | 143 | 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)), |
| 144 | 144 | 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)), |
| 145 | - 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)), |
|
| 145 | + 'selectloanspayment'=>array('label'=>'PaymentLoan', 'picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)), |
|
| 146 | 146 | ); |
| 147 | 147 | |
| 148 | 148 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $zipname .= '_'.$project->ref; |
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | - $zipname .='_export.zip'; |
|
| 513 | + $zipname .= '_export.zip'; |
|
| 514 | 514 | |
| 515 | 515 | dol_delete_file($zipname); |
| 516 | 516 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $actionType = 'delete'; |
| 63 | 63 | $n++; |
| 64 | 64 | $id = 'mybuttonid'.$n; |
| 65 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 65 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 66 | 66 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
| 67 | 67 | |
| 68 | 68 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $actionType = 'danger'; |
| 71 | 71 | $n++; |
| 72 | 72 | $id = 'mybuttonid'.$n; |
| 73 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 73 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 74 | 74 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
| 75 | 75 | |
| 76 | 76 | ?> |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $actionType = 'delete'; |
| 96 | 96 | $n++; |
| 97 | 97 | $id = 'mybuttonid'.$n; |
| 98 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 98 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 99 | 99 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
| 100 | 100 | |
| 101 | 101 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $actionType = 'danger'; |
| 104 | 104 | $n++; |
| 105 | 105 | $id = 'mybuttonid'.$n; |
| 106 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 106 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 107 | 107 | print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); |
| 108 | 108 | |
| 109 | 109 | ?> |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $actionType = 'delete'; |
| 135 | 135 | $n++; |
| 136 | 136 | $id = 'mybuttonid'.$n; |
| 137 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 137 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 138 | 138 | |
| 139 | 139 | $params = array( |
| 140 | 140 | 'confirm' => array( |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $actionType = 'delete'; |
| 174 | 174 | $n++; |
| 175 | 175 | $id = 'mybuttonid'.$n; |
| 176 | - $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; |
|
| 176 | + $url = $_SERVER['PHP_SELF'].'?token='.newToken().'#'.$id; |
|
| 177 | 177 | |
| 178 | 178 | $params = array( |
| 179 | 179 | 'confirm' => array( |
@@ -1860,7 +1860,9 @@ |
||
| 1860 | 1860 | } |
| 1861 | 1861 | } |
| 1862 | 1862 | } |
| 1863 | - if (!empty($toprint)) $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 1863 | + if (!empty($toprint)) { |
|
| 1864 | + $value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 1865 | + } |
|
| 1864 | 1866 | } else { |
| 1865 | 1867 | dol_syslog(get_class($this).'::showOutputField error '.$this->db->lasterror(), LOG_WARNING); |
| 1866 | 1868 | } |
@@ -1026,9 +1026,9 @@ discard block |
||
| 1026 | 1026 | // search filter on a date extrafield shows two inputs to select a date range |
| 1027 | 1027 | $prefill = array( |
| 1028 | 1028 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1029 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
| 1029 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
| 1030 | 1030 | ); |
| 1031 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1031 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1032 | 1032 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
| 1033 | 1033 | $out .= '</div><div class="nowrap">'; |
| 1034 | 1034 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1051,9 +1051,9 @@ discard block |
||
| 1051 | 1051 | // search filter on a date extrafield shows two inputs to select a date range |
| 1052 | 1052 | $prefill = array( |
| 1053 | 1053 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1054 | - 'end' => isset($value['end']) ? $value['end'] : '' |
|
| 1054 | + 'end' => isset($value['end']) ? $value['end'] : '' |
|
| 1055 | 1055 | ); |
| 1056 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1056 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1057 | 1057 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
| 1058 | 1058 | $out .= '</div><div class="nowrap">'; |
| 1059 | 1059 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | // TODO Must also support $moreparam |
| 1063 | 1063 | $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1, '', '', '', 1, '', '', 'tzuserrel'); |
| 1064 | 1064 | } |
| 1065 | - } elseif (in_array($type, array('int', 'integer'))) { |
|
| 1065 | + } elseif (in_array($type, array('int', 'integer'))) { |
|
| 1066 | 1066 | $tmp = explode(',', $size); |
| 1067 | 1067 | $newsize = $tmp[0]; |
| 1068 | 1068 | $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>'; |
@@ -1599,7 +1599,7 @@ discard block |
||
| 1599 | 1599 | |
| 1600 | 1600 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
| 1601 | 1601 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
| 1602 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1602 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1603 | 1603 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
| 1604 | 1604 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
| 1605 | 1605 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1621,7 +1621,7 @@ discard block |
||
| 1621 | 1621 | if ($type == 'date') { |
| 1622 | 1622 | $showsize = 10; |
| 1623 | 1623 | if ($value !== '') { |
| 1624 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1624 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1625 | 1625 | } |
| 1626 | 1626 | } elseif ($type == 'datetime') { |
| 1627 | 1627 | $showsize = 19; |
@@ -1763,13 +1763,13 @@ discard block |
||
| 1763 | 1763 | $toprint = array(); |
| 1764 | 1764 | $obj = $this->db->fetch_object($resql); |
| 1765 | 1765 | if ($obj->rowid) { |
| 1766 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1766 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1767 | 1767 | $c = new Categorie($this->db); |
| 1768 | 1768 | $result = $c->fetch($obj->rowid); |
| 1769 | 1769 | if ($result > 0) { |
| 1770 | 1770 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 1771 | 1771 | foreach ($ways as $way) { |
| 1772 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 1772 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 1773 | 1773 | } |
| 1774 | 1774 | } |
| 1775 | 1775 | } |
@@ -1981,13 +1981,13 @@ discard block |
||
| 1981 | 1981 | { |
| 1982 | 1982 | global $conf, $langs; |
| 1983 | 1983 | |
| 1984 | - $tagtype='tr'; |
|
| 1985 | - $tagtype_dyn='td'; |
|
| 1984 | + $tagtype = 'tr'; |
|
| 1985 | + $tagtype_dyn = 'td'; |
|
| 1986 | 1986 | |
| 1987 | - if ($display_type=='line') { |
|
| 1988 | - $tagtype='div'; |
|
| 1989 | - $tagtype_dyn='span'; |
|
| 1990 | - $colspan=0; |
|
| 1987 | + if ($display_type == 'line') { |
|
| 1988 | + $tagtype = 'div'; |
|
| 1989 | + $tagtype_dyn = 'span'; |
|
| 1990 | + $colspan = 0; |
|
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | $extrafield_param = $this->attributes[$object->table_element]['param'][$key]; |
@@ -2007,12 +2007,12 @@ discard block |
||
| 2007 | 2007 | if ($mode == 'create') { |
| 2008 | 2008 | // On create mode, force separator group to not be collapsable |
| 2009 | 2009 | $extrafield_collapse_display_value = 1; |
| 2010 | - $expand_display = true; // We force group to be shown expanded |
|
| 2010 | + $expand_display = true; // We force group to be shown expanded |
|
| 2011 | 2011 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
| 2012 | 2012 | } |
| 2013 | 2013 | |
| 2014 | - $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">'; |
|
| 2015 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>'; |
|
| 2014 | + $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
|
| 2015 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
| 2016 | 2016 | // Some js code will be injected here to manage the collapsing of extrafields |
| 2017 | 2017 | // Output the picto |
| 2018 | 2018 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2043,14 +2043,14 @@ discard block |
||
| 2043 | 2043 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2044 | 2044 | } |
| 2045 | 2045 | } |
| 2046 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; |
|
| 2046 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n"; |
|
| 2047 | 2047 | $out .= ' console.log("We click on collapse/uncollapse to hide/show .trextrafields_collapse'.$collapse_group.'");'."\n"; |
| 2048 | 2048 | $out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n"; |
| 2049 | 2049 | $out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n"; |
| 2050 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
| 2050 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; |
|
| 2051 | 2051 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2052 | 2052 | $out .= ' } else {'."\n"; |
| 2053 | - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
| 2053 | + $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; |
|
| 2054 | 2054 | $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; |
| 2055 | 2055 | $out .= ' }'."\n"; |
| 2056 | 2056 | $out .= ' });'."\n"; |
@@ -2094,7 +2094,7 @@ discard block |
||
| 2094 | 2094 | continue; |
| 2095 | 2095 | } |
| 2096 | 2096 | |
| 2097 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
| 2097 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')))) { |
|
| 2098 | 2098 | //when unticking boolean field, it's not set in POST |
| 2099 | 2099 | continue; |
| 2100 | 2100 | } |
@@ -2123,7 +2123,7 @@ discard block |
||
| 2123 | 2123 | $onlykey === '@GETPOSTISSET' |
| 2124 | 2124 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
| 2125 | 2125 | && in_array(abs($enabled), array(2, 5)) |
| 2126 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2126 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2127 | 2127 | ) |
| 2128 | 2128 | ) { |
| 2129 | 2129 | continue; |
@@ -2250,17 +2250,17 @@ discard block |
||
| 2250 | 2250 | } |
| 2251 | 2251 | |
| 2252 | 2252 | if (in_array($key_type, array('date'))) { |
| 2253 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
| 2254 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
| 2253 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
| 2254 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
| 2255 | 2255 | |
| 2256 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
| 2256 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
| 2257 | 2257 | $value_key = array(); |
| 2258 | 2258 | // values provided as a component year, month, day, etc. |
| 2259 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2260 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); |
|
| 2259 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2260 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int')); |
|
| 2261 | 2261 | } |
| 2262 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2263 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); |
|
| 2262 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2263 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end.'month', 'int'), GETPOST($dateparamname_end.'day', 'int'), GETPOST($dateparamname_end.'year', 'int')); |
|
| 2264 | 2264 | } |
| 2265 | 2265 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
| 2266 | 2266 | // Clean parameters |
@@ -2269,22 +2269,22 @@ discard block |
||
| 2269 | 2269 | continue; // Value was not provided, we should not set it. |
| 2270 | 2270 | } |
| 2271 | 2271 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
| 2272 | - $dateparamname_start = $keysuffix . 'options_' . $key . $keyprefix . '_start'; |
|
| 2273 | - $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; |
|
| 2274 | - if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { |
|
| 2272 | + $dateparamname_start = $keysuffix.'options_'.$key.$keyprefix.'_start'; |
|
| 2273 | + $dateparamname_end = $keysuffix.'options_'.$key.$keyprefix.'_end'; |
|
| 2274 | + if (GETPOST($dateparamname_start.'year') && GETPOST($dateparamname_end.'year')) { |
|
| 2275 | 2275 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
| 2276 | - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; |
|
| 2277 | - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; |
|
| 2278 | - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; |
|
| 2276 | + $dateparamname_end_hour = GETPOST($dateparamname_end.'hour', 'int') != '-1' ? GETPOST($dateparamname_end.'hour', 'int') : '23'; |
|
| 2277 | + $dateparamname_end_min = GETPOST($dateparamname_end.'min', 'int') != '-1' ? GETPOST($dateparamname_end.'min', 'int') : '59'; |
|
| 2278 | + $dateparamname_end_sec = GETPOST($dateparamname_end.'sec', 'int') != '-1' ? GETPOST($dateparamname_end.'sec', 'int') : '59'; |
|
| 2279 | 2279 | if ($key_type == 'datetimegmt') { |
| 2280 | 2280 | $value_key = array( |
| 2281 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), |
|
| 2282 | - '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'), 'gmt') |
|
| 2281 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'gmt'), |
|
| 2282 | + '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'), 'gmt') |
|
| 2283 | 2283 | ); |
| 2284 | 2284 | } else { |
| 2285 | 2285 | $value_key = array( |
| 2286 | - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), |
|
| 2287 | - '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') |
|
| 2286 | + 'start' => dol_mktime(GETPOST($dateparamname_start.'hour', 'int'), GETPOST($dateparamname_start.'min', 'int'), GETPOST($dateparamname_start.'sec', 'int'), GETPOST($dateparamname_start.'month', 'int'), GETPOST($dateparamname_start.'day', 'int'), GETPOST($dateparamname_start.'year', 'int'), 'tzuserrel'), |
|
| 2287 | + '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') |
|
| 2288 | 2288 | ); |
| 2289 | 2289 | } |
| 2290 | 2290 | } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | // Clean data |
| 221 | 221 | // $this->partnership->abc = sanitizeVal($this->partnership->abc, 'alphanohtml'); |
| 222 | 222 | |
| 223 | - if ($this->partnership->create(DolibarrApiAccess::$user)<0) { |
|
| 223 | + if ($this->partnership->create(DolibarrApiAccess::$user) < 0) { |
|
| 224 | 224 | throw new RestException(500, "Error creating Partnership", array_merge(array($this->partnership->error), $this->partnership->errors)); |
| 225 | 225 | } |
| 226 | 226 | return $this->partnership->id; |