瀏覽代碼

Debug v16

Laurent Destailleur 3 年之前
父節點
當前提交
5f9ef61d32

+ 9 - 8
htdocs/admin/resource.php

@@ -78,7 +78,7 @@ print '<div class="div-table-responsive-no-min">';
 print '<table class="noborder centpercent">';
 print '<tr class="liste_titre">';
 print '<td>'.$langs->trans("Parameters").'</td>'."\n";
-print '<td class="right" width="60">'.$langs->trans("Value").'</td>'."\n";
+print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
 print '<td></td>';
 
 
@@ -107,30 +107,31 @@ print '</tr>';
 
 
 print '<tr class="oddeven">';
-print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
+print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
 print '<td class="right">';
-echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
+echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
 print '</td>';
 print '<td></td>';
 print '</tr>';
 
-
+/*
 print '<tr class="oddeven">';
-print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
+print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
 print '<td class="right">';
-echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
+echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
 print '</td>';
 print '<td></td>';
 print '</tr>';
 
 
 print '<tr class="oddeven">';
-print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
+print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
 print '<td class="right">';
-echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
+echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
 print '</td>';
 print '<td></td>';
 print '</tr>';
+*/
 
 print '</table>';
 print '</div>';

+ 2 - 2
htdocs/comm/action/card.php

@@ -674,7 +674,7 @@ if (empty($reshook) && $action == 'update') {
 					$object->errors[] = $object->error;
 				} else {
 					if ($db->num_rows($resql) > 0) {
-						// already in use
+						// Resource already in use
 						$error++;
 						$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
 						while ($obj = $db->fetch_object($resql)) {
@@ -853,7 +853,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
 					$object->errors[] = $object->error;
 				} else {
 					if ($db->num_rows($resql) > 0) {
-						// already in use
+						// Resource already in use
 						$error++;
 						$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
 						while ($obj = $db->fetch_object($resql)) {

+ 2 - 2
htdocs/core/modules/modAgenda.class.php

@@ -211,8 +211,8 @@ class modAgenda extends DolibarrModules
 			'url'=>'/comm/action/index.php',
 			'langs'=>'agenda',
 			'position'=>86,
-			'perms'=>'$user->rights->agenda->myactions->read',
-			'enabled'=>'$conf->agenda->enabled',
+			'perms'=>'$user->rights->agenda->myactions->read || $user->rights->resource->read',
+			'enabled'=>'$conf->agenda->enabled || $conf->resource->enabled',
 			'target'=>'',
 			'user'=>2,
 		);

+ 1 - 1
htdocs/core/modules/modResource.class.php

@@ -91,7 +91,7 @@ class modResource extends DolibarrModules
 
 		// Dependencies
 		// List of modules id that must be enabled if this module is enabled
-		$this->depends = array();
+		$this->depends = array('modResource');
 		// List of modules id to disable if this one is disabled
 		$this->requiredby = array('modPlace');
 		// Minimum version of PHP required by module

+ 3 - 3
htdocs/hrm/lib/hrm_job.lib.php

@@ -39,17 +39,17 @@ function jobPrepareHead($object)
 	$h = 0;
 	$head = array();
 
-	$head[$h][0] = dol_buildpath("/hrm/job_card.php", 1).'?id='.$object->id;
+	$head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id;
 	$head[$h][1] = $langs->trans("JobCard");
 	$head[$h][2] = 'job_card';
 	$h++;
 
-	$head[$h][0] = dol_buildpath("/hrm/skill_tab.php", 1).'?id='.$object->id.'&objecttype=job';
+	$head[$h][0] = DOL_URL_ROOT."/hrm/skill_tab.php?id=".$object->id.'&objecttype=job';
 	$head[$h][1] = $langs->trans("RequiredSkills");
 	$head[$h][2] = 'skill_tab';
 	$h++;
 
-	$head[$h][0] = dol_buildpath("/hrm/position.php", 1).'?fk_job='.$object->id;
+	$head[$h][0] = DOL_URL_ROOT."/hrm/position.php?fk_job=".$object->id;
 	$head[$h][1] = $langs->trans("EmployeesInThisPosition");
 	$head[$h][2] = 'position';
 	$h++;

+ 63 - 8
htdocs/hrm/skill_tab.php

@@ -120,10 +120,10 @@ if (empty($reshook)) {
 				$skillAdded->fk_object = $id;
 				$skillAdded->objecttype = $objecttype;
 				$ret = $skillAdded->create($user);
-				if ($ret < 0) setEventMessage($skillAdded->error, 'errors');
+				if ($ret < 0) setEventMessages($skillAdded->error, null, 'errors');
 				//else unset($TSkillsToAdd);
 			}
-			if ($ret > 0) setEventMessage($langs->trans("SaveAddSkill"));
+			if ($ret > 0) setEventMessages($langs->trans("SaveAddSkill"), null);
 		}
 	} elseif ($action == 'saveSkill') {
 		if (!empty($TNote)) {
@@ -136,14 +136,14 @@ if (empty($reshook)) {
 					}
 				}
 			}
-			setEventMessage($langs->trans("SaveLevelSkill"));
-			header("Location: " . dol_buildpath('/hrm/skill_tab.php', 1) . '?id=' . $id. '&objecttype=job');
+			setEventMessages($langs->trans("SaveLevelSkill"), null);
+			header("Location: " . DOL_URL_ROOT.'/hrm/skill_tab.php?id=' . $id. '&objecttype=job');
 			exit;
 		}
 	} elseif ($action == 'confirm_deleteskill' && $confirm == 'yes') {
 		$skillToDelete = new SkillRank($db);
 		$ret = $skillToDelete->fetch($lineid);
-		setEventMessage($langs->trans("DeleteSkill"));
+		setEventMessages($langs->trans("DeleteSkill"), null);
 		if ($ret > 0) {
 			$skillToDelete->delete($user);
 		}
@@ -247,12 +247,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
 
 	print '<div class="fichecenter">';
 	print '<div class="fichehalfleft">';
+
 	print '<div class="underbanner clearboth"></div>';
-	print '<table class="border centpercent tableforfield">' . "\n";
+	print '<table class="border centpercent tableforfield">';
+
+	// Login
+	print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
+	if (!empty($object->ldap_sid) && $object->statut == 0) {
+		print '<td class="error">';
+		print $langs->trans("LoginAccountDisableInDolibarr");
+		print '</td>';
+	} else {
+		print '<td>';
+		$addadmin = '';
+		if (property_exists($object, 'admin')) {
+			if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
+				$addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
+			} elseif (!empty($object->admin)) {
+				$addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
+			}
+		}
+		print showValueWithClipboardCPButton($object->login).$addadmin;
+		print '</td>';
+	}
+	print '</tr>'."\n";
+
 	$object->fields['label']['visible']=0; // Already in banner
-	include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
+	$object->fields['firstname']['visible']=0; // Already in banner
+	$object->fields['lastname']['visible']=0; // Already in banner
+	//include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
+
+	// Ref employee
+	print '<tr><td class="titlefield">'.$langs->trans("RefEmployee").'</td>';
+	print '<td class="error">';
+	print showValueWithClipboardCPButton($object->ref_employee);
+	print '</td>';
+	print '</tr>'."\n";
+
+	// National Registration Number
+	print '<tr><td class="titlefield">'.$langs->trans("NationalRegistrationNumber").'</td>';
+	print '<td class="error">';
+	print showValueWithClipboardCPButton($object->national_registration_number);
+	print '</td>';
+	print '</tr>'."\n";
+
+	/*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>';   // Notification for this thirdparty
+	 print '<td colspan="3">';
+	 $nbofrecipientemails=0;
+	 $notify=new Notify($db);
+	 $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
+	 foreach($tmparray as $tmpkey => $tmpval)
+	 {
+	 $nbofrecipientemails++;
+	 }
+	 print $nbofrecipientemails;
+	 print '</td></tr>';*/
+
 	print '</table>';
+
 	print '</div>';
+	print '</div>';
+
 
 	print '<div class="clearboth"></div><br>';
 
@@ -296,7 +351,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
 	}
 	print '</tr>';
 	if (!is_array($TSkillsJob) || empty($TSkillsJob)) {
-		print '<tr><td>' . $langs->trans("NoRecordFound") . '</td></tr>';
+		print '<tr><td><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
 	} else {
 		$sk = new Skill($db);
 		foreach ($TSkillsJob as $skillElement) {

+ 1 - 1
htdocs/langs/en_US/admin.lang

@@ -2112,7 +2112,7 @@ ResourceSetup=Configuration of Resource module
 UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
 DisabledResourceLinkUser=Disable feature to link a resource to users
 DisabledResourceLinkContact=Disable feature to link a resource to contacts
-EnableResourceUsedInEventCheck=Enable feature to check if a resource is in use in an event
+EnableResourceUsedInEventCheck=Prohibit the use of the same resource at the same time in the agenda
 ConfirmUnactivation=Confirm module reset
 OnMobileOnly=On small screen (smartphone) only
 DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be "Prospect" or "Customer", but can't be both)

+ 2 - 2
htdocs/resource/element_resource.php

@@ -165,7 +165,7 @@ if (empty($reshook)) {
 					$objstat->errors[] = $objstat->error;
 				} else {
 					if ($db->num_rows($resql) > 0) {
-						// already in use
+						// Resource already in use
 						$error++;
 						$objstat->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
 						while ($obj = $db->fetch_object($resql)) {
@@ -241,7 +241,7 @@ if (empty($reshook)) {
 					$object->errors[] = $object->error;
 				} else {
 					if ($db->num_rows($resql) > 0) {
-						// already in use
+						// Resource already in use
 						$error++;
 						$object->error = $langs->trans('ErrorResourcesAlreadyInUse').' : ';
 						while ($obj = $db->fetch_object($resql)) {

+ 1 - 1
htdocs/theme/eldy/global.inc.php

@@ -1573,7 +1573,7 @@ table[summary="list_of_modules"] .fa-cog {
 .minheight30 { min-height: 30px; }
 .minheight40 { min-height: 40px; }
 .titlefieldcreate { width: 20%; }
-.titlefield       { /* width: 25%; */ min-width: 250px; }
+.titlefield       { /* width: 25%; */ min-width: 250px; width: 25%; }
 .titlefieldmiddle { width: 45%; }
 .titlefieldmax45 { max-width: 45%; }
 .imgmaxwidth180 { max-width: 180px; }

+ 1 - 1
htdocs/theme/md/style.css.php

@@ -1662,7 +1662,7 @@ tr.nobottom td {
 .minheight30 { min-height: 30px; }
 .minheight40 { min-height: 40px; }
 .titlefieldcreate { width: 20%; }
-.titlefield       { /* width: 25%; */ min-width: 250px; }
+.titlefield       { /* width: 25%; */ min-width: 250px; width: 25%; }
 .titlefieldmiddle { width: 50%; }
 .imgmaxwidth180 { max-width: 180px; }
 .imgmaxheight50 { max-height: 50px; }

+ 2 - 2
htdocs/user/agenda_extsites.php

@@ -209,9 +209,9 @@ while ($i <= $MAXAGENDA) {
 	print '<td><input type="text" class="flat hideifnotset minwidth100 maxwidth100onsmartphone" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'.$name_value.'"></td>';
 	// URL
 	$src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src));
-	print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'.$src_value.'"></td>';
+	print '<td><input type="url" class="flat hideifnotset width300" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'.$src_value.'"></td>';
 	// Offset TZ
-	$offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz));
+	$offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? '' : $object->conf->$offsettz));
 	print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'.$offsettz_value.'" size="1"></td>';
 	// Color (Possible colors are limited by Google)
 	print '<td class="nowraponall right">';

+ 2 - 2
htdocs/user/class/user.class.php

@@ -365,8 +365,8 @@ class User extends CommonObject
 		'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
 		'lastname'=>array('type'=>'varchar(50)', 'label'=>'LastName', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1),
 		'firstname'=>array('type'=>'varchar(50)', 'label'=>'FirstName', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
-		'ref_employee'=>array('type'=>'varchar(50)', 'label'=>'ref_employee', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30, 'searchall'=>1),
-		'national_registration_number'=>array('type'=>'varchar(50)', 'label'=>'national_registration_number', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40, 'searchall'=>1)
+		'ref_employee'=>array('type'=>'varchar(50)', 'label'=>'RefEmployee', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30, 'searchall'=>1),
+		'national_registration_number'=>array('type'=>'varchar(50)', 'label'=>'NationalRegistrationNumber', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40, 'searchall'=>1)
 	);
 
 

+ 4 - 0
htdocs/user/param_ihm.php

@@ -234,6 +234,8 @@ if ($action == 'edit') {
 
 	dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
 
+	print '<div class="underbanner clearboth"></div>';
+
 	print dol_get_fiche_end();
 
 
@@ -339,6 +341,8 @@ if ($action == 'edit') {
 
 	dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
 
+	print '<div class="underbanner clearboth"></div>';
+
 	print dol_get_fiche_end();
 
 

+ 29 - 0
htdocs/user/perms.php

@@ -253,7 +253,36 @@ if ($user->rights->user->user->lire || $user->admin) {
 dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
 
 
+print '<div class="fichecenter">';
+
 print '<div class="underbanner clearboth"></div>';
+print '<table class="border centpercent tableforfield">';
+
+// Login
+print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
+if (!empty($object->ldap_sid) && $object->statut == 0) {
+	print '<td class="error">';
+	print $langs->trans("LoginAccountDisableInDolibarr");
+	print '</td>';
+} else {
+	print '<td>';
+	$addadmin = '';
+	if (property_exists($object, 'admin')) {
+		if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
+			$addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
+		} elseif (!empty($object->admin)) {
+			$addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
+		}
+	}
+	print showValueWithClipboardCPButton($object->login).$addadmin;
+	print '</td>';
+}
+print '</tr>'."\n";
+
+print '</table>';
+
+print '</div>';
+
 
 if ($user->admin) {
 	print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));