Code Duplication    Length = 5-8 lines in 13 locations

programs/vacadm.php 7 locations

@@ 1329-1334 (lines=6) @@
1326
		exit;
1327
		break;
1328
1329
	case 'rights':
1330
		absences_listRightsByUser(bab_rp('idu'));
1331
1332
		$babBody->addItemMenu("lper", absences_translate("Personnel"), absences_addon()->getUrl()."vacadm&idx=lper");
1333
		$babBody->addItemMenu("rights", absences_translate("User rights"), absences_addon()->getUrl()."vacadm&idx=rights&idu=".bab_rp('idu'));
1334
		break;
1335
1336
	case 'agentright':
1337
		absences_editAgentRight(bab_rp('ar'));
@@ 1342-1346 (lines=5) @@
1339
		break;
1340
1341
1342
	case 'movement':
1343
		$babBody->addItemMenu("lper", absences_translate("Personnel"), absences_addon()->getUrl()."vacadm&idx=lper");
1344
		$babBody->addItemMenu("movement", absences_translate("History"), absences_addon()->getUrl()."vacadm&idx=movement&idu=".bab_rp('idu'));
1345
		absences_agentMovements(bab_rp('idu'));
1346
		break;
1347
1348
1349
	case "delu":
@@ 1361-1368 (lines=8) @@
1358
		$babBody->addItemMenu("delu", absences_translate("Delete"), absences_addon()->getUrl()."vacadm&idx=delu");
1359
		break;
1360
1361
	case "modp":
1362
		$babBody->title = absences_translate("Modify user");
1363
1364
		absences_addVacationPersonnel($_REQUEST['idp']);
1365
1366
		$babBody->addItemMenu("lper", absences_translate("Personnel"), absences_addon()->getUrl()."vacadm&idx=lper");
1367
		$babBody->addItemMenu("modp", absences_translate("Modify"), absences_addon()->getUrl()."vacadm&idx=modp");
1368
		break;
1369
1370
	case "addp":
1371
		$babBody->title = absences_translate("Add users");
@@ 1370-1376 (lines=7) @@
1367
		$babBody->addItemMenu("modp", absences_translate("Modify"), absences_addon()->getUrl()."vacadm&idx=modp");
1368
		break;
1369
1370
	case "addp":
1371
		$babBody->title = absences_translate("Add users");
1372
		absences_addVacationPersonnel();
1373
1374
		$babBody->addItemMenu("lper", absences_translate("Personnel"), absences_addon()->getUrl()."vacadm&idx=lper");
1375
		$babBody->addItemMenu("addp", absences_translate("Add"), absences_addon()->getUrl()."vacadm&idx=addp");
1376
		break;
1377
1378
	case 'changeucol':
1379
		$babBody->title = sprintf(absences_translate("Change user collection for %s"), bab_getuserName($_POST['idp']));
@@ 1385-1390 (lines=6) @@
1382
		absences_changeucol($_POST['idp'],$_POST['idcol']);
1383
		break;
1384
1385
	case "addg":
1386
		$babBody->title = absences_translate("Add/Modify users by group");
1387
		addGroupVacationPersonnel();
1388
		$babBody->addItemMenu("lper", absences_translate("Personnel"), absences_addon()->getUrl()."vacadm&idx=lper");
1389
		$babBody->addItemMenu("addg", absences_translate("Add/Modify"), absences_addon()->getUrl()."vacadm&idx=addg");
1390
		break;
1391
1392
	case 'addg_progress':
1393
		absences_updateVacationPersonnelGroup();
@@ 1427-1433 (lines=7) @@
1424
	    break;
1425
1426
1427
	case "lcol":
1428
1429
		$babBody->title = absences_translate("Vacations type's collections");
1430
		listVacationCollections();
1431
		$babBody->addItemMenu("lcol", absences_translate("Collections"), absences_addon()->getUrl()."vacadm&idx=lcol");
1432
		$babBody->addItemMenu("addvc", absences_translate("Add"), absences_addon()->getUrl()."vacadm&idx=addvc");
1433
		break;
1434
1435
	case "modvc":
1436
		$babBody->title = absences_translate("Modify vacation type's collection");
@@ 1485-1492 (lines=8) @@
1482
1483
		break;
1484
1485
	case "lvt":
1486
1487
		$babBody->title = absences_translate("Vacations types");
1488
		$babBody->addItemMenu("lvt", absences_translate("Types"), absences_addon()->getUrl()."vacadm&idx=lvt");
1489
		$babBody->addItemMenu("addvt", absences_translate("Add"), absences_addon()->getUrl()."vacadm&idx=addvt");
1490
		listVacationTypes();
1491
1492
		break;
1493
1494
	case 'export':
1495
		require_once dirname(__FILE__).'/utilit/agent_export.class.php';

programs/vacadma.php 3 locations

@@ 1135-1139 (lines=5) @@
1132
		$babBody->addItemMenu("movement", absences_translate("History"), absences_addon()->getUrl()."vacadma&idx=movement&idvr=".bab_rp('idvr'));
1133
		break;
1134
1135
	case "addvr":
1136
		absences_addModifyVacationRight(false, bab_rp('from'));
1137
		$babBody->addItemMenu("lrig", absences_translate("Rights"), absences_addon()->getUrl()."vacadma&idx=lrig");
1138
		$babBody->addItemMenu("addvr", absences_translate("Add"), absences_addon()->getUrl()."vacadma&idx=addvr");
1139
		break;
1140
		
1141
	case 'nobenef';
1142
		absences_choseBeneficiariesMethod(bab_rp('idvr'));
@@ 1164-1169 (lines=6) @@
1161
		break;
1162
	
1163
1164
	case 'rgroup':
1165
		$babBody->title = absences_translate("Rights groups");
1166
		$babBody->addItemMenu("rgroup", absences_translate("Rights groups"), absences_addon()->getUrl()."vacadma&idx=rgroup");
1167
		$babBody->addItemMenu("rgroupmod", absences_translate("Add"), absences_addon()->getUrl()."vacadma&idx=rgroupmod");
1168
		rgrouplist();
1169
		break;
1170
1171
	case 'rgroupmod':
1172
		$babBody->title = absences_translate("Right group");
@@ 1171-1176 (lines=6) @@
1168
		rgrouplist();
1169
		break;
1170
1171
	case 'rgroupmod':
1172
		$babBody->title = absences_translate("Right group");
1173
		$babBody->addItemMenu("rgroup", absences_translate("Rights groups"), absences_addon()->getUrl()."vacadma&idx=rgroup");
1174
		$babBody->addItemMenu("rgroupmod", absences_translate("Edit"), absences_addon()->getUrl()."vacadma&idx=rgroupmod");
1175
		rgroupmod();
1176
		break;
1177
1178
1179
	case 'copy':

programs/vacadmb.php 3 locations

@@ 965-970 (lines=6) @@
962
        break;
963
		
964
965
	case "edvr":
966
		$babBody->title = absences_translate("Edit request vacation");
967
		editVacationRequest(bab_rp('id'));
968
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
969
		$babBody->addItemMenu("edvr", absences_translate("Modify"), absences_addon()->getUrl()."vacadmb&idx=edvr");
970
		break;
971
972
973
		
@@ 986-991 (lines=6) @@
983
		$babBody->addItemMenu("ddreq", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=ddreq");
984
		break;
985
		
986
	case 'delete':
987
		$babBody->title = absences_translate("Delete vacation request");
988
		absences_deleteVacationRequest(bab_rp('id_entry'), true);
989
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
990
		$babBody->addItemMenu("delete", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=delete");
991
		break;
992
		
993
994
	case 'archives';
@@ 996-1002 (lines=7) @@
993
994
	case 'archives';
995
	case "lreq":
996
	default:
997
		
998
		absences_listVacationRequestsb();
999
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
1000
		$babBody->addItemMenu("archives", absences_translate("Archives"), absences_addon()->getUrl()."vacadmb&idx=archives&archived=1");
1001
		$babBody->addItemMenu("ddreq", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=ddreq");
1002
		break;
1003
	}
1004
$babBody->setCurrentItemMenu($idx);
1005
bab_siteMap::setPosition('absences','User');