Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ab037cb5e9
@ -230,7 +230,7 @@ if (isModEnabled('facture')) {
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -251,7 +251,7 @@ if (isModEnabled('commande')) {
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -270,7 +270,7 @@ if (isModEnabled("expedition")) {
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -287,7 +287,7 @@ if (isModEnabled("expedition")) {
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -322,7 +322,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -344,7 +344,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
@ -389,7 +389,7 @@ if (isModEnabled("reception")) {
|
||||
print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER);
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name")).'</span>';
|
||||
}
|
||||
print "</td>\n</tr>\n";
|
||||
$found++;
|
||||
|
||||
@ -746,12 +746,22 @@ if (empty($reshook)) {
|
||||
|
||||
$fk_unit = GETPOST('unit', 'alpha');
|
||||
|
||||
// update price_ht with discount
|
||||
// TODO Use object->updateline instead objedtline->update
|
||||
|
||||
$price_ht = price2num(GETPOST('elprice'), 'MU');
|
||||
$remise_percent = price2num(GETPOST('elremise_percent'), 2);
|
||||
if ($remise_percent > 0) {
|
||||
$remise = round(($price_ht * $remise_percent / 100), 2);
|
||||
$price_ht = ($price_ht - $remise);
|
||||
}
|
||||
|
||||
$objectline->fk_product = GETPOST('idprod', 'int');
|
||||
$objectline->description = GETPOST('product_desc', 'restricthtml');
|
||||
$objectline->price_ht = price2num(GETPOST('elprice'), 'MU');
|
||||
$objectline->price_ht = $price_ht;
|
||||
$objectline->subprice = price2num(GETPOST('elprice'), 'MU');
|
||||
$objectline->qty = price2num(GETPOST('elqty'), 'MS');
|
||||
$objectline->remise_percent = price2num(GETPOST('elremise_percent'), 2);
|
||||
$objectline->remise_percent = $remise_percent;
|
||||
$objectline->tva_tx = ($txtva ? $txtva : 0); // Field may be disabled, so we use vat rate 0
|
||||
$objectline->vat_src_code = $vat_src_code;
|
||||
$objectline->localtax1_tx = is_numeric($localtax1_tx) ? $localtax1_tx : 0;
|
||||
|
||||
@ -8256,7 +8256,7 @@ abstract class CommonObject
|
||||
// Test on 'enabled' ('enabled' is different than 'list' = 'visibility')
|
||||
$enabled = 1;
|
||||
if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) {
|
||||
$enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '1');
|
||||
$enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2');
|
||||
}
|
||||
if (empty($enabled)) {
|
||||
continue;
|
||||
@ -8264,12 +8264,12 @@ abstract class CommonObject
|
||||
|
||||
$visibility = 1;
|
||||
if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) {
|
||||
$visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '1');
|
||||
$visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2');
|
||||
}
|
||||
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) {
|
||||
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '1');
|
||||
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2');
|
||||
}
|
||||
|
||||
if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) {
|
||||
|
||||
@ -961,9 +961,9 @@ class ExtraFields
|
||||
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
|
||||
$required = $this->attributes[$extrafieldsobjectkey]['required'][$key];
|
||||
$param = $this->attributes[$extrafieldsobjectkey]['param'][$key];
|
||||
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1');
|
||||
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2');
|
||||
$langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key];
|
||||
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
|
||||
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2');
|
||||
$totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
|
||||
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
|
||||
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||
@ -1597,9 +1597,9 @@ class ExtraFields
|
||||
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
|
||||
$required = $this->attributes[$extrafieldsobjectkey]['required'][$key];
|
||||
$param = $this->attributes[$extrafieldsobjectkey]['param'][$key];
|
||||
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1');
|
||||
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2');
|
||||
$langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key];
|
||||
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
|
||||
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2');
|
||||
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
|
||||
$hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||
|
||||
@ -2097,17 +2097,17 @@ class ExtraFields
|
||||
|
||||
$enabled = 1;
|
||||
if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '1');
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '2');
|
||||
}
|
||||
|
||||
$visibility = 1;
|
||||
if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility
|
||||
$visibility = intval(dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '1'));
|
||||
$visibility = intval(dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '2'));
|
||||
}
|
||||
|
||||
$perms = 1;
|
||||
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '1');
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '2');
|
||||
}
|
||||
if (empty($enabled)
|
||||
|| (
|
||||
|
||||
@ -380,7 +380,7 @@ class FormProjets
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$out .= $comboenhancement;
|
||||
$morecss .= ' minwidth200 maxwidth500';
|
||||
$morecss .= ' minwidth150';
|
||||
}
|
||||
|
||||
if (empty($option_only)) {
|
||||
|
||||
@ -32,7 +32,7 @@ if (isModEnabled('stripe')) {
|
||||
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write', 'returnurl'=>'/core/modules/oauth/stripelive_oauthcallback.php');
|
||||
}
|
||||
$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers', 'availablescopes'=>'user,public_repo', 'returnurl'=>'/core/modules/oauth/github_oauthcallback.php');
|
||||
$supportedoauth2array['OAUTH_MICROSOFT_NAME'] = array('callbackfile' => 'microsoft', 'picto' => 'microsoft', 'urlforapp' => 'OAUTH_MICROSOFT_DESC', 'name'=>'Microsoft', 'urlforcredentials'=>'https://portal.azure.com/', 'availablescopes'=>'openid,offline_access,profile,email,User.Read,https://outlook.office365.com/IMAP.AccessAsUser.All,https://outlook.office365.com/SMTP.Send', 'returnurl'=>'/core/modules/oauth/microsoft_oauthcallback.php');
|
||||
$supportedoauth2array['OAUTH_MICROSOFT_NAME'] = array('callbackfile' => 'microsoft', 'picto' => 'microsoft', 'urlforapp' => 'OAUTH_MICROSOFT_DESC', 'name'=>'Microsoft', 'urlforcredentials'=>'https://portal.azure.com/', 'availablescopes'=>'openid,offline_access,profile,email,User.Read,https://outlook.office.com/IMAP.AccessAsUser.All,https://outlook.office.com/SMTP.Send', 'returnurl'=>'/core/modules/oauth/microsoft_oauthcallback.php');
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'availablescopes'=>'Standard', 'returnurl'=>'/core/modules/oauth/generic_oauthcallback.php');
|
||||
// See https://learn.microsoft.com/fr-fr/azure/active-directory/develop/quickstart-register-app#register-an-application
|
||||
|
||||
@ -119,7 +119,7 @@ class modMrp extends DolibarrModules
|
||||
$this->hidden = false;
|
||||
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
||||
$this->depends = array('modBom');
|
||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||
$this->requiredby = array('modWorkstation'); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||
$this->langfiles = array("mrp");
|
||||
$this->phpmin = array(7, 0); // Minimum version of PHP required by module
|
||||
|
||||
@ -120,7 +120,7 @@ class modWorkstation extends DolibarrModules
|
||||
// A condition to hide module
|
||||
$this->hidden = false;
|
||||
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
||||
$this->depends = array();
|
||||
$this->depends = array('modMrp');
|
||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||
$this->langfiles = array("mrp");
|
||||
|
||||
@ -74,15 +74,15 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
||||
|
||||
$enabled = 1;
|
||||
if ($enabled && isset($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra])) {
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1);
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2');
|
||||
}
|
||||
if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) {
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1);
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2');
|
||||
}
|
||||
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra])) {
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1);
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1, 1, '2');
|
||||
}
|
||||
//print $tmpkeyextra.'-'.$enabled.'-'.$perms.'<br>'."\n";
|
||||
|
||||
|
||||
@ -2031,6 +2031,7 @@ if ($action == 'create') {
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="fk_expensereport" value="'.$object->id.'" />';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder centpercent">';
|
||||
@ -2049,7 +2050,7 @@ if ($action == 'create') {
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||
print '<td class="center linecolcarcategory">'.$langs->trans('CarCategory').'</td>';
|
||||
}
|
||||
print '<td class="center linecoldescription">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="right linecolvat">'.$langs->trans('VAT').'</td>';
|
||||
print '<td class="right linecolpriceuht">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td class="right linecolpriceuttc">'.$langs->trans('PriceUTTC').'</td>';
|
||||
@ -2088,7 +2089,7 @@ if ($action == 'create') {
|
||||
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
print '<td class="center dateproject">';
|
||||
print '<td class="lineproject">';
|
||||
if ($line->fk_project > 0) {
|
||||
$projecttmp->id = $line->fk_project;
|
||||
$projecttmp->ref = $line->projet_ref;
|
||||
@ -2483,7 +2484,7 @@ if ($action == 'create') {
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
|
||||
print '<td>'.$langs->trans('CarCategory').'</td>';
|
||||
}
|
||||
print '<td class="right expensereportcreatedescription">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="expensereportcreatedescription">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="right expensereportcreatevat">'.$langs->trans('VAT').'</td>';
|
||||
print '<td class="right expensereportcreatepriceuth">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td class="right expensereportcreatepricettc">'.$langs->trans('PriceUTTC').'</td>';
|
||||
@ -2562,7 +2563,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
print '<td class="center inputbuttons">';
|
||||
print $form->buttonsSaveCancel("Add", '', '', 1);
|
||||
print $form->buttonsSaveCancel("Add", '', '', 1, 'reposition');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -38,8 +38,8 @@ class Microsoft extends AbstractService
|
||||
const SCOPE_APPLICATIONS = 'applications';
|
||||
const SCOPE_APPLICATIONS_CREATE = 'applications_create';
|
||||
const SCOPE_IMAP = 'imap';
|
||||
const SOCPE_IMAP_ACCESSASUSERALL = 'https://outlook.office365.com/IMAP.AccessAsUser.All';
|
||||
const SOCPE_SMTPSEND = 'https://outlook.office365.com/SMTP.Send';
|
||||
const SOCPE_IMAP_ACCESSASUSERALL = 'https://outlook.office.com/IMAP.AccessAsUser.All';
|
||||
const SOCPE_SMTPSEND = 'https://outlook.office.com/SMTP.Send';
|
||||
const SOCPE_USERREAD = 'User.Read';
|
||||
const SOCPE_MAILREAD = 'Mail.Read';
|
||||
const SOCPE_MAILSEND = 'Mail.Send';
|
||||
|
||||
@ -65,8 +65,8 @@ ActionAC_SUP_ORD=Send purchase order by mail
|
||||
ActionAC_SUP_INV=Send vendor invoice by mail
|
||||
ActionAC_OTH=Other
|
||||
ActionAC_OTH_AUTO=Other auto
|
||||
ActionAC_MANUAL=Manually inserted events
|
||||
ActionAC_AUTO=Automatically inserted events
|
||||
ActionAC_MANUAL=Events inserted manually (by a user)
|
||||
ActionAC_AUTO=Events inserted automatically
|
||||
ActionAC_OTH_AUTOShort=Other
|
||||
ActionAC_EVENTORGANIZATION=Event organization events
|
||||
Stats=Sales statistics
|
||||
|
||||
@ -1159,11 +1159,14 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0);
|
||||
print ' <span class="opacitymedium"> '.$langs->trans("to").' </span> ';
|
||||
print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0);
|
||||
print ' <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
|
||||
if ($comefromclone) {
|
||||
print ' checked ';
|
||||
$object->getLinesArray(null, 0);
|
||||
if (!empty($object->usage_task) && !empty($object->lines)) {
|
||||
print ' <span id="divreportdate" class="hidden"> <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
|
||||
if ($comefromclone) {
|
||||
print 'checked ';
|
||||
}
|
||||
print '/><label for="reportdate" class="valignmiddle opacitymedium">'.$langs->trans("ProjectReportDate").'</label></span>';
|
||||
}
|
||||
print '/><label for="reportdate" class="opacitymedium">'.$langs->trans("ProjectReportDate").'</label>';
|
||||
print '</td></tr>';
|
||||
|
||||
if (isModEnabled('eventorganization')) {
|
||||
@ -1385,6 +1388,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
jQuery("#usage_task").prop("checked", true);
|
||||
}
|
||||
});
|
||||
|
||||
jQuery("#projectstart").change(function() {
|
||||
console.log("We modify the start date");
|
||||
jQuery("#divreportdate").show();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
@ -291,7 +291,7 @@ class Project extends CommonObject
|
||||
'date_close' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>0, 'position'=>105),
|
||||
'fk_user_close' =>array('type'=>'integer', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>0, 'position'=>110),
|
||||
'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position'=>115),
|
||||
'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>119),
|
||||
'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>-1, 'position'=>119),
|
||||
'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
|
||||
@ -2344,11 +2344,11 @@ class Project extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Create an array of tasks of current project
|
||||
* Create an array of tasks of current project
|
||||
*
|
||||
* @param User $user Object user we want project allowed to
|
||||
* @param User $user Object user we want project allowed to
|
||||
* @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action
|
||||
* @return int >0 if OK, <0 if KO
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function getLinesArray($user, $loadRoleMode = 1)
|
||||
{
|
||||
|
||||
@ -1797,7 +1797,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
if ($projectstatic->public) {
|
||||
$contactsofproject = array();
|
||||
}
|
||||
print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth250');
|
||||
print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
|
||||
} else {
|
||||
if ($nboftasks) {
|
||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
|
||||
@ -1830,8 +1830,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '</td>';
|
||||
|
||||
if ($conf->service->enabled && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
print '<td class="nowrap">';
|
||||
print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto('', 'product');
|
||||
print $form->select_produits('', 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1);
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
@ -1843,7 +1844,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
print '<td class="center">';
|
||||
$form->buttonsSaveCancel();
|
||||
print '<input type="submit" name="save" class="button buttongen marginleftonly margintoponlyshort marginbottomonlyshort button-add" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" name="save" class="button buttongen marginleftonly margintoponlyshort marginbottomonlyshort button-add reposition" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" name="cancel" class="button buttongen marginleftonly margintoponlyshort marginbottomonlyshort button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2149,7 +2150,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['p.fk_soc']['checked'])) {
|
||||
print '<td class="nowrap tdoverflowmax150">';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
if ($task_time->fk_soc > 0) {
|
||||
if (empty($conf->cache['thridparty'][$task_time->fk_soc])) {
|
||||
$tmpsociete = new Societe($db);
|
||||
@ -2331,9 +2332,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
}
|
||||
}
|
||||
|
||||
//Product
|
||||
// Product
|
||||
if (!empty($arrayfields['t.fk_product']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
print '<td class="nowraponall tdoverflowmax125">';
|
||||
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
|
||||
$form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
|
||||
} elseif (!empty($task_time->fk_product)) {
|
||||
@ -2432,9 +2433,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '<td class="center nowraponall">';
|
||||
if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save small" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel small" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
} elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks
|
||||
if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
@ -2474,6 +2475,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
// Add line to split
|
||||
|
||||
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
print '<!-- first line -->';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date
|
||||
@ -2491,6 +2493,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['p.fk_soc']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Thirdparty alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Project ref
|
||||
if (!empty($allprojectforuser)) {
|
||||
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
|
||||
@ -2522,7 +2536,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
// User
|
||||
if (!empty($arrayfields['author']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
if (empty($object->id)) {
|
||||
$object->fetch($id);
|
||||
@ -2573,6 +2587,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Product
|
||||
if (!empty($arrayfields['t.fk_product']['checked'])) {
|
||||
print '<td class="nowraponall tdoverflowmax125">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Value spent
|
||||
if (!empty($arrayfields['value']['checked'])) {
|
||||
print '<td class="right">';
|
||||
@ -2612,7 +2632,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
// Line for second dispatching
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- second line --><tr class="oddeven">';
|
||||
|
||||
// Date
|
||||
if (!empty($arrayfields['t.element_date']['checked'])) {
|
||||
@ -2629,6 +2649,18 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['p.fk_soc']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Thirdparty alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="nowrap">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Project ref
|
||||
if (!empty($allprojectforuser)) {
|
||||
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
|
||||
@ -2653,14 +2685,14 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
if (!empty($arrayfields['t.element_label']['checked'])) {
|
||||
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
|
||||
print '<td class="nowrap">';
|
||||
print $task_time->label;
|
||||
print dol_escape_htmltag($task_time->label);
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
// User
|
||||
if (!empty($arrayfields['author']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) {
|
||||
if (empty($object->id)) {
|
||||
$object->fetch($id);
|
||||
@ -2711,6 +2743,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Product
|
||||
if (!empty($arrayfields['t.fk_product']['checked'])) {
|
||||
print '<td class="nowraponall tdoverflowmax125">';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Value spent
|
||||
if (!empty($arrayfields['value']['checked'])) {
|
||||
print '<td class="right">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user