Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
073a04f8cb
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ dolibarr_install.log
|
|||||||
doxygen_warnings.log
|
doxygen_warnings.log
|
||||||
/.project
|
/.project
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.idea
|
||||||
|
|||||||
@ -52,6 +52,7 @@ class Fichinter extends CommonObject
|
|||||||
var $note_private;
|
var $note_private;
|
||||||
var $note_public;
|
var $note_public;
|
||||||
var $fk_project;
|
var $fk_project;
|
||||||
|
var $fk_contrat;
|
||||||
var $modelpdf;
|
var $modelpdf;
|
||||||
var $extraparams=array();
|
var $extraparams=array();
|
||||||
|
|
||||||
@ -67,6 +68,7 @@ class Fichinter extends CommonObject
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->products = array();
|
$this->products = array();
|
||||||
$this->fk_project = 0;
|
$this->fk_project = 0;
|
||||||
|
$this->fk_contrat = 0;
|
||||||
$this->statut = 0;
|
$this->statut = 0;
|
||||||
|
|
||||||
// List of language codes for status
|
// List of language codes for status
|
||||||
@ -137,6 +139,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= ", description";
|
$sql.= ", description";
|
||||||
$sql.= ", model_pdf";
|
$sql.= ", model_pdf";
|
||||||
$sql.= ", fk_projet";
|
$sql.= ", fk_projet";
|
||||||
|
$sql.= ", fk_contrat";
|
||||||
$sql.= ", fk_statut";
|
$sql.= ", fk_statut";
|
||||||
$sql.= ", note_private";
|
$sql.= ", note_private";
|
||||||
$sql.= ", note_public";
|
$sql.= ", note_public";
|
||||||
@ -150,6 +153,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= ", ".($this->description?"'".$this->db->escape($this->description)."'":"null");
|
$sql.= ", ".($this->description?"'".$this->db->escape($this->description)."'":"null");
|
||||||
$sql.= ", '".$this->modelpdf."'";
|
$sql.= ", '".$this->modelpdf."'";
|
||||||
$sql.= ", ".($this->fk_project ? $this->fk_project : 0);
|
$sql.= ", ".($this->fk_project ? $this->fk_project : 0);
|
||||||
|
$sql.= ", ".($this->fk_contrat ? $this->fk_contrat : 0);
|
||||||
$sql.= ", ".$this->statut;
|
$sql.= ", ".$this->statut;
|
||||||
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
||||||
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
||||||
@ -823,6 +827,40 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the label of the contract
|
||||||
|
*
|
||||||
|
* @param User $user Object user who modify
|
||||||
|
* @param string $description description
|
||||||
|
* @return int <0 if ko, >0 if ok
|
||||||
|
*/
|
||||||
|
function set_contrat($user, $contratid)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
if ($user->rights->ficheinter->creer)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
|
||||||
|
$sql.= " SET fk_contrat = '".$contratid."'";
|
||||||
|
$sql.= " WHERE rowid = ".$this->id;
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
//$sql.= " AND fk_statut = 0";
|
||||||
|
|
||||||
|
if ($this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->fk_contrat = $contratid;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
dol_syslog("Fichinter::set_contrat Erreur SQL");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adding a line of intervention into data base
|
* Adding a line of intervention into data base
|
||||||
*
|
*
|
||||||
|
|||||||
@ -49,6 +49,7 @@ $langs->load("interventions");
|
|||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$ref = GETPOST('ref','alpha');
|
$ref = GETPOST('ref','alpha');
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
|
$contratid = GETPOST('contratid','int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$confirm = GETPOST('confirm','alpha');
|
$confirm = GETPOST('confirm','alpha');
|
||||||
$mesg = GETPOST('msg','alpha');
|
$mesg = GETPOST('msg','alpha');
|
||||||
@ -137,6 +138,7 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
|||||||
$object->socid = $socid;
|
$object->socid = $socid;
|
||||||
$object->duree = GETPOST('duree','int');
|
$object->duree = GETPOST('duree','int');
|
||||||
$object->fk_project = GETPOST('projectid','int');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
|
$object->fk_contrat = GETPOST('contratid','int');
|
||||||
$object->author = $user->id;
|
$object->author = $user->id;
|
||||||
$object->description = GETPOST('description');
|
$object->description = GETPOST('description');
|
||||||
$object->ref = $ref;
|
$object->ref = $ref;
|
||||||
@ -304,6 +306,7 @@ else if ($action == 'update' && $user->rights->ficheinter->creer)
|
|||||||
|
|
||||||
$object->socid = $socid;
|
$object->socid = $socid;
|
||||||
$object->fk_project = GETPOST('projectid','int');
|
$object->fk_project = GETPOST('projectid','int');
|
||||||
|
$object->fk_contrat = GETPOST('contratid','int');
|
||||||
$object->author = $user->id;
|
$object->author = $user->id;
|
||||||
$object->description = GETPOST('description','alpha');
|
$object->description = GETPOST('description','alpha');
|
||||||
$object->ref = $ref;
|
$object->ref = $ref;
|
||||||
@ -372,6 +375,14 @@ else if ($action == 'classin' && $user->rights->ficheinter->creer)
|
|||||||
if ($result < 0) dol_print_error($db,$object->error);
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set into a contract
|
||||||
|
else if ($action == 'setcontrat' && $user->rights->contrat->creer)
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
$result=$object->set_contrat($user,GETPOST('contratid','int'));
|
||||||
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->ficheinter->supprimer)
|
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->ficheinter->supprimer)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
@ -1004,6 +1015,19 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Contrat
|
||||||
|
if ($conf->contrat->enabled)
|
||||||
|
{
|
||||||
|
$langs->load("contrat");
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Contrat").'</td><td>';
|
||||||
|
$numcontrat=select_contrats($soc->id,GETPOST('contratid','int'),'contratid');
|
||||||
|
if ($numcontrat==0)
|
||||||
|
{
|
||||||
|
print ' <a href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddContract").'</a>';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DefaultModel").'</td>';
|
print '<td>'.$langs->trans("DefaultModel").'</td>';
|
||||||
@ -1250,6 +1274,55 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Contrat
|
||||||
|
if ($conf->contrat->enabled)
|
||||||
|
{
|
||||||
|
$langs->load('contrat');
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>';
|
||||||
|
|
||||||
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
|
print $langs->trans('Contract');
|
||||||
|
print '</td>';
|
||||||
|
if ($action != 'contrat')
|
||||||
|
{
|
||||||
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=contrat&id='.$object->id.'">';
|
||||||
|
print img_edit($langs->trans('SetContrat'),1);
|
||||||
|
print '</a></td>';
|
||||||
|
}
|
||||||
|
print '</tr></table>';
|
||||||
|
print '</td><td colspan="3">';
|
||||||
|
if ($action == 'contrat')
|
||||||
|
{
|
||||||
|
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
|
print '<input type="hidden" name="action" value="setcontrat">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
|
print '<tr><td>';
|
||||||
|
//print "$socid,$selected,$htmlname";
|
||||||
|
select_contrats($object->socid,$object->fk_contrat,'contratid');
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
|
print '</tr></table></form>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($object->fk_contrat)
|
||||||
|
{
|
||||||
|
$contratstatic = new Contrat($db);
|
||||||
|
$contratstatic->fetch($object->fk_contrat);
|
||||||
|
//print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>';
|
||||||
|
print $contratstatic->getNomUrl(0,'',1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -120,6 +120,16 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '207', 'SC
|
|||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '208', 'SNC - Société en nom collectif');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '208', 'SNC - Société en nom collectif');
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '209', 'GIE - Groupement d intérêt économique');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '209', 'GIE - Groupement d intérêt économique');
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '210', 'GEIE - Groupement européen d intérêt économique');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '210', 'GEIE - Groupement européen d intérêt économique');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '220', 'Eenmanszaak');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '221', 'BVBA - Besloten vennootschap met beperkte aansprakelijkheid');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '222', 'NV - Naamloze Vennootschap');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '223', 'CVBA - Coöperatieve vennootschap met beperkte aansprakelijkheid');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '224', 'VZW - Vereniging zonder winstoogmerk');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '225', 'CVOA - Coöperatieve vennootschap met onbeperkte aansprakelijkheid ');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '226', 'GCV - Gewone commanditaire vennootschap');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '227', 'Comm.VA - Commanditaire vennootschap op aandelen');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '228', 'VOF - Vennootschap onder firma');
|
||||||
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (2, '229', 'VS0 - Vennootschap met sociaal oogmerk');
|
||||||
|
|
||||||
-- Germany
|
-- Germany
|
||||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '500', 'GmbH - Gesellschaft mit beschränkter Haftung');
|
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (5, '500', 'GmbH - Gesellschaft mit beschränkter Haftung');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user