New: [ task #314 ] Can define if prof id are mandatory or not
This commit is contained in:
parent
d8651ca830
commit
4f2f56fced
@ -963,6 +963,7 @@ DocumentModelOdt=Generació des dels documents amb format OpenDocument (Arxiu .O
|
||||
WatermarkOnDraft=Marca d'aigua en els documents esborrany
|
||||
CompanyIdProfChecker=Id Professional únic
|
||||
MustBeUnique=Ha de ser únic?
|
||||
MustBeMandatory=Ha de ser obligatori?
|
||||
Miscellanous=Miscel·lània
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Configuració d'enllaç amb el calendari webcalendar
|
||||
|
||||
@ -953,6 +953,7 @@ DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for
|
||||
WatermarkOnDraft=Watermark on draft document
|
||||
CompanyIdProfChecker=Professional Id unique
|
||||
MustBeUnique=Must be unique ?
|
||||
MustBeMandatory=Must be mandatory ?
|
||||
Miscellanous=Miscellaneous
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Webcalendar link setup
|
||||
|
||||
@ -966,6 +966,7 @@ DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT Ope
|
||||
WatermarkOnDraft=Marca de agua en los documentos borrador
|
||||
CompanyIdProfChecker=Id Profesional único
|
||||
MustBeUnique=¿Debe ser único?
|
||||
MustBeMandatory=¿Debe ser obligatorio?
|
||||
Miscellanous=Miscelánea
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Configuración de enlace con el calendario Webcalendar
|
||||
|
||||
@ -960,6 +960,7 @@ DocumentModelOdt=Genération depuis des modèles OpenDocument (Fichier .ODT Open
|
||||
WatermarkOnDraft=Filigrane sur les documents brouillons
|
||||
CompanyIdProfChecker=Id professionel unique
|
||||
MustBeUnique=Doit être unique ?
|
||||
MustBeMandatory=Doit être obligatoire?
|
||||
Miscellanous=Divers
|
||||
##### Webcal setup #####
|
||||
WebCalSetup= Configuration du lien vers le calendrier Webcalendar
|
||||
|
||||
@ -195,6 +195,23 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -522,6 +539,7 @@ print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("MustBeUnique").'</td>';
|
||||
print '<td align="center">'.$langs->trans("MustBeMandatory").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$profid[0][0]=$langs->trans("ProfId1");
|
||||
@ -546,21 +564,10 @@ while ($i < $nbofloop)
|
||||
print $profid[$i][1];
|
||||
print '</td>';
|
||||
|
||||
switch($i)
|
||||
{
|
||||
case 0:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true);
|
||||
break;
|
||||
case 1:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true);
|
||||
break;
|
||||
case 2:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true);
|
||||
break;
|
||||
case 3:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true);
|
||||
break;
|
||||
}
|
||||
$idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE';
|
||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY';
|
||||
$verif=(empty($conf->global->$idprof_unique)?false:true);
|
||||
$mandatory=(empty($conf->global->$idprof_mandatory)?false:true);
|
||||
|
||||
if ($verif)
|
||||
{
|
||||
@ -574,6 +581,19 @@ while ($i < $nbofloop)
|
||||
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";
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user