2
0
forked from Wavyzz/dolibarr

Fix: wrong EOL

This commit is contained in:
Regis Houssin
2012-12-02 11:03:23 +01:00
parent c3aa626e18
commit 00aa22e1d7
14 changed files with 1391 additions and 1391 deletions

View File

@@ -29,7 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("admin");
$langs->load("members");

View File

@@ -42,7 +42,7 @@ function commissions_admin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin');
complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin');
complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin','remove');

View File

@@ -54,7 +54,7 @@ function categories_prepare_head($object,$type)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type);
complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type,'remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'categories_'.$type,'remove');
return $head;
}

View File

@@ -71,7 +71,7 @@ function contact_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact','remove');
return $head;
}

View File

@@ -93,7 +93,7 @@ function facture_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove');
return $head;
}

View File

@@ -98,7 +98,7 @@ function propal_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal','remove');
return $head;
}

View File

@@ -98,7 +98,7 @@ function user_prepare_head($object)
$h++;
}
complete_head_from_modules($conf,$langs,$object,$head,$h,'user','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'user','remove');
return $head;
}
@@ -152,37 +152,37 @@ function group_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to shoc
*/
function user_admin_prepare_head()
{
global $langs, $conf, $user;
$langs->load("users");
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to shoc
*/
function user_admin_prepare_head()
{
global $langs, $conf, $user;
$langs->load("users");
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/admin/user.php';
$head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin','remove');
return $head;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin','remove');
return $head;
}

File diff suppressed because it is too large Load Diff

View File

@@ -830,7 +830,7 @@ else
if ($ret == 'html') print '<br />';
}
$head=holiday_prepare_head($cp);
$head=holiday_prepare_head($cp);
dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday');

View File

@@ -183,9 +183,9 @@ function paypaladmin_prepare_head()
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin','remove');
complete_head_from_modules($conf,$langs,$object,$head,$h,'paypaladmin','remove');
return $head;
}

View File

@@ -195,21 +195,21 @@ if ($action == 'setprofid')
}
}
//Activate ProfId
if ($action == 'setprofidmandatory')
{
$status = GETPOST('status','alpha');
$idprof="SOCIETE_IDPROF".$value."_MANDATORY";
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
//Activate ProfId
if ($action == 'setprofidmandatory')
{
$status = GETPOST('status','alpha');
$idprof="SOCIETE_IDPROF".$value."_MANDATORY";
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
@@ -550,9 +550,9 @@ $profid[2][0]=$langs->trans("ProfId3");
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
$profid[3][0]=$langs->trans("ProfId4");
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
$profid[4][0]=$langs->trans("ProfId5");
$profid[4][0]=$langs->trans("ProfId5");
$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code);
$profid[5][0]=$langs->trans("ProfId6");
$profid[5][0]=$langs->trans("ProfId6");
$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code);
$var = true;
@@ -588,17 +588,17 @@ while ($i < $nbofloop)
print '</a></td>';
}
if ($mandatory)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
if ($mandatory)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print "</tr>\n";
}

View File

@@ -203,13 +203,13 @@ if (empty($reshook))
$action = ($action=='add'?'create':'edit');
}
// We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
$object->country_code=$tmparray['code'];
$object->country=$tmparray['label'];
// We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
$object->country_code=$tmparray['code'];
$object->country=$tmparray['label'];
}
// Check for duplicate or mandatory prof id
@@ -229,12 +229,12 @@ if (empty($reshook))
}
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
{
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
$action = ($action=='add'?'create':'edit');
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
{
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
$action = ($action=='add'?'create':'edit');
}
}
}
@@ -1297,10 +1297,10 @@ else
{
if (($j % 2) == 0) print '<tr>';
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if(empty($conf->global->$idprof_mandatory))
print '<td>'.$idprof.'</td><td>';
else
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
if(empty($conf->global->$idprof_mandatory))
print '<td>'.$idprof.'</td><td>';
else
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
$key='idprof'.$i;

View File

@@ -1189,24 +1189,24 @@ class User extends CommonObject
}
}
// Actions on extra fields (by external module or standard code)
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
$hookmanager->initHooks(array('userdao'));
$parameters=array('socid'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
else if ($reshook < 0) $error++;
// Actions on extra fields (by external module or standard code)
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
$hookmanager->initHooks(array('userdao'));
$parameters=array('socid'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
else if ($reshook < 0) $error++;
if (! $error && ! $notrigger)
{

View File

@@ -86,7 +86,7 @@ $langs->load("companies");
$langs->load("ldap");
$form = new Form($db);
$object = new User($db);
$object = new User($db);
$extrafields = new ExtraFields($db);
@@ -187,13 +187,13 @@ if ($action == 'add' && $canadduser)
$object->note = $_POST["note"];
$object->ldap_sid = $_POST["ldap_sid"];
// Get extra fields
foreach($_POST as $key => $value)
{
if (preg_match("/^options_/",$key))
{
$object->array_options[$key]=GETPOST($key);
}
// Get extra fields
foreach($_POST as $key => $value)
{
if (preg_match("/^options_/",$key))
{
$object->array_options[$key]=GETPOST($key);
}
}
// FIXME external module
@@ -315,13 +315,13 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->signature = $_POST["signature"];
$object->openid = $_POST["openid"];
// Get extra fields
foreach($_POST as $key => $value)
{
if (preg_match("/^options_/",$key))
{
$object->array_options[$key]=GETPOST($key);
}
// Get extra fields
foreach($_POST as $key => $value)
{
if (preg_match("/^options_/",$key))
{
$object->array_options[$key]=GETPOST($key);
}
}
// FIXME external module
@@ -530,8 +530,8 @@ if ($action == 'adduserldap')
* View
*/
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('user');
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('user');
llxHeader('',$langs->trans("UserCard"));
@@ -869,21 +869,21 @@ if (($action == 'create') || ($action == 'adduserldap'))
$doleditor->Create();
print "</td></tr>\n";
// Other attributes
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
// Other attributes
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
// Module Webcalendar
// TODO external module
@@ -920,7 +920,7 @@ else
{
$object->fetch($id);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals($object->id,$extralabels);
// Connexion ldap
// pour recuperer passDoNotExpire et userChangePassNextLogon
@@ -1883,21 +1883,21 @@ else
print "</tr>\n";
}
// Other attributes
$parameters=array('colspan' => ' colspan="2"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
// Other attributes
$parameters=array('colspan' => ' colspan="2"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
print '</table>';