dolibarr  13.0.2
website2.lib.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
32 function dolSaveMasterFile($filemaster)
33 {
34  global $conf;
35 
36  // Now generate the master.inc.php page
37  dol_syslog("We regenerate the master file");
38  dol_delete_file($filemaster);
39 
40  $mastercontent = '<?php'."\n";
41  $mastercontent .= '// File generated to link to the master file - DO NOT MODIFY - It is just an include'."\n";
42  $mastercontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
43  $mastercontent .= " if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1);\n";
44  $mastercontent .= " require_once '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
45  $mastercontent .= "}\n";
46  $mastercontent .= '?>'."\n";
47  $result = file_put_contents($filemaster, $mastercontent);
48  if (!empty($conf->global->MAIN_UMASK))
49  @chmod($filemaster, octdec($conf->global->MAIN_UMASK));
50 
51  return $result;
52 }
53 
64 function dolSavePageAlias($filealias, $object, $objectpage)
65 {
66  global $conf;
67 
68  // Now create the .tpl file (duplicate code with actions updatesource or updatecontent but we need this to save new header)
69  dol_syslog("dolSavePageAlias We regenerate the alias page filealias=".$filealias);
70 
71  $aliascontent = '<?php'."\n";
72  $aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
73  $aliascontent .= 'global $dolibarr_main_data_root;'."\n";
74  $aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'./page'.$objectpage->id.'.tpl.php\'; ';
75  $aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
76  $aliascontent .= '?>'."\n";
77  $result = file_put_contents($filealias, $aliascontent);
78  if ($result === false) {
79  dol_syslog("Failed to write file ".$filealias, LOG_WARNING);
80  }
81  if (!empty($conf->global->MAIN_UMASK)) {
82  @chmod($filealias, octdec($conf->global->MAIN_UMASK));
83  }
84 
85  // Save also alias into language subdirectory if it is not a main language
86  if ($objectpage->lang && in_array($objectpage->lang, explode(',', $object->otherlang))) {
87  $dirname = dirname($filealias);
88  $filename = basename($filealias);
89  $filealiassub = $dirname.'/'.$objectpage->lang.'/'.$filename;
90 
91  $aliascontent = '<?php'."\n";
92  $aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
93  $aliascontent .= 'global $dolibarr_main_data_root;'."\n";
94  $aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.'.tpl.php\'; ';
95  $aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
96  $aliascontent .= '?>'."\n";
97  $result = file_put_contents($filealiassub, $aliascontent);
98  if ($result === false) {
99  dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
100  }
101  if (!empty($conf->global->MAIN_UMASK)) {
102  @chmod($filealiassub, octdec($conf->global->MAIN_UMASK));
103  }
104  }
105  // Save also alias into all language subdirectories if it is a main language
106  elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) {
107  if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR)) {
108  $dirname = dirname($filealias);
109  $filename = basename($filealias);
110  foreach (explode(',', $object->otherlang) as $sublang) {
111  $filealiassub = $dirname.'/'.$sublang.'/'.$filename;
112 
113  $aliascontent = '<?php'."\n";
114  $aliascontent .= "// File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page\n";
115  $aliascontent .= 'global $dolibarr_main_data_root;'."\n";
116  $aliascontent .= 'if (empty($dolibarr_main_data_root)) require \'../page'.$objectpage->id.'.tpl.php\'; ';
117  $aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
118  $aliascontent .= '?>'."\n";
119  $result = file_put_contents($filealiassub, $aliascontent);
120  if ($result === false) {
121  dol_syslog("Failed to write file ".$filealiassub, LOG_WARNING);
122  }
123  if (!empty($conf->global->MAIN_UMASK)) {
124  @chmod($filealiassub, octdec($conf->global->MAIN_UMASK));
125  }
126  }
127  }
128  }
129 
130  return ($result ?true:false);
131 }
132 
133 
144 function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
145 {
146  global $conf, $db;
147 
148  // Now create the .tpl file (duplicate code with actions updatesource or updatecontent but we need this to save new header)
149  dol_syslog("We regenerate the tpl page filetpl=".$filetpl);
150 
151  include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
152  dol_delete_file($filetpl);
153 
154  $shortlangcode = '';
155  if ($objectpage->lang) $shortlangcode = substr($objectpage->lang, 0, 2); // en_US or en-US -> en
156  if (empty($shortlangcode)) $shortlangcode = substr($object->lang, 0, 2); // en_US or en-US -> en
157 
158  $tplcontent = '';
159  $tplcontent .= "<?php // BEGIN PHP\n";
160  $tplcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n";
161  $tplcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {\n";
162  $tplcontent .= ' $pathdepth = count(explode(\'/\', $_SERVER[\'SCRIPT_NAME\'])) - 2;'."\n";
163  $tplcontent .= ' require_once ($pathdepth ? str_repeat(\'../\', $pathdepth) : \'./\').\'master.inc.php\';'."\n";
164  $tplcontent .= "} // Not already loaded\n";
165  $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
166  $tplcontent .= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
167  $tplcontent .= "ob_start();\n";
168  $tplcontent .= "// END PHP ?>\n";
169  if (!empty($conf->global->WEBSITE_FORCE_DOCTYPE_HTML5))
170  {
171  $tplcontent .= "<!DOCTYPE html>\n";
172  }
173  $tplcontent .= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"' : '').'>'."\n";
174  $tplcontent .= '<head>'."\n";
175  $tplcontent .= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n";
176  $tplcontent .= '<meta charset="utf-8">'."\n";
177  $tplcontent .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
178  $tplcontent .= '<meta name="robots" content="index, follow" />'."\n";
179  $tplcontent .= '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
180  $tplcontent .= '<meta name="keywords" content="'.dol_string_nohtmltag($objectpage->keywords).'" />'."\n";
181  $tplcontent .= '<meta name="title" content="'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'" />'."\n";
182  $tplcontent .= '<meta name="description" content="'.dol_string_nohtmltag($objectpage->description, 0, 'UTF-8').'" />'."\n";
183  $tplcontent .= '<meta name="generator" content="'.DOL_APPLICATION_TITLE.' '.DOL_VERSION.' (https://www.dolibarr.org)" />'."\n";
184  $tplcontent .= '<meta name="dolibarr:pageid" content="'.dol_string_nohtmltag($objectpage->id).'" />'."\n";
185  // Add canonical reference
186  if ($object->virtualhost) {
187  $tplcontent .= '<link rel="canonical" href="'.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" />'."\n";
188  }
189  // Add translation reference (main language)
190  if ($object->isMultiLang()) {
191  // Add myself
192  $tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
193  $tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
194 
195  // Add page "translation of"
196  $translationof = $objectpage->fk_page;
197  if ($translationof) {
198  $tmppage = new WebsitePage($db);
199  $tmppage->fetch($translationof);
200  if ($tmppage->id > 0) {
201  $tmpshortlangcode = '';
202  if ($tmppage->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en
203  if (empty($tmpshortlangcode)) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
204  if ($tmpshortlangcode != $shortlangcode) {
205  $tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="'.($object->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php').'" />'."\n";
206  }
207  }
208  }
209  // Add "has translation pages"
210  $sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$objectpage->id.($translationof ? ", ".$translationof : "").")";
211  $resql = $db->query($sql);
212  if ($resql)
213  {
214  $num_rows = $db->num_rows($resql);
215  if ($num_rows > 0)
216  {
217  while ($obj = $db->fetch_object($resql))
218  {
219  $tmpshortlangcode = '';
220  if ($obj->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en
221  if ($tmpshortlangcode != $shortlangcode) {
222  $tplcontent .= '<link rel="alternate" hreflang="'.$tmpshortlangcode.'" href="'.($object->fk_default_home == $obj->id ? '/' : (($tmpshortlangcode != substr($object->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$obj->pageurl.'.php').'" />'."\n";
223  }
224  }
225  }
226  } else {
227  dol_print_error($db);
228  }
229  $tplcontent .= '<?php } ?>'."\n";
230  }
231  // Add manifest.json. Do we have to add it only on home page ?
232  $tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
233  $tplcontent .= '<!-- Include link to CSS file -->'."\n";
234  // Add js
235  $tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
236  $tplcontent .= '<!-- Include link to JS file -->'."\n";
237  $tplcontent .= '<script src="/javascript.js.php"></script>'."\n";
238  // Add headers
239  $tplcontent .= '<!-- Include HTML header from common file -->'."\n";
240  $tplcontent .= '<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'."\n";
241  $tplcontent .= '<!-- Include HTML header from page header block -->'."\n";
242  $tplcontent .= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
243  $tplcontent .= '</head>'."\n";
244 
245  $tplcontent .= '<!-- File generated by Dolibarr website module editor -->'."\n";
246  $tplcontent .= '<body id="bodywebsite" class="bodywebsite bodywebpage-'.$objectpage->ref.'">'."\n";
247  $tplcontent .= $objectpage->content."\n";
248  $tplcontent .= '</body>'."\n";
249  $tplcontent .= '</html>'."\n";
250 
251  $tplcontent .= '<?php // BEGIN PHP'."\n";
252  $tplcontent .= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp, "html", '.$objectpage->id.');'."\n";
253  $tplcontent .= "// END PHP ?>\n";
254 
255  //var_dump($filetpl);exit;
256  $result = file_put_contents($filetpl, $tplcontent);
257  if (!empty($conf->global->MAIN_UMASK)) {
258  @chmod($filetpl, octdec($conf->global->MAIN_UMASK));
259  }
260 
261  return $result;
262 }
263 
264 
274 function dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper)
275 {
276  global $conf;
277 
278  $result1 = false;
279  $result2 = false;
280 
281  dol_mkdir($pathofwebsite);
282 
283  if ($fileindex) {
284  dol_delete_file($fileindex);
285  $indexcontent = '<?php'."\n";
286  $indexcontent .= "// BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper.\n";
287  $indexcontent .= '$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;'."\n";
288  $indexcontent .= "if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded\n";
289  $indexcontent .= 'if (! empty($_GET[\'pageref\']) || ! empty($_GET[\'pagealiasalt\']) || ! empty($_GET[\'pageid\'])) {'."\n";
290  $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';\n";
291  $indexcontent .= " require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
292  $indexcontent .= ' redirectToContainer($_GET[\'pageref\'], $_GET[\'pagealiasalt\'], $_GET[\'pageid\']);'."\n";
293  $indexcontent .= "}\n";
294  $indexcontent .= "include_once './".basename($filetpl)."'\n";
295  $indexcontent .= '// END PHP ?>'."\n";
296 
297  $result1 = file_put_contents($fileindex, $indexcontent);
298  if (!empty($conf->global->MAIN_UMASK)) {
299  @chmod($fileindex, octdec($conf->global->MAIN_UMASK));
300  }
301  } else {
302  $result1 = true;
303  }
304 
305  if ($filewrapper) {
306  dol_delete_file($filewrapper);
307  $wrappercontent = file_get_contents(DOL_DOCUMENT_ROOT.'/website/samples/wrapper.php');
308 
309  $result2 = file_put_contents($filewrapper, $wrappercontent);
310  if (!empty($conf->global->MAIN_UMASK)) {
311  @chmod($filewrapper, octdec($conf->global->MAIN_UMASK));
312  }
313  } else {
314  $result2 = true;
315  }
316 
317  return ($result1 && $result2);
318 }
319 
320 
328 function dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent)
329 {
330  global $conf, $pathofwebsite;
331 
332  dol_syslog("Save html header into ".$filehtmlheader);
333 
334  dol_mkdir($pathofwebsite);
335  $result = file_put_contents($filehtmlheader, $htmlheadercontent);
336  if (!empty($conf->global->MAIN_UMASK))
337  @chmod($filehtmlheader, octdec($conf->global->MAIN_UMASK));
338 
339  return $result;
340 }
341 
349 function dolSaveCssFile($filecss, $csscontent)
350 {
351  global $conf, $pathofwebsite;
352 
353  dol_syslog("Save css file into ".$filecss);
354 
355  dol_mkdir($pathofwebsite);
356  $result = file_put_contents($filecss, $csscontent);
357  if (!empty($conf->global->MAIN_UMASK))
358  @chmod($filecss, octdec($conf->global->MAIN_UMASK));
359 
360  return $result;
361 }
362 
370 function dolSaveJsFile($filejs, $jscontent)
371 {
372  global $conf, $pathofwebsite;
373 
374  dol_syslog("Save js file into ".$filejs);
375 
376  dol_mkdir($pathofwebsite);
377  $result = file_put_contents($filejs, $jscontent);
378  if (!empty($conf->global->MAIN_UMASK))
379  @chmod($filejs, octdec($conf->global->MAIN_UMASK));
380 
381  return $result;
382 }
383 
391 function dolSaveRobotFile($filerobot, $robotcontent)
392 {
393  global $conf, $pathofwebsite;
394 
395  dol_syslog("Save robot file into ".$filerobot);
396 
397  dol_mkdir($pathofwebsite);
398  $result = file_put_contents($filerobot, $robotcontent);
399  if (!empty($conf->global->MAIN_UMASK))
400  @chmod($filerobot, octdec($conf->global->MAIN_UMASK));
401 
402  return $result;
403 }
404 
412 function dolSaveHtaccessFile($filehtaccess, $htaccess)
413 {
414  global $conf, $pathofwebsite;
415 
416  dol_syslog("Save htaccess file into ".$filehtaccess);
417 
418  dol_mkdir($pathofwebsite);
419  $result = file_put_contents($filehtaccess, $htaccess);
420  if (!empty($conf->global->MAIN_UMASK))
421  @chmod($filehtaccess, octdec($conf->global->MAIN_UMASK));
422 
423  return $result;
424 }
425 
433 function dolSaveManifestJson($file, $content)
434 {
435  global $conf, $pathofwebsite;
436 
437  dol_syslog("Save manifest.js.php file into ".$file);
438 
439  dol_mkdir($pathofwebsite);
440  $result = file_put_contents($file, $content);
441  if (!empty($conf->global->MAIN_UMASK))
442  @chmod($file, octdec($conf->global->MAIN_UMASK));
443 
444  return $result;
445 }
446 
454 function dolSaveReadme($file, $content)
455 {
456  global $conf, $pathofwebsite;
457 
458  dol_syslog("Save README.md file into ".$file);
459 
460  dol_mkdir($pathofwebsite);
461  $result = file_put_contents($file, $content);
462  if (!empty($conf->global->MAIN_UMASK))
463  @chmod($file, octdec($conf->global->MAIN_UMASK));
464 
465  return $result;
466 }
467 
468 
475 function showWebsiteTemplates(Website $website)
476 {
477  global $conf, $langs, $db, $form;
478 
479  $dirthemes = array('/doctemplates/websites');
480  if (!empty($conf->modules_parts['websitetemplates'])) // Using this feature slow down application
481  {
482  foreach ($conf->modules_parts['websitetemplates'] as $reldir)
483  {
484  $dirthemes = array_merge($dirthemes, (array) ($reldir.'doctemplates/websites'));
485  }
486  }
487  $dirthemes = array_unique($dirthemes);
488  // Now dir_themes=array('/themes') or dir_themes=array('/theme','/mymodule/theme')
489 
490  $colspan = 2;
491 
492  print '<!-- For website template import -->'."\n";
493  print '<table class="noborder centpercent">';
494 
495  // Title
496  print '<tr class="liste_titre"><th class="titlefield">';
497  print $form->textwithpicto($langs->trans("Templates"), $langs->trans("ThemeDir").' : '.join(", ", $dirthemes));
498  print '</th>';
499  print '<th class="right">';
500  $url = 'https://www.dolistore.com/43-web-site-templates';
501  print '<a href="'.$url.'" target="_blank">';
502  print $langs->trans('DownloadMoreSkins');
503  print '</a>';
504  print '</th></tr>';
505 
506  print '<tr><td colspan="'.$colspan.'">';
507 
508  print '<table class="nobordernopadding" width="100%"><tr><td><div class="center">';
509 
510  if (count($dirthemes)) {
511  $i = 0;
512  foreach ($dirthemes as $dir)
513  {
514  //print $dirroot.$dir;exit;
515  $dirtheme = DOL_DATA_ROOT.$dir; // This include loop on $conf->file->dol_document_root
516  if (is_dir($dirtheme))
517  {
518  $handle = opendir($dirtheme);
519  if (is_resource($handle))
520  {
521  while (($subdir = readdir($handle)) !== false)
522  {
523  if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
524  && substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir))
525  {
526  $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
527 
528  // Disable not stable themes (dir ends with _exp or _dev)
529  if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) continue;
530  if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) continue;
531 
532  print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
533 
534  $file = $dirtheme."/".$subdirwithoutzip.".jpg";
535  $url = DOL_URL_ROOT.'/viewimage.php?modulepart=doctemplateswebsite&file='.$subdirwithoutzip.".jpg";
536 
537  if (!file_exists($file)) $url = DOL_URL_ROOT.'/public/theme/common/nophoto.png';
538 
539  $originalfile = basename($file);
540  $entity = $conf->entity;
541  $modulepart = 'doctemplateswebsite';
542  $cache = '';
543  $title = $file;
544 
545  $ret = '';
546  $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 1, '&entity='.$entity);
547  if (!empty($urladvanced)) $ret .= '<a class="'.$urladvanced['css'].'" target="'.$urladvanced['target'].'" mime="'.$urladvanced['mime'].'" href="'.$urladvanced['url'].'">';
548  else $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">';
549  print $ret;
550  print '<img class="img-skinthumb shadow" src="'.$url.'" border="0" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
551  print '</a>';
552 
553  print '<br>';
554  print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
555  print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&website='.$website->ref.'&templateuserfile='.$subdir.'" class="button">'.$langs->trans("Load").'</a>';
556  print '</div>';
557 
558  $i++;
559  }
560  }
561  }
562  }
563  }
564  } else {
565  print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
566  }
567 
568  print '</div></td></tr></table>';
569 
570  print '</td></tr>';
571  print '</table>';
572 }
dolSaveHtaccessFile($filehtaccess, $htaccess)
Save content of a page on disk.
isMultiLang()
Return if web site is a multilanguage web site.
Class Website.
dolSaveMasterFile($filemaster)
Save content of a page on disk.
dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent)
Save content of a page on disk.
dol_filesize($pathoffile)
Return size of a file.
Definition: files.lib.php:555
dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
Save content of a page on disk (page name is generally ID_of_page.php).
showWebsiteTemplates(Website $website)
Show list of themes.
Class Websitepage.
dolSaveManifestJson($file, $content)
Save content of a page on disk.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper)
Save content of the index.php and/or wrapper.php page.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
Definition: files.lib.php:1144
dolSaveReadme($file, $content)
Save content of a page on disk.
dolSavePageAlias($filealias, $object, $objectpage)
Save an alias page on disk (A page that include the reference page).
dolSaveJsFile($filejs, $jscontent)
Save content of a page on disk.
dolSaveCssFile($filecss, $csscontent)
Save content of a page on disk.
print
Draft customers invoices.
Definition: index.php:89
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formated size.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolSaveRobotFile($filerobot, $robotcontent)
Save content of a page on disk.
getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param= '')
Return URL we can use for advanced preview links.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)