diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index a15a70797e4..91a8f7e44cc 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -30,10 +30,13 @@ $langs->load("admin"); $langs->load("users"); $langs->load("other"); -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); +/* + * Actions + */ + if ($_GET["action"] == 'add') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1"; @@ -79,56 +82,56 @@ $modulesdir = array(); foreach ($conf->file->dol_document_root as $type => $dirroot) { - $modulesdir[] = $dirroot . "/includes/modules/"; + $modulesdir[] = $dirroot . "/includes/modules/"; - if ($type == 'alt') - { - $handle=@opendir($dirroot); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') - { - if (is_dir($dirroot . '/' . $file . '/includes/modules/')) - { - $modulesdir[] = $dirroot . '/' . $file . '/includes/modules/'; - } - } - } - closedir($handle); - } - } + if ($type == 'alt') + { + $handle=@opendir($dirroot); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + { + if (is_dir($dirroot . '/' . $file . '/includes/modules/')) + { + $modulesdir[] = $dirroot . '/' . $file . '/includes/modules/'; + } + } + } + closedir($handle); + } + } } foreach ($modulesdir as $dir) { - // Load modules attributes in arrays (name, numero, orders) from dir directory - //print $dir."\n
"; - $handle=@opendir($dir); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, dol_strlen($file) - 10); + // Load modules attributes in arrays (name, numero, orders) from dir directory + //print $dir."\n
"; + $handle=@opendir($dir); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($modName) - { - include_once($dir."/".$file); - $objMod = new $modName($db); - if ($objMod->rights_class) { + if ($modName) + { + include_once($dir."/".$file); + $objMod = new $modName($db); + if ($objMod->rights_class) { - $ret=$objMod->insert_permissions(0); + $ret=$objMod->insert_permissions(0); - $modules[$objMod->rights_class]=$objMod; - //print "modules[".$objMod->rights_class."]=$objMod;"; - } - } - } - } - } + $modules[$objMod->rights_class]=$objMod; + //print "modules[".$objMod->rights_class."]=$objMod;"; + } + } + } + } + } } $db->commit(); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 85b5ee9b08e..5ef95680a74 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -33,74 +33,79 @@ $langs->load("admin"); $langs->load("withdrawals"); // Security check -if (!$user->admin) -accessforbidden(); +if (!$user->admin) accessforbidden(); $action = GETPOST("action"); + +/* + * Actions + */ + if ($action == "set") { - $db->begin(); - for ($i = 0 ; $i < 2 ; $i++) - { - $res = dolibarr_set_const($db, $_POST["nom$i"], $_POST["value$i"],'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - - $id=$_POST["PRELEVEMENT_ID_BANKACCOUNT"]; - $account = new Account($db, $id); - - if($account->fetch($id)>0) - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_NUMERO_COMPTE", $account->number,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_NUMBER_KEY", $account->cle_rib,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_IBAN", $account->iban,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - else $error++; - - if (! $error) + $db->begin(); + for ($i = 0 ; $i < 2 ; $i++) { - $db->commit(); + $res = dolibarr_set_const($db, $_POST["nom$i"], $_POST["value$i"],'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + + $id=$_POST["PRELEVEMENT_ID_BANKACCOUNT"]; + $account = new Account($db, $id); + + if($account->fetch($id)>0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_NUMERO_COMPTE", $account->number,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_NUMBER_KEY", $account->cle_rib,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_IBAN", $account->iban,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + else $error++; + + if (! $error) + { + $db->commit(); $mesg = "".$langs->trans("SetupSaved").""; } else { - $db->rollback(); + $db->rollback(); $mesg = "".$langs->trans("Error").""; } } if ($action == "addnotif") { - $bon = new BonPrelevement($db); - $bon->AddNotification($db,$_POST["user"],$_POST["action"]); + $bon = new BonPrelevement($db); + $bon->AddNotification($db,$_POST["user"],$_POST["action"]); - Header("Location: prelevement.php"); - exit; + Header("Location: prelevement.php"); + exit; } if ($action == "deletenotif") { - $bon = new BonPrelevement($db); - $bon->DeleteNotificationById($_GET["notif"]); + $bon = new BonPrelevement($db); + $bon->DeleteNotificationById($_GET["notif"]); - Header("Location: prelevement.php"); - exit; + Header("Location: prelevement.php"); + exit; } + /* * View */ @@ -157,39 +162,39 @@ print '
'; if ($conf->global->MAIN_MODULE_NOTIFICATION) { - $langs->load("mails"); - print_titre($langs->trans("Notifications")); - - $sql = "SELECT rowid, name, firstname, fk_societe, email"; - $sql.= " FROM ".MAIN_DB_PREFIX."user"; - $sql.= " WHERE entity IN (0,".$conf->entity.")"; - - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $var = true; - $i = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; - if (!$obj->fk_societe) - { - $username= $obj->firstname.' '.$obj->name; - $internalusers[$obj->rowid] = $username; - } - - $i++; - } - $db->free($resql); - } - - $sql = "SELECT rowid, code, label"; + $langs->load("mails"); + print_titre($langs->trans("Notifications")); + + $sql = "SELECT rowid, name, firstname, fk_societe, email"; + $sql.= " FROM ".MAIN_DB_PREFIX."user"; + $sql.= " WHERE entity IN (0,".$conf->entity.")"; + + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $var = true; + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; + if (!$obj->fk_societe) + { + $username= $obj->firstname.' '.$obj->name; + $internalusers[$obj->rowid] = $username; + } + + $i++; + } + $db->free($resql); + } + + $sql = "SELECT rowid, code, label"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger"; $sql.= " WHERE elementtype = 'withdraw'"; $sql.= " ORDER BY rang ASC"; - + $resql = $db->query($sql); if ($resql) { @@ -205,26 +210,26 @@ if ($conf->global->MAIN_MODULE_NOTIFICATION) } $db->free($resql); } - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - print ''; print '"; @@ -226,11 +226,11 @@ print ''; print '"; @@ -296,14 +296,14 @@ print ''; print '"; diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 1333ae4003e..59e6b70bb68 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -31,11 +31,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); $langs->load("admin"); -if (!$user->admin) -accessforbidden(); +if (!$user->admin) accessforbidden(); $action=GETPOST("action"); -$value = GETPOST("value"); +$value=GETPOST("value"); /* @@ -123,7 +122,7 @@ if ($action == 'set') $sql.= ($label?"'".$db->escape($label)."'":'null').", "; $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); $sql.= ")"; - + $resql=$db->query($sql); if (! $resql) dol_print_error($db); } diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 93ed3b25099..079937d980d 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -29,10 +29,9 @@ $langs->load("admin"); $langs->load("stocks"); // Securit check -if (!$user->admin) -accessforbidden(); +if (!$user->admin) accessforbidden(); -$action = getpost("action"); +$action = GETPOST("action"); /* diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index bedb7321d67..dc41e048ba6 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -26,8 +26,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); -if (!$user->admin) -accessforbidden(); +if (!$user->admin) accessforbidden(); $langs->load("admin"); $langs->load("other"); @@ -37,12 +36,13 @@ $action = GETPOST("action"); /* * Actions */ + if ($action== 'setlevel') { $level = GETPOST("level"); $res = dolibarr_set_const($db,"SYSLOG_LEVEL",$level,'chaine',0,'',0); dol_syslog("admin/syslog: level ".$level); - + if (! $res > 0) $error++; if (! $error) { @@ -56,7 +56,7 @@ if ($action== 'setlevel') if ($action == 'set') { - $optionlogoutput=GETPOST("optionlogoutput"); + $optionlogoutput=GETPOST("optionlogoutput"); $facility=GETPOST("facility"); if ($optionlogoutput == "syslog") { diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 27c362d580d..995186ce6a7 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -29,8 +29,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); $langs->load('admin'); -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); $action = GETPOST("action"); @@ -54,63 +53,63 @@ $tax_mode = empty($conf->global->TAX_MODE)?0:$conf->global->TAX_MODE; if ($action == 'settaxmode') { - $tax_mode = GETPOST("tax_mode"); - - $db->begin(); - - $res = dolibarr_set_const($db, 'TAX_MODE', $tax_mode,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - - switch ($tax_mode) - { - case 0: - $value = 'payment'; - break; - case 1: - $value = 'invoice'; - break; - } - - $res = dolibarr_set_const($db, 'TAX_MODE_SELL_PRODUCT', 'invoice','chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, 'TAX_MODE_BUY_PRODUCT', 'invoice','chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, 'TAX_MODE_SELL_SERVICE', $value,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - $res = dolibarr_set_const($db, 'TAX_MODE_BUY_SERVICE', $value,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - - if (! $error) + $tax_mode = GETPOST("tax_mode"); + + $db->begin(); + + $res = dolibarr_set_const($db, 'TAX_MODE', $tax_mode,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + + switch ($tax_mode) { - $db->commit(); + case 0: + $value = 'payment'; + break; + case 1: + $value = 'invoice'; + break; + } + + $res = dolibarr_set_const($db, 'TAX_MODE_SELL_PRODUCT', 'invoice','chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, 'TAX_MODE_BUY_PRODUCT', 'invoice','chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, 'TAX_MODE_SELL_SERVICE', $value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + $res = dolibarr_set_const($db, 'TAX_MODE_BUY_SERVICE', $value,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + + if (! $error) + { + $db->commit(); $mesg = "".$langs->trans("SetupSaved").""; } else { - $db->rollback(); + $db->rollback(); $mesg = "".$langs->trans("Error").""; } - + } /* -if ($_POST['action'] == 'update' || $_POST['action'] == 'add') -{ - if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : '',$conf->entity)); - { - print $db->error(); - } -} + if ($_POST['action'] == 'update' || $_POST['action'] == 'add') + { + if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : '',$conf->entity)); + { + print $db->error(); + } + } -if ($_GET['action'] == 'delete') -{ - if (! dolibarr_del_const($db, $_GET['constname'],$conf->entity)); - { - print $db->error(); - } -} -*/ + if ($_GET['action'] == 'delete') + { + if (! dolibarr_del_const($db, $_GET['constname'],$conf->entity)); + { + print $db->error(); + } + } + */ /* @@ -127,50 +126,50 @@ print_fiche_titre($langs->trans('TaxSetup'),$linkback,'setup'); print '
'; if (empty($mysoc->tva_assuj)) { - print $langs->trans("YourCompanyDoesNotUseVAT").'
'; + print $langs->trans("YourCompanyDoesNotUseVAT").'
'; } else { - print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + + print ''; - - print ''; - - print ''; + + print ''; + + print ''; } // List of current notifications for objet_type='withdraw' $sql = "SELECT u.name, u.firstname"; @@ -239,23 +244,23 @@ $sql.= " AND u.entity IN (0,".$conf->entity.")"; $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; - $var = false; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; + $num = $db->num_rows($resql); + $i = 0; + $var = false; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; - print ""; - print ''; - $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); - print ''; - print ''; - print ''; - $i++; - } - $db->free($resql); + print ""; + print ''; + $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); + print ''; + print ''; + print ''; + $i++; + } + $db->free($resql); } print '
'.$langs->trans("User").''.$langs->trans("Value").''.$langs->trans("Action").'
'; print $html->selectarray('user',$internalusers);// select_users(0,'user',0); print ''; - print $html->selectarray('action',$actions);// select_users(0,'user',0); - print '
'; + print $html->selectarray('action',$actions);// select_users(0,'user',0); + print '
'.$obj->firstname." ".$obj->name.''.$label.'rowid.'">'.img_delete().'
'.$obj->firstname." ".$obj->name.''.$label.'rowid.'">'.img_delete().'
'; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 8e2b35a9e68..f79af4b7e06 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -41,96 +41,96 @@ $upload_dir=$conf->admin->dir_temp; if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); + require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); - $result=create_exdir($upload_dir); // Create dir if not exists + $result=create_exdir($upload_dir); // Create dir if not exists if ($result >= 0) { - $resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1,0,$_FILES['userfile']['error']); + $resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1,0,$_FILES['userfile']['error']); - if (is_numeric($resupload) && $resupload > 0) - { - $mesg = '
'.$langs->trans("FileTransferComplete").'
'; + if (is_numeric($resupload) && $resupload > 0) + { + $mesg = '
'.$langs->trans("FileTransferComplete").'
'; - include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); - $formmail = new FormMail($db); - $formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']); - } - else - { - $langs->load("errors"); - if ($resupload < 0) // Unknown error - { - $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; - } - else if (preg_match('/ErrorFileIsInfectedWithAVirus.(.*)/',$resupload,$reg)) // Files infected by a virus - { - $mesg = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus"); - $mesg.= '
'.$langs->trans("Information").': '.$langs->trans($reg[1]); - $mesg.= '
'; - } - else // Known error - { - $mesg = '
'.$langs->trans($resupload).'
'; - } - } + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); + $formmail = new FormMail($db); + $formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']); + } + else + { + $langs->load("errors"); + if ($resupload < 0) // Unknown error + { + $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; + } + else if (preg_match('/ErrorFileIsInfectedWithAVirus.(.*)/',$resupload,$reg)) // Files infected by a virus + { + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus"); + $mesg.= '
'.$langs->trans("Information").': '.$langs->trans($reg[1]); + $mesg.= '
'; + } + else // Known error + { + $mesg = '
'.$langs->trans($resupload).'
'; + } + } } } if ($_GET["action"] == 'activate_captcha') { - dolibarr_set_const($db, "MAIN_SECURITY_ENABLECAPTCHA", '1','chaine',0,'',$conf->entity); - Header("Location: security_other.php"); - exit; + dolibarr_set_const($db, "MAIN_SECURITY_ENABLECAPTCHA", '1','chaine',0,'',$conf->entity); + Header("Location: security_other.php"); + exit; } else if ($_GET["action"] == 'disable_captcha') { - dolibarr_del_const($db, "MAIN_SECURITY_ENABLECAPTCHA",$conf->entity); - Header("Location: security_other.php"); - exit; + dolibarr_del_const($db, "MAIN_SECURITY_ENABLECAPTCHA",$conf->entity); + Header("Location: security_other.php"); + exit; } if ($_GET["action"] == 'activate_advancedperms') { - dolibarr_set_const($db, "MAIN_USE_ADVANCED_PERMS", '1','chaine',0,'',$conf->entity); - Header("Location: security_other.php"); - exit; + dolibarr_set_const($db, "MAIN_USE_ADVANCED_PERMS", '1','chaine',0,'',$conf->entity); + Header("Location: security_other.php"); + exit; } else if ($_GET["action"] == 'disable_advancedperms') { - dolibarr_del_const($db, "MAIN_USE_ADVANCED_PERMS",$conf->entity); - Header("Location: security_other.php"); - exit; + dolibarr_del_const($db, "MAIN_USE_ADVANCED_PERMS",$conf->entity); + Header("Location: security_other.php"); + exit; } if ($_GET["action"] == 'MAIN_SESSION_TIMEOUT') { - if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db); + else $mesg=$langs->trans("RecordModifiedSuccessfully"); } if ($_GET["action"] == 'MAIN_UPLOAD_DOC') { - if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db); + else $mesg=$langs->trans("RecordModifiedSuccessfully"); } if ($_GET["action"] == 'MAIN_UMASK') { - if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db); + else $mesg=$langs->trans("RecordModifiedSuccessfully"); } if ($_GET["action"] == 'MAIN_ANTIVIRUS_COMMAND') { - if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db); + else $mesg=$langs->trans("RecordModifiedSuccessfully"); } if ($_GET["action"] == 'MAIN_ANTIVIRUS_PARAM') { - if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db); - else $mesg=$langs->trans("RecordModifiedSuccessfully"); + if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db); + else $mesg=$langs->trans("RecordModifiedSuccessfully"); } @@ -199,20 +199,20 @@ print '
'.$langs->trans("UseCaptchaCode").''; if (function_exists("imagecreatefrompng")) { - if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 0) - { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1) - { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; - } + if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 0) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1) + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } } else { - $html = new Form($db); - $desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning'); - print $desc; + $html = new Form($db); + $desc = $html->textwithpicto('',$langs->transnoentities("EnableGDLibraryDesc"),1,'warning'); + print $desc; } print "'.$langs->trans("UseAdvancedPerms").''; if ($conf->global->MAIN_USE_ADVANCED_PERMS == 0) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } if($conf->global->MAIN_USE_ADVANCED_PERMS == 1) { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } print "'; if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { - $langs->load("errors"); - $basedir=preg_replace('/"/','',dirname($conf->global->MAIN_ANTIVIRUS_COMMAND)); - $listdir=explode(';',ini_get('safe_mode_exec_dir')); - if (! in_array($basedir,$listdir)) - { - print img_warning($langs->trans('WarningSafeModeOnCheckExecDir')); - dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING); - } + $langs->load("errors"); + $basedir=preg_replace('/"/','',dirname($conf->global->MAIN_ANTIVIRUS_COMMAND)); + $listdir=explode(';',ini_get('safe_mode_exec_dir')); + if (! in_array($basedir,$listdir)) + { + print img_warning($langs->trans('WarningSafeModeOnCheckExecDir')); + dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING); + } } print ''; print "
'; + print '
'; - // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - print ''; - print '\n"; - print ''; - print '\n"; - print ''; + // Cas des parametres TAX_MODE_SELL/BUY_SERVICE/PRODUCT + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + print '\n"; + print ''; + print '\n"; + print ''; - print "
'.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
'.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); - print "
'.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
'.$langs->trans('OptionVatMode').''.$langs->trans('Description').'
'.$langs->trans('OptionVATDefault').''.nl2br($langs->trans('OptionVatDefaultDesc')); + print "
'.$langs->trans('OptionVATDebitOption').''.nl2br($langs->trans('OptionVatDebitOptionDesc'))."
\n"; + print "\n"; - print '

'; - print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); - //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; + print '

'; + print_fiche_titre($langs->trans("SummaryOfVatExigibilityUsedByDefault"),'',''); + //print ' ('.$langs->trans("CanBeChangedWhenMakingInvoice").')'; - print ''; - print ''; + print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'; + print ''; - // Products - print ''; - print ''; - print ''; + // Products + print ''; + print ''; + print ''; - // Services - print ''; - print ''; + print ''; - print ''; + print ''; + print ''; - print '
 '.$langs->trans("Buy").''.$langs->trans("Sell").'
'.$langs->trans("Product").''; - print $langs->trans("OnDelivery"); - print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; - print ''; - print $langs->trans("OnDelivery"); - print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; - print '
'.$langs->trans("Product").''; + print $langs->trans("OnDelivery"); + print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; + print ''; + print $langs->trans("OnDelivery"); + print ' ('.$langs->trans("SupposedToBeInvoiceDate").')'; + print '
'.$langs->trans("Services").''; + // Services + print '
'.$langs->trans("Services").''; if ($tax_mode == 0) { print $langs->trans("OnPayment"); @@ -181,21 +180,21 @@ else print $langs->trans("OnInvoice"); print ' ('.$langs->trans("InvoiceDateUsed").')'; } - print ''; - if ($tax_mode == 0) - { - print $langs->trans("OnPayment"); - print ' ('.$langs->trans("SupposedToBePaymentDate").')'; - } - if ($tax_mode == 1) - { - print $langs->trans("OnInvoice"); - print ' ('.$langs->trans("InvoiceDateUsed").')'; - } - print '
'; + if ($tax_mode == 0) + { + print $langs->trans("OnPayment"); + print ' ('.$langs->trans("SupposedToBePaymentDate").')'; + } + if ($tax_mode == 1) + { + print $langs->trans("OnInvoice"); + print ' ('.$langs->trans("InvoiceDateUsed").')'; + } + print '
'; + print ''; } dol_htmloutput_mesg($mesg); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 4a203ae5b4f..c42ff64e79a 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -422,7 +422,7 @@ else // Open and return file $original_file_osencoded=dol_osencode($original_file); // This test if file exists should be useless. We keep it to find bug more easily - if (! dol_is_file($original_file_osencoded)) + if (! dol_is_file($original_file_osencoded)) { $error='Error: File '.$_GET["file"].' does not exists or filesystems permissions are not allowed'; dol_print_error(0,$error);