Merge remote-tracking branch 'upstream/develop' into Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword

This commit is contained in:
Frédéric FRANCE 2020-05-21 01:11:45 +02:00
commit 416e6dd90d
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
14 changed files with 956 additions and 899 deletions

View File

@ -177,12 +177,6 @@ class ActionComm extends CommonObject
*/
public $fulldayevent = 0;
/**
* @var int Milestone
* @deprecated Milestone is already event with end date = start date
*/
public $punctual = 1;
/**
* @var integer Percentage
*/
@ -384,7 +378,6 @@ class ActionComm extends CommonObject
if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
if (empty($this->punctual)) $this->punctual = 0;
if (empty($this->transparency)) $this->transparency = 0;
if ($this->percentage > 100) $this->percentage = 100;
//if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
@ -462,7 +455,7 @@ class ActionComm extends CommonObject
$sql .= "fk_user_author,";
$sql .= "fk_user_action,";
$sql .= "fk_user_done,";
$sql .= "label,percent,priority,fulldayevent,location,punctual,";
$sql .= "label,percent,priority,fulldayevent,location,";
$sql .= "transparency,";
$sql .= "fk_element,";
$sql .= "elementtype,";
@ -492,7 +485,7 @@ class ActionComm extends CommonObject
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
$sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."','".$this->db->escape($this->punctual)."', ";
$sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."', ";
$sql .= "'".$this->db->escape($this->transparency)."', ";
$sql .= (!empty($this->fk_element) ? $this->fk_element : "null").", ";
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";
@ -693,7 +686,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_user_action, a.fk_user_done,";
$sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element as elementid, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
$sql .= " s.nom as socname,";
$sql .= " u.firstname, u.lastname as lastname";
@ -758,7 +751,6 @@ class ActionComm extends CommonObject
$this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location;
$this->transparency = $obj->transparency;
$this->punctual = $obj->punctual; // deprecated
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
$this->contactid = $obj->fk_contact; // To have fetch_contact method working
@ -1612,7 +1604,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_user_action,";
$sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql .= " u.firstname, u.lastname, u.email,";
$sql .= " s.nom as socname,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label";
@ -1719,7 +1711,6 @@ class ActionComm extends CommonObject
$event['fulldayevent'] = $obj->fulldayevent;
$event['location'] = $obj->location;
$event['transparency'] = (($obj->transparency > 0) ? 'OPAQUE' : 'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
$event['punctual'] = $obj->punctual;
$event['category'] = $obj->type_label;
$event['email'] = $obj->email;
// Define $urlwithroot
@ -1929,11 +1920,7 @@ class ActionComm extends CommonObject
$this->datem = $now;
$this->datep = $now;
$this->datef = $now;
$this->author = $user;
$this->usermod = $user;
$this->usertodo = $user;
$this->fulldayevent = 0;
$this->punctual = 0;
$this->percentage = 0;
$this->location = 'Location';
$this->transparency = 1; // 1 means opaque

View File

@ -1,4 +1,6 @@
<?php
use Splash\Tests\WsObjects\O00ObjectBaseTest;
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
@ -37,7 +39,7 @@ class Conf
public $file;
/**
* @var DoliDB Database handler.
* @var Object Associative array with some properties ->type, ->db, ...
*/
public $db;

View File

@ -2226,7 +2226,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
print '<tr class="oddeven">';
print '<td>';
print $projectstatic->getNomUrl(1, '', 0, '', '-', 0 , -1, 'nowraponall');
print $projectstatic->getNomUrl(1, '', 0, '', '-', 0, -1, 'nowraponall');
if (!in_array('projectlabel', $hiddenfields)) print '<br><span class="opacitymedium">'.dol_trunc($objp->title, 24).'</span>';
print '</td>';
print '<td class="nowraponall tdoverflowmax100">';

View File

@ -255,7 +255,6 @@ class CommActionRapport
$eventstatic->id = $obj->id;
$eventstatic->percentage = $obj->percent;
$eventstatic->fulldayevent = $obj->fulldayevent;
$eventstatic->punctual = $obj->punctual;
$y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3);

View File

@ -898,7 +898,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->datep = $now;
$actioncomm->datef = $now;
$actioncomm->durationp = 0;
$actioncomm->punctual = 1;
$actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $societeforaction->id;
$actioncomm->contactid = $contactforaction->id;

View File

@ -80,7 +80,7 @@ llxHeader('', $title);
$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
print load_fiche_titre($langs->trans("HomeArea"), $resultboxes['selectboxlist'], 'home', 0, '', 'titleforhome');
print load_fiche_titre('&nbsp;', $resultboxes['selectboxlist'], '', 0, '', 'titleforhome');
if (!empty($conf->global->MAIN_MOTD))
{

View File

@ -74,6 +74,8 @@ delete from llx_const where name = 'PROJECT_HIDE_TASKS' and entity = 0;
-- VMYSQL4.1 DROP INDEX ix_fk_product_stock on llx_product_batch;
-- VPGSQL8.2 DROP INDEX ix_fk_product_stock
ALTER TABLE llx_actioncomm DROP COLUMN punctual;
DELETE FROM llx_menu where module='supplier_proposal';
UPDATE llx_website SET lang = 'en' WHERE lang like 'en_%';

View File

@ -48,7 +48,6 @@ create table llx_actioncomm
priority smallint, -- priority (ical standard)
visibility varchar(12) DEFAULT 'default', -- visibility (ical standard) - 'default', 'public', 'private', 'confidential'
fulldayevent smallint NOT NULL default 0, -- full day (ical standard)
punctual smallint NOT NULL default 1, -- deprecated. milestone is event with date start (datep) = date end (datep2)
percent smallint NOT NULL default 0,
location varchar(128),
durationp real, -- planed duration

View File

@ -58,8 +58,8 @@ AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in f
AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies...
AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s
AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from menu %s
AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s
AccountancyAreaDescChartModel=STEP %s: Check that a model of chart of account exists or create one from menu %s
AccountancyAreaDescChart=STEP %s: Select and|or complete your chart of account from menu %s
AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s.
AccountancyAreaDescDefault=STEP %s: Define default accounting accounts. For this, use the menu entry %s.

View File

@ -112,8 +112,10 @@ BOM_CLOSEInDolibarr=BOM disabled
BOM_REOPENInDolibarr=BOM reopen
BOM_DELETEInDolibarr=BOM deleted
MRP_MO_VALIDATEInDolibarr=MO validated
MRP_MO_UNVALIDATEInDolibarr=MO set to draft status
MRP_MO_PRODUCEDInDolibarr=MO produced
MRP_MO_DELETEInDolibarr=MO deleted
MRP_MO_CANCELInDolibarr=MO canceled
##### End agenda events #####
AgendaModelModule=Document templates for event
DateActionStart=Start date

View File

@ -929,7 +929,7 @@ class Mo extends CommonObject
return -1;
}*/
return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'MO_UNVALIDATE');
return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'MRP_MO_UNVALIDATE');
}
/**
@ -954,7 +954,7 @@ class Mo extends CommonObject
return -1;
}*/
return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'MO_CLOSE');
return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'MRP_MO_CANCEL');
}
/**
@ -967,7 +967,7 @@ class Mo extends CommonObject
public function reopen($user, $notrigger = 0)
{
// Protection
if ($this->status != self::STATUS_CANCELED)
if ($this->status != self::STATUS_PRODUCED && $this->status != self::STATUS_CANCELED)
{
return 0;
}
@ -979,7 +979,7 @@ class Mo extends CommonObject
return -1;
}*/
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'MO_REOPEN');
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'MRP_MO_REOPEN');
}
/**

View File

@ -169,6 +169,35 @@ if (empty($reshook))
{
$object->setProject(GETPOST('projectid', 'int'));
}
// Action close produced
if ($action == 'confirm_produced' && $confirm == 'yes' && $permissiontoadd)
{
$result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED');
if ($result >= 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model = $object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, 0, 0, 0);
}
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -630,10 +659,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS)
{
// TODO If production is already > 1, show only close, else show cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_produced&confirm=yes">'.$langs->trans("Close").'</a>'."\n";
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes">'.$langs->trans("Cancel").'</a>'."\n";
}
if ($object->status == $object::STATUS_CANCELED)
if ($object->status == $object::STATUS_PRODUCED || $object->status == $object::STATUS_CANCELED)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes">'.$langs->trans("Re-Open").'</a>'."\n";
}

View File

@ -383,6 +383,35 @@ if (empty($reshook))
exit;
}
}
// Action close produced
if ($action == 'confirm_produced' && $confirm == 'yes' && $permissiontoadd)
{
$result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED');
if ($result >= 0)
{
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model = $object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, 0, 0, 0);
}
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -599,6 +628,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($object->status == $object::STATUS_VALIDATED || $object->status == $object::STATUS_INPROGRESS)
{
// TODO If production is already > 1, show only close, else show cancel
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_produced&confirm=yes">'.$langs->trans("Close").'</a>'."\n";
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes">'.$langs->trans("Cancel").'</a>'."\n";
}

File diff suppressed because it is too large Load Diff