add new rule
This commit is contained in:
parent
a636f81eac
commit
def53338de
@ -110,7 +110,7 @@ print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
|||||||
print "Include custom in signature : ".$includecustom."\n";
|
print "Include custom in signature : ".$includecustom."\n";
|
||||||
print "Include constants in signature : ";
|
print "Include constants in signature : ";
|
||||||
foreach ($includeconstants as $countrycode => $tmp) {
|
foreach ($includeconstants as $countrycode => $tmp) {
|
||||||
foreach($tmp as $constname => $constvalue) {
|
foreach ($tmp as $constname => $constvalue) {
|
||||||
print $constname.'='.$constvalue." ";
|
print $constname.'='.$constvalue." ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now
|
|||||||
|
|
||||||
foreach ($includeconstants as $countrycode => $tmp) {
|
foreach ($includeconstants as $countrycode => $tmp) {
|
||||||
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
|
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
|
||||||
foreach($tmp as $constname => $constvalue) {
|
foreach ($tmp as $constname => $constvalue) {
|
||||||
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
||||||
$checksumconcat[]=$valueforchecksum;
|
$checksumconcat[]=$valueforchecksum;
|
||||||
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
|
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
|
||||||
|
|||||||
@ -95,8 +95,7 @@ if ($connection)
|
|||||||
dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR);
|
dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR);
|
||||||
exit(-5);
|
exit(-5);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
//$stream = ssh2_exec($connection, '/usr/bin/php -i');
|
//$stream = ssh2_exec($connection, '/usr/bin/php -i');
|
||||||
/*
|
/*
|
||||||
print "Generate dump ".$filesys1.'.bz2'."\n";
|
print "Generate dump ".$filesys1.'.bz2'."\n";
|
||||||
@ -125,14 +124,13 @@ if ($connection)
|
|||||||
$return_var=0;
|
$return_var=0;
|
||||||
print strftime("%Y%m%d-%H%M%S").' '.$fullcommand."\n";
|
print strftime("%Y%m%d-%H%M%S").' '.$fullcommand."\n";
|
||||||
exec($fullcommand, $output, $return_var);
|
exec($fullcommand, $output, $return_var);
|
||||||
foreach($output as $line) print $line."\n";
|
foreach ($output as $line) print $line."\n";
|
||||||
|
|
||||||
//ssh2_sftp_unlink($sftp, $fileinstalllock);
|
//ssh2_sftp_unlink($sftp, $fileinstalllock);
|
||||||
//print $output;
|
//print $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print 'Failed to connect to ssh2 to '.$server;
|
print 'Failed to connect to ssh2 to '.$server;
|
||||||
exit(-6);
|
exit(-6);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ while ($year <= $currentyear)
|
|||||||
|
|
||||||
if ($delta1)
|
if ($delta1)
|
||||||
{
|
{
|
||||||
foreach($tables as $tablekey => $tableval)
|
foreach ($tables as $tablekey => $tableval)
|
||||||
{
|
{
|
||||||
print "Correct ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
print "Correct ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
||||||
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
||||||
@ -105,7 +105,7 @@ while ($year <= $currentyear)
|
|||||||
print ".";
|
print ".";
|
||||||
$sql2="UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
$sql2="UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
||||||
$j=0;
|
$j=0;
|
||||||
foreach($tableval as $field)
|
foreach ($tableval as $field)
|
||||||
{
|
{
|
||||||
if ($j) $sql2.=", ";
|
if ($j) $sql2.=", ";
|
||||||
$sql2.= $field." = ".$db->ifsql("DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR) > NOW()", "DATE_ADD(".$field.", INTERVAL ".$delta2." YEAR)", "DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)");
|
$sql2.= $field." = ".$db->ifsql("DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR) > NOW()", "DATE_ADD(".$field.", INTERVAL ".$delta2." YEAR)", "DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)");
|
||||||
|
|||||||
@ -432,11 +432,9 @@ class CUnits // extends CommonObject
|
|||||||
return round($value, 2);
|
return round($value, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get scale of unit factor
|
* get scale of unit factor
|
||||||
* @param $id int id of unit in dictionary
|
* @param int $id id of unit in dictionary
|
||||||
* @return float|int
|
* @return float|int
|
||||||
*/
|
*/
|
||||||
public function scaleOfUnitPow($id)
|
public function scaleOfUnitPow($id)
|
||||||
@ -444,9 +442,9 @@ class CUnits // extends CommonObject
|
|||||||
$base = 10;
|
$base = 10;
|
||||||
// TODO : add base col into unit dictionary table
|
// TODO : add base col into unit dictionary table
|
||||||
$unit = $this->db->getRow('SELECT scale, unit_type from '.MAIN_DB_PREFIX.'c_units WHERE rowid = '.intval($id));
|
$unit = $this->db->getRow('SELECT scale, unit_type from '.MAIN_DB_PREFIX.'c_units WHERE rowid = '.intval($id));
|
||||||
if ($unit){
|
if ($unit) {
|
||||||
// TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
|
// TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
|
||||||
if ($unit->unit_type == 'time'){
|
if ($unit->unit_type == 'time') {
|
||||||
return doubleval($unit->scale);
|
return doubleval($unit->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -134,19 +134,16 @@ if (!empty($hashp))
|
|||||||
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
||||||
//var_dump($original_file); exit;
|
//var_dump($original_file); exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
accessforbidden('Bad link. File is from another module part.', 0, 0, 1);
|
accessforbidden('Bad link. File is from another module part.', 0, 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$modulepart = $moduleparttocheck;
|
$modulepart = $moduleparttocheck;
|
||||||
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
|
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
|
||||||
}
|
}
|
||||||
@ -185,8 +182,7 @@ if (!empty($hashp))
|
|||||||
$accessallowed = 1; // When using hashp, link is public so we force $accessallowed
|
$accessallowed = 1; // When using hashp, link is public so we force $accessallowed
|
||||||
$sqlprotectagainstexternals = '';
|
$sqlprotectagainstexternals = '';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Basic protection (against external users only)
|
// Basic protection (against external users only)
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1340,23 +1340,17 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
|||||||
else print '<script src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
else print '<script src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
if (!defined('DISABLE_JQUERY_TABLEDND')) print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
if (!defined('DISABLE_JQUERY_TABLEDND')) print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
// jQuery jnotify
|
// jQuery jnotify
|
||||||
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY'))
|
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
|
||||||
{
|
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
// Flot
|
// Flot
|
||||||
if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot')
|
if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot') {
|
||||||
{
|
if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT')) {
|
||||||
if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT'))
|
if (constant('JS_JQUERY_FLOT')) {
|
||||||
{
|
|
||||||
if (constant('JS_JQUERY_FLOT'))
|
|
||||||
{
|
|
||||||
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.JS_JQUERY_FLOT.'jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.pie.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/flot/jquery.flot.stack.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
@ -1375,14 +1369,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Chart
|
// Chart
|
||||||
if ($conf->global->MAIN_JS_GRAPH == 'chart')
|
if ($conf->global->MAIN_JS_GRAPH == 'chart') {
|
||||||
{
|
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/Chart.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/Chart.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// jQuery jeditable for Edit In Place features
|
// jQuery jeditable for Edit In Place features
|
||||||
if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE'))
|
if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) {
|
||||||
{
|
|
||||||
print '<!-- JS to manage editInPlace feature -->'."\n";
|
print '<!-- JS to manage editInPlace feature -->'."\n";
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
@ -1401,28 +1393,26 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
|||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
// jQuery Timepicker
|
// jQuery Timepicker
|
||||||
if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
|
if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) {
|
||||||
{
|
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||||
print '<script src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
|
print '<script src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
|
||||||
}
|
}
|
||||||
if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2", ...
|
if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) {
|
||||||
{
|
// jQuery plugin "mutiselect", "multiple-select", "select2", ...
|
||||||
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||||
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; // We include full because we need the support of containerCssClass
|
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; // We include full because we need the support of containerCssClass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$disablejs && !empty($conf->use_javascript_ajax))
|
if (!$disablejs && !empty($conf->use_javascript_ajax)) {
|
||||||
{
|
|
||||||
// CKEditor
|
// CKEditor
|
||||||
if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR'))
|
if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR'))
|
||||||
{
|
{
|
||||||
print '<!-- Includes JS for CKEditor -->'."\n";
|
print '<!-- Includes JS for CKEditor -->'."\n";
|
||||||
$pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
|
$pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
|
||||||
$jsckeditor = 'ckeditor.js';
|
$jsckeditor = 'ckeditor.js';
|
||||||
if (constant('JS_CKEDITOR')) // To use external ckeditor 4 js lib
|
if (constant('JS_CKEDITOR')) {
|
||||||
{
|
// To use external ckeditor 4 js lib
|
||||||
$pathckeditor = constant('JS_CKEDITOR');
|
$pathckeditor = constant('JS_CKEDITOR');
|
||||||
}
|
}
|
||||||
print '<script><!-- enable ckeditor by main.inc.php -->';
|
print '<script><!-- enable ckeditor by main.inc.php -->';
|
||||||
|
|||||||
@ -728,8 +728,7 @@ class Website extends CommonObject
|
|||||||
$newidforhome = $objectpagenew->id;
|
$newidforhome = $objectpagenew->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($objectpageold->error, $objectpageold->errors, 'errors');
|
setEventMessages($objectpageold->error, $objectpageold->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -1089,8 +1088,7 @@ class Website extends CommonObject
|
|||||||
{
|
{
|
||||||
return $filename;
|
return $filename;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
global $errormsg;
|
global $errormsg;
|
||||||
$this->error = $errormsg;
|
$this->error = $errormsg;
|
||||||
return '';
|
return '';
|
||||||
@ -1263,8 +1261,7 @@ class Website extends CommonObject
|
|||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $object->id;
|
return $object->id;
|
||||||
}
|
}
|
||||||
@ -1342,8 +1339,7 @@ class Website extends CommonObject
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -238,8 +238,7 @@ class WebsitePage extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql .= ' AND t.rowid = '.$id;
|
$sql .= ' AND t.rowid = '.$id;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if ($id < 0) $sql .= ' AND t.rowid <> '.abs($id);
|
if ($id < 0) $sql .= ' AND t.rowid <> '.abs($id);
|
||||||
if (null !== $website_id) {
|
if (null !== $website_id) {
|
||||||
$sql .= " AND t.fk_website = '".$this->db->escape($website_id)."'";
|
$sql .= " AND t.fk_website = '".$this->db->escape($website_id)."'";
|
||||||
@ -359,7 +358,7 @@ class WebsitePage extends CommonObject
|
|||||||
} elseif ($key == 'lang' || $key == 't.lang') {
|
} elseif ($key == 'lang' || $key == 't.lang') {
|
||||||
$listoflang = array();
|
$listoflang = array();
|
||||||
$foundnull = 0;
|
$foundnull = 0;
|
||||||
foreach(explode(',', $value) as $tmpvalue) {
|
foreach (explode(',', $value) as $tmpvalue) {
|
||||||
if ($tmpvalue == 'null') {
|
if ($tmpvalue == 'null') {
|
||||||
$foundnull++;
|
$foundnull++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -144,20 +144,19 @@ if (($pageid > 0 || $pageref) && $action != 'addcontainer')
|
|||||||
$res = $objectpage->fetch($object->fk_default_home, $object->id, ''); // We search first page of web site
|
$res = $objectpage->fetch($object->fk_default_home, $object->id, ''); // We search first page of web site
|
||||||
if ($res > 0) $pageid = $object->fk_default_home;
|
if ($res > 0) $pageid = $object->fk_default_home;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$res = $objectpage->fetch(0, $object->id, ''); // We search first page of web site
|
$res = $objectpage->fetch(0, $object->id, ''); // We search first page of web site
|
||||||
if ($res == 0) // Page was not found, we reset it
|
if ($res == 0) // Page was not found, we reset it
|
||||||
{
|
{
|
||||||
$objectpage = new WebsitePage($db);
|
$objectpage = new WebsitePage($db);
|
||||||
}
|
}
|
||||||
else // We found a page, we set pageid to it.
|
else // We found a page, we set pageid to it.
|
||||||
{
|
{
|
||||||
$pageid = $objectpage->id;
|
$pageid = $objectpage->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // We have a valid page. We force pageid for the case we got the page with a fetch on ref.
|
else // We have a valid page. We force pageid for the case we got the page with a fetch on ref.
|
||||||
{
|
{
|
||||||
$pageid = $objectpage->id;
|
$pageid = $objectpage->id;
|
||||||
}
|
}
|
||||||
@ -514,8 +513,7 @@ if ($action == 'addsite')
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$tmpobject->ref);
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$tmpobject->ref);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
$action = 'createsite';
|
$action = 'createsite';
|
||||||
}
|
}
|
||||||
@ -609,8 +607,7 @@ if ($action == 'addcontainer')
|
|||||||
setEventMessages('Error getting '.$urltograb.': '.$tmp['http_code'], null, 'errors');
|
setEventMessages('Error getting '.$urltograb.': '.$tmp['http_code'], null, 'errors');
|
||||||
$action = 'createcontainer';
|
$action = 'createcontainer';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Remove comments
|
// Remove comments
|
||||||
$tmp['content'] = removeHtmlComment($tmp['content']);
|
$tmp['content'] = removeHtmlComment($tmp['content']);
|
||||||
|
|
||||||
@ -698,8 +695,7 @@ if ($action == 'addcontainer')
|
|||||||
{
|
{
|
||||||
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$urltograbbis = $urltograbdirwithoutslash.'/'.$regs[2][$key]; // We use dir of grabbed file
|
$urltograbbis = $urltograbdirwithoutslash.'/'.$regs[2][$key]; // We use dir of grabbed file
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -767,8 +763,7 @@ if ($action == 'addcontainer')
|
|||||||
{
|
{
|
||||||
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$urltograbbis = $urltograbdirwithoutslash.'/'.$regs[2][$key]; // We use dir of grabbed file
|
$urltograbbis = $urltograbdirwithoutslash.'/'.$regs[2][$key]; // We use dir of grabbed file
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,8 +798,7 @@ if ($action == 'addcontainer')
|
|||||||
dol_syslog('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg']);
|
dol_syslog('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg']);
|
||||||
$action = 'createcontainer';
|
$action = 'createcontainer';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Clean some comment
|
// Clean some comment
|
||||||
//$tmpgeturl['content'] = dol_string_is_good_iso($tmpgeturl['content'], 1);
|
//$tmpgeturl['content'] = dol_string_is_good_iso($tmpgeturl['content'], 1);
|
||||||
//$tmpgeturl['content'] = utf8_encode(utf8_decode($tmpgeturl['content']));
|
//$tmpgeturl['content'] = utf8_encode(utf8_decode($tmpgeturl['content']));
|
||||||
@ -872,8 +866,7 @@ if ($action == 'addcontainer')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$objectpage->title = GETPOST('WEBSITE_TITLE', 'alphanohtml');
|
$objectpage->title = GETPOST('WEBSITE_TITLE', 'alphanohtml');
|
||||||
$objectpage->type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'aZ09');
|
$objectpage->type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'aZ09');
|
||||||
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha');
|
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha');
|
||||||
@ -972,8 +965,7 @@ if ($action == 'addcontainer')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
setEventMessages($langs->trans("Saved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
||||||
$action = 'createcontainer';
|
$action = 'createcontainer';
|
||||||
}
|
}
|
||||||
@ -985,8 +977,7 @@ if ($action == 'addcontainer')
|
|||||||
setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs');
|
setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,8 +1088,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes')
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -1134,8 +1124,7 @@ if ($action == 'delete')
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey);
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -1149,8 +1138,7 @@ if ($action == 'updatecss')
|
|||||||
{
|
{
|
||||||
$action = 'editcss';
|
$action = 'editcss';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$res = $object->fetch(0, $websitekey);
|
$res = $object->fetch(0, $websitekey);
|
||||||
$website = $object;
|
$website = $object;
|
||||||
|
|
||||||
@ -1399,8 +1387,7 @@ if ($action == 'updatecss')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$action = 'editcss';
|
$action = 'editcss';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1436,8 +1423,7 @@ if ($action == 'setashome')
|
|||||||
|
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1545,8 +1531,7 @@ if ($action == 'updatemeta')
|
|||||||
setEventMessages($langs->trans("ErrorAPageWithThisNameOrAliasAlreadyExists"), null, 'errors');
|
setEventMessages($langs->trans("ErrorAPageWithThisNameOrAliasAlreadyExists"), null, 'errors');
|
||||||
$action = 'editmeta';
|
$action = 'editmeta';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($objectpage->error, $objectpage->errors, 'errors');
|
setEventMessages($objectpage->error, $objectpage->errors, 'errors');
|
||||||
@ -1559,8 +1544,7 @@ if ($action == 'updatemeta')
|
|||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1631,13 +1615,11 @@ if ($action == 'updatemeta')
|
|||||||
//exit;
|
//exit;
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$action = 'editmeta';
|
$action = 'editmeta';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
||||||
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
//exit;
|
//exit;
|
||||||
@ -1667,8 +1649,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$object = $objectnew;
|
$object = $objectnew;
|
||||||
$id = $object->id;
|
$id = $object->id;
|
||||||
$pageid = $object->fk_default_home;
|
$pageid = $object->fk_default_home;
|
||||||
@ -1710,8 +1691,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
$tmpwebsite->fetch($newwebsiteid);
|
$tmpwebsite->fetch($newwebsiteid);
|
||||||
$pathofwebsitenew = $dolibarr_main_data_root.'/website/'.$tmpwebsite->ref;
|
$pathofwebsitenew = $dolibarr_main_data_root.'/website/'.$tmpwebsite->ref;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$tmpwebsite = $object;
|
$tmpwebsite = $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1725,8 +1705,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$fileindex = $pathofwebsitenew.'/index.php';
|
$fileindex = $pathofwebsitenew.'/index.php';
|
||||||
$filetpl = $pathofwebsitenew.'/page'.$resultpage->id.'.tpl.php';
|
$filetpl = $pathofwebsitenew.'/page'.$resultpage->id.'.tpl.php';
|
||||||
$filewrapper = $pathofwebsitenew.'/wrapper.php';
|
$filewrapper = $pathofwebsitenew.'/wrapper.php';
|
||||||
@ -1774,8 +1753,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
{
|
{
|
||||||
$res = $objectpage->fetch($pageid);
|
$res = $objectpage->fetch($pageid);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$res = 0;
|
$res = 0;
|
||||||
if ($object->fk_default_home > 0)
|
if ($object->fk_default_home > 0)
|
||||||
{
|
{
|
||||||
@ -1886,40 +1864,34 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if ($action == 'updatesource') $action = 'editsource';
|
if ($action == 'updatesource') $action = 'editsource';
|
||||||
if ($action == 'updatecontent') $action = 'editcontent';
|
if ($action == 'updatecontent') $action = 'editcontent';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
|
||||||
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if (empty($websitekey) || $websitekey == '-1')
|
if (empty($websitekey) || $websitekey == '-1')
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("NoWebSiteCreateOneFirst"), null, 'warnings');
|
setEventMessages($langs->trans("NoWebSiteCreateOneFirst"), null, 'warnings');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("NoPageYet"), null, 'warnings');
|
setEventMessages($langs->trans("NoPageYet"), null, 'warnings');
|
||||||
setEventMessages($langs->trans("YouCanCreatePageOrImportTemplate"), null, 'warnings');
|
setEventMessages($langs->trans("YouCanCreatePageOrImportTemplate"), null, 'warnings');
|
||||||
}
|
}
|
||||||
@ -1943,8 +1915,7 @@ if ($action == 'exportsite')
|
|||||||
readfile($fileofzip);
|
readfile($fileofzip);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
@ -1959,8 +1930,7 @@ if ($action == 'regeneratesite')
|
|||||||
setEventMessages($langs->trans("PagesRegenerated"), null, 'mesgs');
|
setEventMessages($langs->trans("PagesRegenerated"), null, 'mesgs');
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = 'preview';
|
$action = 'preview';
|
||||||
}
|
}
|
||||||
@ -1974,8 +1944,7 @@ if ($action == 'importsiteconfirm')
|
|||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors');
|
||||||
$action = 'importsite';
|
$action = 'importsite';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if (!empty($_FILES) || GETPOSTISSET('templateuserfile'))
|
if (!empty($_FILES) || GETPOSTISSET('templateuserfile'))
|
||||||
{
|
{
|
||||||
// Check symlink to medias and restore it if ko
|
// Check symlink to medias and restore it if ko
|
||||||
@ -2044,8 +2013,7 @@ if ($action == 'importsiteconfirm')
|
|||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = 'importsite';
|
$action = 'importsite';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Force mode dynamic on
|
// Force mode dynamic on
|
||||||
dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 1, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 1, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
@ -2236,8 +2204,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
{
|
{
|
||||||
print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2300,16 +2267,14 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
{
|
{
|
||||||
//$htmltext .= '<br><span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span><br><br>';
|
//$htmltext .= '<br><span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span><br><br>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$htmltext .= '<br><center>'.$langs->trans("GoTo").' <a href="'.$virtualurl.'" target="_website">'.$virtualurl.'</a></center><br>';
|
$htmltext .= '<br><center>'.$langs->trans("GoTo").' <a href="'.$virtualurl.'" target="_website">'.$virtualurl.'</a></center><br>';
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER))
|
if (!empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER))
|
||||||
{
|
{
|
||||||
$htmltext .= '<br>'.$langs->trans($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER);
|
$htmltext .= '<br>'.$langs->trans($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$htmltext .= $langs->trans("SetHereVirtualHost", $dataroot);
|
$htmltext .= $langs->trans("SetHereVirtualHost", $dataroot);
|
||||||
$htmltext .= '<br>';
|
$htmltext .= '<br>';
|
||||||
$htmltext .= '<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
$htmltext .= '<br>'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT);
|
||||||
@ -2380,8 +2345,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
{
|
{
|
||||||
print '<span class="websiteselection">'.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone').'</span>';
|
print '<span class="websiteselection">'.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone').'</span>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print $langs->trans("New");
|
print $langs->trans("New");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2556,15 +2520,13 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
//print '<input type="submit" class="button bordertransp" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("OnlyEditionOfSourceForGrabbedContent")).'" value="'.dol_escape_htmltag($langs->trans("EditWithEditor")).'" name="editcontent">';
|
//print '<input type="submit" class="button bordertransp" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("OnlyEditionOfSourceForGrabbedContent")).'" value="'.dol_escape_htmltag($langs->trans("EditWithEditor")).'" name="editcontent">';
|
||||||
print '<a class="nobordertransp opacitymedium nohoverborder marginleftonlyshort"'.$disabled.' href="#" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("OnlyEditionOfSourceForGrabbedContent")).'">'.img_picto($langs->trans("OnlyEditionOfSourceForGrabbedContent"), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
print '<a class="nobordertransp opacitymedium nohoverborder marginleftonlyshort"'.$disabled.' href="#" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("OnlyEditionOfSourceForGrabbedContent")).'">'.img_picto($langs->trans("OnlyEditionOfSourceForGrabbedContent"), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
//print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditWithEditor")).'" name="editcontent">';
|
//print '<input type="submit" class="button nobordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditWithEditor")).'" name="editcontent">';
|
||||||
if (empty($conf->global->WEBSITE_EDITINLINE))
|
if (empty($conf->global->WEBSITE_EDITINLINE))
|
||||||
{
|
{
|
||||||
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=seteditinline">'.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=seteditinline">'.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=unseteditinline">'.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=unseteditinline">'.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2576,8 +2538,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
{
|
{
|
||||||
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=unsetshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
print '<a class="nobordertransp nohoverborder marginleftonlyshort"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=unsetshowsubcontainers">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').'</a>';
|
||||||
}
|
}
|
||||||
/*}*/
|
/*}*/
|
||||||
@ -2592,8 +2553,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
//print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
//print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
||||||
print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"><span></a>';
|
print '<a href="#" class="button bordertransp disabled" disabled="disabled" title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"><span></a>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
//$disabled='';
|
//$disabled='';
|
||||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">';
|
||||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=setashome&website='.$website->ref.'&pageid='.$pageid.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"><span></a>';
|
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=setashome&website='.$website->ref.'&pageid='.$pageid.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'"><span class="fa fa-home valignmiddle btnTitle-icon"><span></a>';
|
||||||
@ -2662,8 +2622,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
{
|
{
|
||||||
print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
//img_help(($tooltiptrigger != '' ? 2 : 1), $alt)
|
//img_help(($tooltiptrigger != '' ? 2 : 1), $alt)
|
||||||
print $form->textwithpicto($langs->trans("SyntaxHelp").' '.img_help(2, $langs->trans("SyntaxHelp")), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution');
|
print $form->textwithpicto($langs->trans("SyntaxHelp").' '.img_help(2, $langs->trans("SyntaxHelp")), $htmltext, 1, 'none', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||||
}
|
}
|
||||||
@ -2747,8 +2706,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the php css file to remove php code and get only css part
|
// Clean the php css file to remove php code and get only css part
|
||||||
$csscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $csscontent);
|
$csscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $csscontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$csscontent = GETPOST('WEBSITE_CSS_INLINE', 'none');
|
$csscontent = GETPOST('WEBSITE_CSS_INLINE', 'none');
|
||||||
}
|
}
|
||||||
if (!trim($csscontent)) {
|
if (!trim($csscontent)) {
|
||||||
@ -2761,8 +2719,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the php js file to remove php code and get only js part
|
// Clean the php js file to remove php code and get only js part
|
||||||
$jscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $jscontent);
|
$jscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $jscontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$jscontent = GETPOST('WEBSITE_JS_INLINE', 'none');
|
$jscontent = GETPOST('WEBSITE_JS_INLINE', 'none');
|
||||||
}
|
}
|
||||||
if (!trim($jscontent)) $jscontent = '/* JS content (all pages) */'."\n";
|
if (!trim($jscontent)) $jscontent = '/* JS content (all pages) */'."\n";
|
||||||
@ -2773,8 +2730,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the php htmlheader file to remove php code and get only html part
|
// Clean the php htmlheader file to remove php code and get only html part
|
||||||
$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htmlheadercontent);
|
$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htmlheadercontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');
|
$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');
|
||||||
}
|
}
|
||||||
if (!trim($htmlheadercontent))
|
if (!trim($htmlheadercontent))
|
||||||
@ -2783,8 +2739,7 @@ if ($action == 'editcss')
|
|||||||
$htmlheadercontent .= $htmlheadercontentdefault;
|
$htmlheadercontent .= $htmlheadercontentdefault;
|
||||||
$htmlheadercontent .= "</html>";
|
$htmlheadercontent .= "</html>";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$htmlheadercontent = preg_replace('/^\s*<html>/ims', '', $htmlheadercontent);
|
$htmlheadercontent = preg_replace('/^\s*<html>/ims', '', $htmlheadercontent);
|
||||||
$htmlheadercontent = preg_replace('/<\/html>\s*$/ims', '', $htmlheadercontent);
|
$htmlheadercontent = preg_replace('/<\/html>\s*$/ims', '', $htmlheadercontent);
|
||||||
$htmlheadercontent = '<html>'."\n".trim($htmlheadercontent)."\n".'</html>';
|
$htmlheadercontent = '<html>'."\n".trim($htmlheadercontent)."\n".'</html>';
|
||||||
@ -2796,8 +2751,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the php htmlheader file to remove php code and get only html part
|
// Clean the php htmlheader file to remove php code and get only html part
|
||||||
$robotcontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $robotcontent);
|
$robotcontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $robotcontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$robotcontent = GETPOST('WEBSITE_ROBOT', 'nothtml');
|
$robotcontent = GETPOST('WEBSITE_ROBOT', 'nothtml');
|
||||||
}
|
}
|
||||||
if (!trim($robotcontent))
|
if (!trim($robotcontent))
|
||||||
@ -2814,8 +2768,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the php htaccesscontent file to remove php code and get only html part
|
// Clean the php htaccesscontent file to remove php code and get only html part
|
||||||
$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent);
|
$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $htaccesscontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');
|
$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');
|
||||||
}
|
}
|
||||||
if (!trim($htaccesscontent))
|
if (!trim($htaccesscontent))
|
||||||
@ -2831,8 +2784,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the manifestjson file to remove php code and get only html part
|
// Clean the manifestjson file to remove php code and get only html part
|
||||||
$manifestjsoncontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $manifestjsoncontent);
|
$manifestjsoncontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $manifestjsoncontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON', 'none');
|
$manifestjsoncontent = GETPOST('WEBSITE_MANIFEST_JSON', 'none');
|
||||||
}
|
}
|
||||||
if (!trim($manifestjsoncontent))
|
if (!trim($manifestjsoncontent))
|
||||||
@ -2846,8 +2798,7 @@ if ($action == 'editcss')
|
|||||||
// Clean the readme file to remove php code and get only html part
|
// Clean the readme file to remove php code and get only html part
|
||||||
$readmecontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $readmecontent);
|
$readmecontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP \?>\n*/ims', '', $readmecontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$readmecontent = GETPOST('WEBSITE_README', 'none');
|
$readmecontent = GETPOST('WEBSITE_README', 'none');
|
||||||
}
|
}
|
||||||
if (!trim($readmecontent))
|
if (!trim($readmecontent))
|
||||||
@ -3201,8 +3152,7 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
$pageauthoralias = $objectpage->author_alias;
|
$pageauthoralias = $objectpage->author_alias;
|
||||||
$pagestatus = $objectpage->status;
|
$pagestatus = $objectpage->status;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$type_container = 'page';
|
$type_container = 'page';
|
||||||
$pagedatecreation = dol_now();
|
$pagedatecreation = dol_now();
|
||||||
$pageauthorid = $user->id;
|
$pageauthorid = $user->id;
|
||||||
@ -3679,8 +3629,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -3719,8 +3668,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
|
|||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print $listofpages['message'];
|
print $listofpages['message'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3842,8 +3790,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
|
|||||||
// Remove the contenteditable="true"
|
// Remove the contenteditable="true"
|
||||||
$newcontent = preg_replace('/(div|section)(\s[^\>]*)contenteditable="true"/', '\1\2', $newcontent);
|
$newcontent = preg_replace('/(div|section)(\s[^\>]*)contenteditable="true"/', '\1\2', $newcontent);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Keep the contenteditable="true" when mode Edit Inline is on
|
// Keep the contenteditable="true" when mode Edit Inline is on
|
||||||
}
|
}
|
||||||
$out .= dolWebsiteReplacementOfLinks($object, $newcontent, 0, 'html', $objectpage->id)."\n";
|
$out .= dolWebsiteReplacementOfLinks($object, $newcontent, 0, 'html', $objectpage->id)."\n";
|
||||||
@ -3884,15 +3831,13 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
|
|||||||
/*print '<iframe class="websiteiframenoborder centpercent" src="'.DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$pageid.'"/>';
|
/*print '<iframe class="websiteiframenoborder centpercent" src="'.DOL_URL_ROOT.'/public/website/index.php?website='.$websitekey.'&pageid='.$pageid.'"/>';
|
||||||
print '</iframe>';*/
|
print '</iframe>';*/
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if (empty($websitekey) || $websitekey == '-1')
|
if (empty($websitekey) || $websitekey == '-1')
|
||||||
{
|
{
|
||||||
print '<br><br><div class="center previewnotyetavailable"><span class="">'.$langs->trans("NoWebSiteCreateOneFirst").'</span></div><br><br><br>';
|
print '<br><br><div class="center previewnotyetavailable"><span class="">'.$langs->trans("NoWebSiteCreateOneFirst").'</span></div><br><br><br>';
|
||||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print '<br><br><div class="center previewnotyetavailable"><span class="">'.$langs->trans("PreviewOfSiteNotYetAvailable", $object->ref).'</span></div><br><br><br>';
|
print '<br><br><div class="center previewnotyetavailable"><span class="">'.$langs->trans("PreviewOfSiteNotYetAvailable", $object->ref).'</span></div><br><br><br>';
|
||||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,19 +41,16 @@ if (!empty($hashp))
|
|||||||
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
||||||
//var_dump($original_file); exit;
|
//var_dump($original_file); exit;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print 'Bad link. File is from another module part.';
|
print 'Bad link. File is from another module part.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$modulepart = $moduleparttocheck;
|
$modulepart = $moduleparttocheck;
|
||||||
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
print "ErrorFileNotFoundWithSharedLink";
|
print "ErrorFileNotFoundWithSharedLink";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -156,8 +153,7 @@ if ($rss) {
|
|||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if (dol_move($outputfiletmp, $outputfile, 0, 1)) $result = 1;
|
if (dol_move($outputfiletmp, $outputfile, 0, 1)) $result = 1;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
|
$error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
|
||||||
dol_syslog("build_exportfile ".$error, LOG_ERR);
|
dol_syslog("build_exportfile ".$error, LOG_ERR);
|
||||||
dol_delete_file($outputfiletmp, 0, 1);
|
dol_delete_file($outputfiletmp, 0, 1);
|
||||||
@ -165,8 +161,7 @@ if ($rss) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
|
dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
|
||||||
dol_delete_file($outputfiletmp, 0, 1);
|
dol_delete_file($outputfiletmp, 0, 1);
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@ -208,8 +203,7 @@ elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file
|
|||||||
{
|
{
|
||||||
readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file));
|
readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
// Find the subdirectory name as the reference
|
// Find the subdirectory name as the reference
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname);
|
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname);
|
||||||
|
|||||||
@ -65,10 +65,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
|||||||
$month_end = $month_start - 1;
|
$month_end = $month_start - 1;
|
||||||
if ($month_end < 1)
|
if ($month_end < 1)
|
||||||
$month_end = 12;
|
$month_end = 12;
|
||||||
else
|
else $year_end++;
|
||||||
$year_end++;
|
} else $month_end = $month_start;
|
||||||
} else
|
|
||||||
$month_end = $month_start;
|
|
||||||
$date_start = dol_get_first_day($year_start, $month_start, false);
|
$date_start = dol_get_first_day($year_start, $month_start, false);
|
||||||
$date_end = dol_get_last_day($year_end, $month_end, false);
|
$date_end = dol_get_last_day($year_end, $month_end, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,8 +241,7 @@ if ($resql) {
|
|||||||
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
|
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
|
||||||
if ($reg[1] && $langs->transnoentitiesnoconv($reg[1]) != $reg[1])
|
if ($reg[1] && $langs->transnoentitiesnoconv($reg[1]) != $reg[1])
|
||||||
$description = $langs->transnoentitiesnoconv($reg[1]);
|
$description = $langs->transnoentitiesnoconv($reg[1]);
|
||||||
else
|
else $description = $objp->label;
|
||||||
$description = $objp->label;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ajout les liens (societe, company...)
|
* Ajout les liens (societe, company...)
|
||||||
|
|||||||
@ -137,8 +137,7 @@ if ($resql) {
|
|||||||
if ($oldemail != 'none') {
|
if ($oldemail != 'none') {
|
||||||
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
||||||
else
|
else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$oldemail = $newemail;
|
$oldemail = $newemail;
|
||||||
@ -168,8 +167,7 @@ if ($resql) {
|
|||||||
print "Service to expire ".$obj->ref.", label ".dol_concatdesc($obj->plabel, $obj->description).", due date ".dol_print_date($db->jdate($obj->date_fin_validite), 'day').", customer id ".$obj->sid." ".$obj->name.", ".($obj->cid ? "contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.", " : "")."email ".$newemail.", lang ".$outputlangs->defaultlang.": ";
|
print "Service to expire ".$obj->ref.", label ".dol_concatdesc($obj->plabel, $obj->description).", due date ".dol_print_date($db->jdate($obj->date_fin_validite), 'day').", customer id ".$obj->sid." ".$obj->name.", ".($obj->cid ? "contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.", " : "")."email ".$newemail.", lang ".$outputlangs->defaultlang.": ";
|
||||||
if (dol_strlen($newemail))
|
if (dol_strlen($newemail))
|
||||||
print "qualified.";
|
print "qualified.";
|
||||||
else
|
else print "disqualified (no email).";
|
||||||
print "disqualified (no email).";
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
unset($outputlangs);
|
unset($outputlangs);
|
||||||
@ -189,8 +187,7 @@ if ($resql) {
|
|||||||
if ($oldemail != 'none') {
|
if ($oldemail != 'none') {
|
||||||
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
||||||
else
|
else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,10 +230,8 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $
|
|||||||
if ($duration_value) {
|
if ($duration_value) {
|
||||||
if ($duration_value > 0)
|
if ($duration_value > 0)
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDuration", $duration_value);
|
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDuration", $duration_value);
|
||||||
else
|
else $title = $newlangs->transnoentities("ListOfServicesToExpireWithDurationNeg", $duration_value);
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDurationNeg", $duration_value);
|
} else $title = $newlangs->transnoentities("ListOfServicesToExpire");
|
||||||
} else
|
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpire");
|
|
||||||
|
|
||||||
$subject = (empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT) ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT);
|
$subject = (empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT) ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT);
|
||||||
$sendto = $oldemail;
|
$sendto = $oldemail;
|
||||||
|
|||||||
@ -133,8 +133,7 @@ if ($resql) {
|
|||||||
print "Service to expire ".$obj->ref.", label ".dol_concatdesc($obj->plabel, $obj->description).", due date ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email."): ";
|
print "Service to expire ".$obj->ref.", label ".dol_concatdesc($obj->plabel, $obj->description).", due date ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email."): ";
|
||||||
if (dol_strlen($obj->email))
|
if (dol_strlen($obj->email))
|
||||||
print "qualified.";
|
print "qualified.";
|
||||||
else
|
else print "disqualified (no email).";
|
||||||
print "disqualified (no email).";
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
unset($outputlangs);
|
unset($outputlangs);
|
||||||
@ -192,10 +191,8 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepre
|
|||||||
if ($duration_value) {
|
if ($duration_value) {
|
||||||
if ($duration_value > 0)
|
if ($duration_value > 0)
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDuration", $duration_value);
|
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDuration", $duration_value);
|
||||||
else
|
else $title = $newlangs->transnoentities("ListOfServicesToExpireWithDurationNeg", $duration_value);
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpireWithDurationNeg", $duration_value);
|
} else $title = $newlangs->transnoentities("ListOfServicesToExpire");
|
||||||
} else
|
|
||||||
$title = $newlangs->transnoentities("ListOfServicesToExpire");
|
|
||||||
|
|
||||||
$subject = (empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT) ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT);
|
$subject = (empty($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT) ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT);
|
||||||
$sendto = $oldemail;
|
$sendto = $oldemail;
|
||||||
|
|||||||
@ -106,8 +106,7 @@ if ($userlogin == 'firstadmin') {
|
|||||||
$userlogin = $obj->login;
|
$userlogin = $obj->login;
|
||||||
echo "First admin user found is login '".$userlogin."', entity ".$obj->entity."\n";
|
echo "First admin user found is login '".$userlogin."', entity ".$obj->entity."\n";
|
||||||
}
|
}
|
||||||
} else
|
} else dol_print_error($db);
|
||||||
dol_print_error($db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check user login
|
// Check user login
|
||||||
@ -193,8 +192,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
|||||||
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
|
dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
if ($result == 0)
|
if ($result == 0)
|
||||||
{
|
{
|
||||||
echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n";
|
echo "\nUser login: ".$userlogin." does not exists for entity ".$conf->entity."\n";
|
||||||
@ -260,8 +258,7 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) {
|
|||||||
|
|
||||||
$conf = $savconf;
|
$conf = $savconf;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
echo "cron_run_jobs.php no qualified job found\n";
|
echo "cron_run_jobs.php no qualified job found\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,8 +42,7 @@ if (!isset($argv[1]) || !$argv[1]) {
|
|||||||
$id = $argv[1];
|
$id = $argv[1];
|
||||||
if (isset($argv[2]) || !empty($argv[2]))
|
if (isset($argv[2]) || !empty($argv[2]))
|
||||||
$login = $argv[2];
|
$login = $argv[2];
|
||||||
else
|
else $login = '';
|
||||||
$login = '';
|
|
||||||
|
|
||||||
require_once $path."../../htdocs/master.inc.php";
|
require_once $path."../../htdocs/master.inc.php";
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
require_once DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php";
|
||||||
@ -206,23 +205,19 @@ if ($resql) {
|
|||||||
|
|
||||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||||
else
|
else $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'membersubscription'.$obj->source_id, 2);
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'membersubscription'.$obj->source_id, 2);
|
|
||||||
|
|
||||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||||
else
|
else $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'order'.$obj->source_id, 2);
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'order'.$obj->source_id, 2);
|
|
||||||
|
|
||||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||||
else
|
else $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'invoice'.$obj->source_id, 2);
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'invoice'.$obj->source_id, 2);
|
|
||||||
|
|
||||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE))
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||||
else
|
else $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'contractline'.$obj->source_id, 2);
|
||||||
$substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.'contractline'.$obj->source_id, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
complete_substitutions_array($substitutionarray, $langs);
|
complete_substitutions_array($substitutionarray, $langs);
|
||||||
|
|||||||
@ -135,8 +135,7 @@ if ($resql) {
|
|||||||
if ($oldemail != 'none') {
|
if ($oldemail != 'none') {
|
||||||
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
||||||
else
|
else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$oldemail = $newemail;
|
$oldemail = $newemail;
|
||||||
@ -166,8 +165,7 @@ if ($resql) {
|
|||||||
print "Unpaid invoice ".$obj->ref.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date), 'day').", customer id ".$obj->sid." ".$obj->name.", ".($obj->cid ? "contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.", " : "")."email ".$newemail.", lang ".$outputlangs->defaultlang.": ";
|
print "Unpaid invoice ".$obj->ref.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date), 'day').", customer id ".$obj->sid." ".$obj->name.", ".($obj->cid ? "contact id ".$obj->cid." ".$obj->clastname." ".$obj->cfirstname.", " : "")."email ".$newemail.", lang ".$outputlangs->defaultlang.": ";
|
||||||
if (dol_strlen($newemail))
|
if (dol_strlen($newemail))
|
||||||
print "qualified.";
|
print "qualified.";
|
||||||
else
|
else print "disqualified (no email).";
|
||||||
print "disqualified (no email).";
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
unset($outputlangs);
|
unset($outputlangs);
|
||||||
@ -187,8 +185,7 @@ if ($resql) {
|
|||||||
if ($oldemail != 'none') {
|
if ($oldemail != 'none') {
|
||||||
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
if (empty($trackthirdpartiessent[$oldsid.'|'.$oldemail]))
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
print "- No email sent for '".$oldtarget."', total: ".$total."\n";
|
||||||
else
|
else print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
||||||
print "- No email sent for '".$oldtarget."', total: ".$total." (already sent to ".$trackthirdpartiessent[$oldsid.'|'.$oldemail].")\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,8 +137,7 @@ if ($resql) {
|
|||||||
print "Unpaid invoice ".$obj->ref.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date), 'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email.", lang ".$outputlangs->defaultlang."): ";
|
print "Unpaid invoice ".$obj->ref.", price ".price2num($obj->total_ttc).", due date ".dol_print_date($db->jdate($obj->due_date), 'day')." (linked to company ".$obj->name.", sale representative ".dolGetFirstLastname($obj->firstname, $obj->lastname).", email ".$obj->email.", lang ".$outputlangs->defaultlang."): ";
|
||||||
if (dol_strlen($obj->email))
|
if (dol_strlen($obj->email))
|
||||||
print "qualified.";
|
print "qualified.";
|
||||||
else
|
else print "disqualified (no email).";
|
||||||
print "disqualified (no email).";
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
unset($outputlangs);
|
unset($outputlangs);
|
||||||
|
|||||||
@ -114,8 +114,7 @@ print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
|||||||
print "DN to extract=".$conf->global->LDAP_MEMBER_DN."\n";
|
print "DN to extract=".$conf->global->LDAP_MEMBER_DN."\n";
|
||||||
if (!empty($conf->global->LDAP_MEMBER_FILTER))
|
if (!empty($conf->global->LDAP_MEMBER_FILTER))
|
||||||
print 'Filter=('.$conf->global->LDAP_MEMBER_FILTER.')'."\n"; // Note: filter is defined into function getRecords
|
print 'Filter=('.$conf->global->LDAP_MEMBER_FILTER.')'."\n"; // Note: filter is defined into function getRecords
|
||||||
else
|
else print 'Filter=('.$conf->global->LDAP_KEY_MEMBERS.'=*)'."\n";
|
||||||
print 'Filter=('.$conf->global->LDAP_KEY_MEMBERS.'=*)'."\n";
|
|
||||||
print "----- To Dolibarr database:\n";
|
print "----- To Dolibarr database:\n";
|
||||||
print "type=".$conf->db->type."\n";
|
print "type=".$conf->db->type."\n";
|
||||||
print "host=".$conf->db->host."\n";
|
print "host=".$conf->db->host."\n";
|
||||||
@ -278,8 +277,7 @@ if ($result >= 0) {
|
|||||||
if (!$error || $forcecommit) {
|
if (!$error || $forcecommit) {
|
||||||
if (!$error)
|
if (!$error)
|
||||||
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
||||||
else
|
else print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
||||||
print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
||||||
|
|||||||
@ -162,8 +162,7 @@ if ($result >= 0) {
|
|||||||
if (!$error || $forcecommit) {
|
if (!$error || $forcecommit) {
|
||||||
if (!$error)
|
if (!$error)
|
||||||
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
||||||
else
|
else print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
||||||
print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
||||||
|
|||||||
@ -211,8 +211,7 @@ if ($result >= 0) {
|
|||||||
if (!$error || $forcecommit) {
|
if (!$error || $forcecommit) {
|
||||||
if (!$error)
|
if (!$error)
|
||||||
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
||||||
else
|
else print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
||||||
print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
||||||
|
|||||||
@ -93,8 +93,7 @@ print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
|||||||
print "DN to extract=".$conf->global->LDAP_USER_DN."\n";
|
print "DN to extract=".$conf->global->LDAP_USER_DN."\n";
|
||||||
if (!empty($conf->global->LDAP_FILTER_CONNECTION))
|
if (!empty($conf->global->LDAP_FILTER_CONNECTION))
|
||||||
print 'Filter=('.$conf->global->LDAP_FILTER_CONNECTION.')'."\n"; // Note: filter is defined into function getRecords
|
print 'Filter=('.$conf->global->LDAP_FILTER_CONNECTION.')'."\n"; // Note: filter is defined into function getRecords
|
||||||
else
|
else print 'Filter=('.$conf->global->LDAP_KEY_USERS.'=*)'."\n";
|
||||||
print 'Filter=('.$conf->global->LDAP_KEY_USERS.'=*)'."\n";
|
|
||||||
print "----- To Dolibarr database:\n";
|
print "----- To Dolibarr database:\n";
|
||||||
print "type=".$conf->db->type."\n";
|
print "type=".$conf->db->type."\n";
|
||||||
print "host=".$conf->db->host."\n";
|
print "host=".$conf->db->host."\n";
|
||||||
@ -254,8 +253,7 @@ if ($result >= 0) {
|
|||||||
if (!$error || $forcecommit) {
|
if (!$error || $forcecommit) {
|
||||||
if (!$error)
|
if (!$error)
|
||||||
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
print $langs->transnoentities("NoErrorCommitIsDone")."\n";
|
||||||
else
|
else print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
||||||
print $langs->transnoentities("ErrorButCommitIsDone")."\n";
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
print $langs->transnoentities("ErrorSomeErrorWereFoundRollbackIsDone", $error)."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user