--- /tmp/dsg/dolibarr/htdocs/projet/admin/github_project.php
+++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project.php
@@ -39,7 +39,7 @@
if (!$user->admin) accessforbidden();
$value = GETPOST('value', 'alpha');
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type = 'project';
@@ -58,12 +58,14 @@
if ($maskconstproject) $res = dolibarr_set_const($db, $maskconstproject, $maskproject, 'chaine', 0, '', $conf->entity);
- if (!($res > 0)) $error++;
+ if (!$res > 0) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- } else {
+ }
+ else
+ {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -75,15 +77,19 @@
if ($maskconstmasktask) $res = dolibarr_set_const($db, $maskconstmasktask, $masktaskt, 'chaine', 0, '', $conf->entity);
- if (!($res > 0)) $error++;
+ if (!$res > 0) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- } else {
+ }
+ else
+ {
setEventMessages($langs->trans("Error"), null, 'errors');
}
-} elseif ($action == 'specimen')
+}
+
+elseif ($action == 'specimen')
{
$modele = GETPOST('module', 'alpha');
@@ -114,15 +120,21 @@
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project&file=SPECIMEN.pdf");
return;
- } else {
+ }
+ else
+ {
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
- } else {
+ }
+ else
+ {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
-} elseif ($action == 'specimentask')
+}
+
+elseif ($action == 'specimentask')
{
$modele = GETPOST('module', 'alpha');
@@ -153,11 +165,15 @@
{
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=project_task&file=SPECIMEN.pdf");
return;
- } else {
+ }
+ else
+ {
setEventMessages($obj->error, $obj->errors, 'errors');
dol_syslog($obj->error, LOG_ERR);
}
- } else {
+ }
+ else
+ {
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
}
@@ -172,7 +188,9 @@
elseif ($action == 'settask')
{
$ret = addDocumentModel($value, 'project_task', $label, $scandir);
-} elseif ($action == 'del')
+}
+
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -200,7 +218,9 @@
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-} elseif ($action == 'setdoctask')
+}
+
+elseif ($action == 'setdoctask')
{
if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
{
@@ -215,19 +235,24 @@
{
$ret = addDocumentModel($value, 'project_task', $label, $scandir);
}
-} elseif ($action == 'setmod')
+}
+
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "PROJECT_ADDON", $value, 'chaine', 0, '', $conf->entity);
-} elseif ($action == 'setmodtask')
+}
+
+elseif ($action == 'setmodtask')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
dolibarr_set_const($db, "PROJECT_TASK_ADDON", $value, 'chaine', 0, '', $conf->entity);
-} elseif ($action == 'updateoptions')
+}
+elseif ($action == 'updateoptions')
{
if (GETPOST('PROJECT_USE_SEARCH_TO_SELECT'))
{
@@ -260,7 +285,7 @@
$head = project_admin_prepare_head();
-print dol_get_fiche_head($head, 'project', $langs->trans("Projects"), -1, 'project');
+dol_fiche_head($head, 'project', $langs->trans("Projects"), -1, 'project');
@@ -350,10 +375,8 @@
// Show example of numbering model
print '
';
$tmp = $module->getExample();
- if (preg_match('/^Error/', $tmp)) {
- $langs->load("errors");
- print ' '.$langs->trans($tmp).' ';
- } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
+ if (preg_match('/^Error/', $tmp)) print ''.$langs->trans($tmp).' ';
+ elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $tmp;
print ' | '."\n";
@@ -361,8 +384,10 @@
if ($conf->global->PROJECT_ADDON == 'mod_'.$classname)
{
print img_picto($langs->trans("Activated"), 'switch_on');
- } else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ }
+ else
+ {
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').'';
}
print '';
@@ -379,7 +404,9 @@
if ($nextval)
{
$htmltooltip .= $nextval.'
';
- } else {
+ }
+ else
+ {
$htmltooltip .= $langs->trans($module->error).'
';
}
}
@@ -449,10 +476,8 @@
// Show example of numbering module
print '';
$tmp = $module->getExample();
- if (preg_match('/^Error/', $tmp)) {
- $langs->load("errors");
- print ' '.$langs->trans($tmp).' ';
- } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
+ if (preg_match('/^Error/', $tmp)) print ''.$langs->trans($tmp).' ';
+ elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
else print $tmp;
print ' | '."\n";
@@ -460,8 +485,10 @@
if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname)
{
print img_picto($langs->trans("Activated"), 'switch_on');
- } else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ }
+ else
+ {
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').'';
}
print '';
@@ -478,7 +505,9 @@
if ($nextval)
{
$htmltooltip .= $nextval.'
';
- } else {
+ }
+ else
+ {
$htmltooltip .= $langs->trans($module->error).'
';
}
}
@@ -512,7 +541,7 @@
$sql = "SELECT nom";
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
-$sql .= " WHERE type = '".$db->escape($type)."'";
+$sql .= " WHERE type = '".$type."'";
$sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
@@ -526,7 +555,9 @@
array_push($def, $array[0]);
$i++;
}
-} else {
+}
+else
+{
dol_print_error($db);
}
@@ -589,13 +620,15 @@
if (in_array($name, $def))
{
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print 'scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
print " | ";
- } else {
+ }
+ else
+ {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
print " | ";
}
@@ -604,8 +637,10 @@
if ($conf->global->PROJECT_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"), 'on');
- } else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ }
+ else
+ {
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
}
print '';
@@ -628,7 +663,9 @@
if ($module->type == 'pdf')
{
print ''.img_object($langs->trans("Preview"), 'bill').'';
- } else {
+ }
+ else
+ {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -661,7 +698,7 @@
$sql = "SELECT nom";
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
- $sql .= " WHERE type = '".$db->escape($type)."'";
+ $sql .= " WHERE type = '".$type."'";
$sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
@@ -675,7 +712,9 @@
array_push($def, $array[0]);
$i++;
}
- } else {
+ }
+ else
+ {
dol_print_error($db);
}
@@ -742,9 +781,11 @@
print img_picto($langs->trans("Enabled"), 'switch_on');
print '';
print "";
- } else {
+ }
+ else
+ {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
+ print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'';
print " | ";
}
@@ -753,8 +794,10 @@
if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"), 'on');
- } else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ }
+ else
+ {
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
}
print '';
@@ -777,7 +820,9 @@
if ($module->type == 'pdf')
{
print ''.img_object($langs->trans("Preview"), 'bill').'';
- } else {
+ }
+ else
+ {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '';
@@ -817,7 +862,9 @@
print '';
print $langs->trans("NotAvailableWhenAjaxDisabled");
print " | ";
-} else {
+}
+else
+{
print '';
$arrval = array('0'=>$langs->trans("No"),
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
--- /tmp/dsg/dolibarr/htdocs/projet/admin/github_project_extrafields.php
+++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project_extrafields.php
@@ -40,7 +40,7 @@
$type2label = array('');
foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'projet'; //Must be the $table_element of the class that manage extrafield
@@ -69,11 +69,11 @@
$head = project_admin_prepare_head();
-print dol_get_fiche_head($head, 'attributes', $langs->trans("Projects"), -1, 'project');
+dol_fiche_head($head, 'attributes', $langs->trans("Projects"), -1, 'project');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
-print dol_get_fiche_end();
+dol_fiche_end();
// Buttons
@@ -96,7 +96,7 @@
print " ";
print load_fiche_titre($langs->trans('NewAttribute'));
- require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/* ************************************************************************** */
@@ -109,7 +109,7 @@
print " ";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
- require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
--- /tmp/dsg/dolibarr/htdocs/projet/admin/github_project_task_extrafields.php
+++ /tmp/dsg/dolibarr/htdocs/projet/admin/client_project_task_extrafields.php
@@ -41,7 +41,7 @@
$type2label = array('');
foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$attrname = GETPOST('attrname', 'alpha');
$elementtype = 'projet_task';
@@ -69,11 +69,11 @@
$head = project_admin_prepare_head();
-print dol_get_fiche_head($head, 'attributes_task', $langs->trans("Projects"), -1, 'project');
+dol_fiche_head($head, 'attributes_task', $langs->trans("Projects"), -1, 'project');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
-print dol_get_fiche_end();
+dol_fiche_end();
// Buttons
@@ -96,7 +96,7 @@
print " ";
print load_fiche_titre($langs->trans('NewAttribute'));
- require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/* ************************************************************************** */
@@ -109,7 +109,7 @@
print " ";
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
- require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
// End of page
|