@@ -315,14 +315,14 @@ discard block |
||
| 315 | 315 | $importcsv = new ImportCsv($db, 'massstocklist'); |
| 316 | 316 | //print $importcsv->separator; |
| 317 | 317 | |
| 318 | - $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1; |
|
| 318 | + $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath) - 1; |
|
| 319 | 319 | $importcsv->import_open_file($fullpath); |
| 320 | 320 | $labelsrecord = $importcsv->import_read_record(); |
| 321 | 321 | |
| 322 | 322 | if ($nblinesrecord < 1) { |
| 323 | 323 | setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); |
| 324 | 324 | } else { |
| 325 | - $i=0; |
|
| 325 | + $i = 0; |
|
| 326 | 326 | $data = array(); |
| 327 | 327 | $productstatic = new Product($db); |
| 328 | 328 | $warehousestatics = new Entrepot($db); |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | $maxfilesizearray = getMaxFileSizeArray(); |
| 485 | 485 | $maxmin = $maxfilesizearray['maxmin']; |
| 486 | 486 | if ($maxmin > 0) { |
| 487 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 487 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 488 | 488 | } |
| 489 | 489 | print '<input type="file" name="userfile" size="20" maxlength="80"> '; |
| 490 | 490 | $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | /** |
| 102 | 102 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
| 103 | 103 | */ |
| 104 | - public $fields=array( |
|
| 104 | + public $fields = array( |
|
| 105 | 105 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
| 106 | 106 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'index'=>1, 'searchall'=>1, 'validate'=>'1', 'comment'=>"Reference of object"), |
| 107 | 107 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
| 59 | 59 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
| 60 | 60 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
| 61 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 61 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 62 | 62 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 63 | 63 | $search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); |
| 64 | 64 | $search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); |
@@ -727,7 +727,9 @@ |
||
| 727 | 727 | print $bankstatic->getNomUrl(1); |
| 728 | 728 | } |
| 729 | 729 | print '</td>'; |
| 730 | - if (!$i) $totalarray['nbfield']++; |
|
| 730 | + if (!$i) { |
|
| 731 | + $totalarray['nbfield']++; |
|
| 732 | + } |
|
| 731 | 733 | } |
| 732 | 734 | |
| 733 | 735 | // Amount |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $vals = array(); |
| 97 | 97 | $bool = false; |
| 98 | 98 | // -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not) |
| 99 | - if ($num>0) { |
|
| 99 | + if ($num > 0) { |
|
| 100 | 100 | while ($row = $db->fetch_row($resql)) { |
| 101 | 101 | if (!isset($vals[$row[1]])) { |
| 102 | 102 | $vals[$row[1]] = 0; |
@@ -114,7 +114,9 @@ |
||
| 114 | 114 | print '<table class="noborder nohover centpercent">'; |
| 115 | 115 | print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\n"; |
| 116 | 116 | $listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED); |
| 117 | - if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) $listofstatus[] = Fichinter::STATUS_BILLED; |
|
| 117 | + if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { |
|
| 118 | + $listofstatus[] = Fichinter::STATUS_BILLED; |
|
| 119 | + } |
|
| 118 | 120 | |
| 119 | 121 | foreach ($listofstatus as $status) { |
| 120 | 122 | $dataseries[] = array($fichinterstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0)); |
@@ -552,9 +552,9 @@ |
||
| 552 | 552 | while ($i < $nbofloop) { |
| 553 | 553 | $obj = $db->fetch_object($resql); |
| 554 | 554 | |
| 555 | - $fichinterstatic->id=$obj->rowid; |
|
| 556 | - $fichinterstatic->ref=$obj->ref; |
|
| 557 | - $fichinterstatic->statut=$obj->fk_statut; |
|
| 555 | + $fichinterstatic->id = $obj->rowid; |
|
| 556 | + $fichinterstatic->ref = $obj->ref; |
|
| 557 | + $fichinterstatic->statut = $obj->fk_statut; |
|
| 558 | 558 | |
| 559 | 559 | $companystatic->id = $obj->socid; |
| 560 | 560 | $companystatic->name = $obj->name; |
@@ -46,26 +46,26 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | 48 | $parameters = array(); |
| 49 | -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 49 | +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
|
| 50 | 50 | if ($reshook < 0) { |
| 51 | 51 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if (($action == 'update' && !GETPOST("cancel", 'alpha')) |
| 55 | 55 | || ($action == 'updateedit')) { |
| 56 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 57 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 58 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 59 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 60 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); |
|
| 61 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 62 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); |
|
| 63 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 64 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 65 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 66 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 67 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 68 | - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity); |
|
| 56 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 57 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 58 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 59 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 60 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); |
|
| 61 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 62 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); |
|
| 63 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 64 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 65 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 66 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 67 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); |
|
| 68 | + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity); |
|
| 69 | 69 | |
| 70 | 70 | if ($action != 'updateedit' && !$error) { |
| 71 | 71 | setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); |
@@ -208,12 +208,12 @@ |
||
| 208 | 208 | |
| 209 | 209 | $numFinal = get_next_value($db, $mask, 'societe', $field, $where, '', $now); |
| 210 | 210 | //Begin barcode with key: for barcode with key (EAN13...) calculate and substitute the last character (* or ?) used in the mask by the key |
| 211 | - if ((substr($numFinal, -1)=='*') or (substr($numFinal, -1)=='?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...) |
|
| 211 | + if ((substr($numFinal, -1) == '*') or (substr($numFinal, -1) == '?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...) |
|
| 212 | 212 | $literaltype = ''; |
| 213 | - $literaltype = $this->literalBarcodeType($db, $type);//get literal_Barcode_Type |
|
| 213 | + $literaltype = $this->literalBarcodeType($db, $type); //get literal_Barcode_Type |
|
| 214 | 214 | switch ($literaltype) { |
| 215 | 215 | case 'EAN13': //EAN13 rowid = 2 |
| 216 | - if (strlen($numFinal)==13) {// be sure that the mask length is correct for EAN13 |
|
| 216 | + if (strlen($numFinal) == 13) {// be sure that the mask length is correct for EAN13 |
|
| 217 | 217 | $ean = substr($numFinal, 0, 12); //take first 12 digits |
| 218 | 218 | $eansum = barcode_gen_ean_sum($ean); |
| 219 | 219 | $ean .= $eansum; //substitute the las character by the key |
@@ -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 | |