@@ -43,7 +43,7 @@ |
||
43 | 43 | $langs->load('ticket'); |
44 | 44 | |
45 | 45 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'datec,ref', 'desc', 0, 0, 1); |
46 | -'@phan-var-force Ticket[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
46 | +'@phan-var-force Ticket[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
47 | 47 | /** @var Ticket[] $linkedObjectBlock */ |
48 | 48 | |
49 | 49 | $total = 0; |
@@ -43,10 +43,10 @@ |
||
43 | 43 | // Load translation files required by the page |
44 | 44 | $langs->load("bom"); |
45 | 45 | |
46 | -'@phan-var-force BOM[] $linkedObjectBlock'; // Type before use |
|
46 | +'@phan-var-force BOM[] $linkedObjectBlock'; // Type before use |
|
47 | 47 | /** @var BOM[] $linkedObjectBlock */ |
48 | 48 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date,ref', 'desc', 0, 0, 1); |
49 | -'@phan-var-force BOM[] $linkedObjectBlock'; // Type after dol_sort_array which looses typing |
|
49 | +'@phan-var-force BOM[] $linkedObjectBlock'; // Type after dol_sort_array which looses typing |
|
50 | 50 | /** @var BOM[] $linkedObjectBlock */ |
51 | 51 | |
52 | 52 | $total = 0; |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $langs->load("assets"); |
52 | 52 | |
53 | 53 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date,ref', 'desc', 0, 0, 1); |
54 | -'@phan-var-force Asset[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
54 | +'@phan-var-force Asset[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
55 | 55 | /** @var Asset[] $linkedObjectBlock */ |
56 | 56 | |
57 | 57 | $total = 0; |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"), |
164 | 164 | 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"), |
165 | 165 | 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), |
166 | - 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"), |
|
167 | - 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"), |
|
168 | - 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
166 | + 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "relative to dolibarr document dir. Example module/def"), |
|
167 | + 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "file name only without any directory"), |
|
168 | + 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
169 | 169 | 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), |
170 | - 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
170 | + 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
171 | 171 | 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110), |
172 | - 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
173 | - 'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Text content if option to store txt content was set."), |
|
172 | + 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
173 | + 'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Text content if option to store txt content was set."), |
|
174 | 174 | 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), |
175 | 175 | 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), |
176 | - 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"), |
|
176 | + 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "'generated' or 'uploaded'"), |
|
177 | 177 | 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"), |
178 | 178 | 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), |
179 | 179 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), |
@@ -461,28 +461,28 @@ discard block |
||
461 | 461 | if ($filename != '*') { |
462 | 462 | $sql .= " AND t.filename = '".$this->db->escape($filename)."'"; |
463 | 463 | } |
464 | - if (! empty($entity)) { |
|
465 | - $sql .= " AND t.entity = " . (int) $entity; |
|
464 | + if (!empty($entity)) { |
|
465 | + $sql .= " AND t.entity = ".(int) $entity; |
|
466 | 466 | } else { |
467 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
467 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
468 | 468 | } |
469 | 469 | $filterfound++; |
470 | 470 | } |
471 | 471 | if (!empty($ref)) { // hash of file path |
472 | 472 | $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; |
473 | - if (! empty($entity)) { |
|
474 | - $sql .= " AND t.entity = " . (int) $entity; |
|
473 | + if (!empty($entity)) { |
|
474 | + $sql .= " AND t.entity = ".(int) $entity; |
|
475 | 475 | } else { |
476 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
476 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
477 | 477 | } |
478 | 478 | $filterfound++; |
479 | 479 | } |
480 | 480 | if (!empty($hashoffile)) { // hash of content |
481 | 481 | $sql .= " AND t.label = '".$this->db->escape($hashoffile)."'"; |
482 | - if (! empty($entity)) { |
|
483 | - $sql .= " AND t.entity = " . (int) $entity; |
|
482 | + if (!empty($entity)) { |
|
483 | + $sql .= " AND t.entity = ".(int) $entity; |
|
484 | 484 | } else { |
485 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
485 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
486 | 486 | } |
487 | 487 | $filterfound++; |
488 | 488 | } |
@@ -497,10 +497,10 @@ discard block |
||
497 | 497 | } |
498 | 498 | if ($src_object_type && $src_object_id) { |
499 | 499 | $sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id); |
500 | - if (! empty($entity)) { |
|
501 | - $sql .= " AND t.entity = " . (int) $entity; |
|
500 | + if (!empty($entity)) { |
|
501 | + $sql .= " AND t.entity = ".(int) $entity; |
|
502 | 502 | } else { |
503 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
503 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
504 | 504 | } |
505 | 505 | $filterfound++; |
506 | 506 | } |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
972 | 972 | return ['optimize' => $langs->trans("ShowFile")]; |
973 | 973 | } |
974 | - $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly') . '<u>' . $langs->trans("File") . '</u>'; |
|
974 | + $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').'<u>'.$langs->trans("File").'</u>'; |
|
975 | 975 | if (!empty($this->filename)) { |
976 | 976 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.basename($this->filename); |
977 | 977 | } |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $result .= $linkstart.$this->filename.$linkend; |
1085 | 1085 | |
1086 | 1086 | global $action; |
1087 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1087 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1088 | 1088 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1089 | 1089 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1090 | 1090 | if ($reshook > 0) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $utf8_path = preg_replace('/([\\/]+)$/', '', $utf8_path); |
123 | 123 | |
124 | 124 | if (preg_match('/\*/', $utf8_path)) { |
125 | - $utf8_path_array = glob($utf8_path, GLOB_ONLYDIR); // This scan dir for files. If file does not exists, return empty. |
|
125 | + $utf8_path_array = glob($utf8_path, GLOB_ONLYDIR); // This scan dir for files. If file does not exists, return empty. |
|
126 | 126 | //$os_path_array = dol_dir_list($utf8_path); |
127 | 127 | } else { |
128 | 128 | $utf8_path_array = array($utf8_path); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'types' => $types, |
141 | 141 | 'recursive' => $recursive, |
142 | 142 | 'filter' => $filter, |
143 | - 'excludefilter' => $exclude_array, // Already converted to array. |
|
143 | + 'excludefilter' => $exclude_array, // Already converted to array. |
|
144 | 144 | 'sortcriteria' => $sortcriteria, |
145 | 145 | 'sortorder' => $sortorder, |
146 | 146 | 'loaddate' => $loaddate, |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $utf8_file = $os_file; |
174 | 174 | } |
175 | 175 | |
176 | - $utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed |
|
176 | + $utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed |
|
177 | 177 | |
178 | 178 | // Check if file is qualified |
179 | 179 | $qualified = 1; |
@@ -209,13 +209,13 @@ discard block |
||
209 | 209 | if (is_array($filter)) { |
210 | 210 | $chunks = array_chunk($filter, 500); |
211 | 211 | foreach ($chunks as $chunk) { |
212 | - $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large |
|
212 | + $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large |
|
213 | 213 | if ($testpregmatch) { |
214 | 214 | break; |
215 | 215 | } |
216 | 216 | } |
217 | 217 | } else { |
218 | - $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large |
|
218 | + $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large |
|
219 | 219 | } |
220 | 220 | if ($testpregmatch) { |
221 | 221 | $qualifiedforfilter = 1; |
@@ -264,13 +264,13 @@ discard block |
||
264 | 264 | if (is_array($filter)) { |
265 | 265 | $chunks = array_chunk($filter, 500); |
266 | 266 | foreach ($chunks as $chunk) { |
267 | - $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large |
|
267 | + $testpregmatch = preg_match('/'.implode('|', $chunk).'/i', $utf8_file); // May failed if $filter too large |
|
268 | 268 | if ($testpregmatch) { |
269 | 269 | break; |
270 | 270 | } |
271 | 271 | } |
272 | 272 | } else { |
273 | - $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large |
|
273 | + $testpregmatch = preg_match('/'.$filter.'/i', $utf8_file); // May failed if $filter too large |
|
274 | 274 | } |
275 | 275 | if ($testpregmatch) { |
276 | 276 | $qualifiedforfilter = 1; |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | // Recursive function to copy all subdirectories and contents: |
1032 | 1032 | if (is_dir($ossrcfile)) { |
1033 | 1033 | $dir_handle = opendir($ossrcfile); |
1034 | - $tmpresult = 0; // Initialised before loop to keep old behavior, may be needed inside loop |
|
1034 | + $tmpresult = 0; // Initialised before loop to keep old behavior, may be needed inside loop |
|
1035 | 1035 | while ($file = readdir($dir_handle)) { |
1036 | 1036 | if ($file != "." && $file != ".." && !is_link($ossrcfile."/".$file)) { |
1037 | 1037 | if (is_dir($ossrcfile."/".$file)) { |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | if (!empty($moreinfo) && !empty($moreinfo['gen_or_uploaded'])) { |
1216 | 1216 | $ecmfile->gen_or_uploaded = $moreinfo['gen_or_uploaded']; |
1217 | 1217 | } else { |
1218 | - $ecmfile->gen_or_uploaded = 'unknown'; // 'generated', 'uploaded', 'api' |
|
1218 | + $ecmfile->gen_or_uploaded = 'unknown'; // 'generated', 'uploaded', 'api' |
|
1219 | 1219 | } |
1220 | 1220 | if (!empty($moreinfo) && !empty($moreinfo['description'])) { |
1221 | 1221 | $ecmfile->description = $moreinfo['description']; // indexed content |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | if (!empty($moreinfo) && !empty($moreinfo['cover'])) { |
1246 | 1246 | $ecmfile->cover = $moreinfo['cover']; |
1247 | 1247 | } |
1248 | - if (! empty($entity)) { |
|
1248 | + if (!empty($entity)) { |
|
1249 | 1249 | $ecmfile->entity = $entity; |
1250 | 1250 | } |
1251 | 1251 | |
@@ -1571,7 +1571,7 @@ discard block |
||
1571 | 1571 | |
1572 | 1572 | if ($return) { |
1573 | 1573 | dolChmod($file_name_osencoded); |
1574 | - dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=" . getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
1574 | + dol_syslog("Files.lib::dol_move_uploaded_file Success to move ".$src_file." to ".$file_name." - Umask=".getDolGlobalString('MAIN_UMASK'), LOG_DEBUG); |
|
1575 | 1575 | return $successcode; // Success |
1576 | 1576 | } else { |
1577 | 1577 | dol_syslog("Files.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); |
@@ -1637,7 +1637,7 @@ discard block |
||
1637 | 1637 | $ok = true; |
1638 | 1638 | $globencoded = str_replace('[', '\[', $file_osencoded); |
1639 | 1639 | $globencoded = str_replace(']', '\]', $globencoded); |
1640 | - $listofdir = glob($globencoded); // This scan dir for files. If file does not exists, return empty. |
|
1640 | + $listofdir = glob($globencoded); // This scan dir for files. If file does not exists, return empty. |
|
1641 | 1641 | |
1642 | 1642 | if (!empty($listofdir) && is_array($listofdir)) { |
1643 | 1643 | foreach ($listofdir as $filename) { |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | $maxwidthmini = $tmparraysize['maxwidthmini']; |
2119 | 2119 | $maxheightmini = $tmparraysize['maxheightmini']; |
2120 | 2120 | //$quality = $tmparraysize['quality']; |
2121 | - $quality = 50; // For thumbs, we force quality to 50 |
|
2121 | + $quality = 50; // For thumbs, we force quality to 50 |
|
2122 | 2122 | |
2123 | 2123 | // Generate thumbs. |
2124 | 2124 | if ($generatethumbs) { |
@@ -2312,7 +2312,7 @@ discard block |
||
2312 | 2312 | if (isset($object->table_element)) { |
2313 | 2313 | $ecmfile->src_object_type = $object->table_element; |
2314 | 2314 | } else { |
2315 | - dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); |
|
2315 | + dol_syslog('Error: object '.get_class($object).' has no table_element attribute.'); |
|
2316 | 2316 | return -1; |
2317 | 2317 | } |
2318 | 2318 | if (isset($object->src_object_description)) { |
@@ -2466,9 +2466,9 @@ discard block |
||
2466 | 2466 | if (!$error) { |
2467 | 2467 | $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'ecm_files'; |
2468 | 2468 | if (isset($object->entity)) { |
2469 | - $sql .= ' WHERE entity = ' . ((int) $object->entity); |
|
2469 | + $sql .= ' WHERE entity = '.((int) $object->entity); |
|
2470 | 2470 | } else { |
2471 | - $sql .= ' WHERE entity = ' . ((int) $conf->entity); |
|
2471 | + $sql .= ' WHERE entity = '.((int) $conf->entity); |
|
2472 | 2472 | } |
2473 | 2473 | $sql .= " AND filepath = '".$db->escape($rel_dir)."'"; |
2474 | 2474 | if ($file) { |
@@ -2617,9 +2617,9 @@ discard block |
||
2617 | 2617 | // Skip directories (they would be added automatically) |
2618 | 2618 | if (!$file->isDir()) { |
2619 | 2619 | // Get real and relative path for current file |
2620 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2620 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2621 | 2621 | $fileName = $file->getFilename(); |
2622 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2622 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2623 | 2623 | |
2624 | 2624 | //$relativePath = substr($fileFullRealPath, strlen($rootPath) + 1); |
2625 | 2625 | $relativePath = substr(($filePath ? $filePath.'/' : '').$fileName, strlen($rootPath) + 1); |
@@ -2891,9 +2891,9 @@ discard block |
||
2891 | 2891 | // Skip directories (they would be added automatically) |
2892 | 2892 | if (!$file->isDir()) { |
2893 | 2893 | // Get real and relative path for current file |
2894 | - $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2894 | + $filePath = $file->getPath(); // the full path with filename using the $inputdir root. |
|
2895 | 2895 | $fileName = $file->getFilename(); |
2896 | - $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2896 | + $fileFullRealPath = $file->getRealPath(); // the full path with name and transformed to use real path directory. |
|
2897 | 2897 | |
2898 | 2898 | //$relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr($fileFullRealPath, strlen($inputdir) + 1); |
2899 | 2899 | $relativePath = ($rootdirinzip ? $rootdirinzip.'/' : '').substr(($filePath ? $filePath.'/' : '').$fileName, strlen($inputdir) + 1); |
@@ -4006,7 +4006,7 @@ discard block |
||
4006 | 4006 | function archiveOrBackupFile($srcfile, $max_versions = 5, $archivedir = '', $suffix = "v", $moveorcopy = 'move') |
4007 | 4007 | { |
4008 | 4008 | $base_file_pattern = ($archivedir ? $archivedir : dirname($srcfile)).'/'.basename($srcfile).".".$suffix; |
4009 | - $files_in_directory = glob($base_file_pattern . "*"); |
|
4009 | + $files_in_directory = glob($base_file_pattern."*"); |
|
4010 | 4010 | |
4011 | 4011 | // Extract the modification timestamps for each file |
4012 | 4012 | $files_with_timestamps = []; |
@@ -4047,7 +4047,7 @@ discard block |
||
4047 | 4047 | } |
4048 | 4048 | |
4049 | 4049 | $timestamp = dol_now('gmt'); |
4050 | - $new_backup = $srcfile . ".v" . $timestamp; |
|
4050 | + $new_backup = $srcfile.".v".$timestamp; |
|
4051 | 4051 | |
4052 | 4052 | // Move or copy the original file to the new backup with the timestamp |
4053 | 4053 | if ($moveorcopy == 'move') { |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $langs->load('sendings'); |
44 | 44 | |
45 | 45 | $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date,ref', 'desc', 0, 0, 1); |
46 | -'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
46 | +'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) |
|
47 | 47 | /** @var Delivery[] $linkedObjectBlock */ |
48 | 48 | |
49 | 49 | $total = 0; |