Merge remote-tracking branch 'upstream/develop' into actioncomm_category
This commit is contained in:
commit
2e5f539b2a
@ -48,7 +48,14 @@ class AccountancySystem
|
|||||||
*/
|
*/
|
||||||
public $fk_pcg_version;
|
public $fk_pcg_version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string pcg type
|
||||||
|
*/
|
||||||
public $pcg_type;
|
public $pcg_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string pcg subtype
|
||||||
|
*/
|
||||||
public $pcg_subtype;
|
public $pcg_subtype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +68,14 @@ class AccountancySystem
|
|||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string account number
|
||||||
|
*/
|
||||||
public $account_number;
|
public $account_number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string account parent
|
||||||
|
*/
|
||||||
public $account_parent;
|
public $account_parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -42,8 +42,7 @@ class AccountingJournal extends CommonObject
|
|||||||
public $fk_element = '';
|
public $fk_element = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
* @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
* @var int
|
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 0;
|
public $ismultientitymanaged = 0;
|
||||||
|
|
||||||
@ -57,6 +56,9 @@ class AccountingJournal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Accounting journal code
|
||||||
|
*/
|
||||||
public $code;
|
public $code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,9 +66,19 @@ class AccountingJournal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
public $nature; // 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new
|
/**
|
||||||
|
* @var int 1:various operations, 2:sale, 3:purchase, 4:bank, 5:expense-report, 8:inventory, 9: has-new
|
||||||
|
*/
|
||||||
|
public $nature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int is active or not
|
||||||
|
*/
|
||||||
public $active;
|
public $active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array array of lines
|
||||||
|
*/
|
||||||
public $lines;
|
public $lines;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class BookKeeping extends CommonObject
|
|||||||
public $error;
|
public $error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Array of Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $errors = array();
|
public $errors = array();
|
||||||
|
|
||||||
@ -67,7 +67,14 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Date of source document, in db date NOT NULL
|
||||||
|
*/
|
||||||
public $doc_date;
|
public $doc_date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Deadline for payment
|
||||||
|
*/
|
||||||
public $date_lim_reglement;
|
public $date_lim_reglement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,9 +126,25 @@ class BookKeeping extends CommonObject
|
|||||||
* @var string label operation
|
* @var string label operation
|
||||||
*/
|
*/
|
||||||
public $label_operation;
|
public $label_operation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float FEC:Debit
|
||||||
|
*/
|
||||||
public $debit;
|
public $debit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float FEC:Credit
|
||||||
|
*/
|
||||||
public $credit;
|
public $credit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float FEC:Amount (Not necessary)
|
||||||
|
*/
|
||||||
public $montant;
|
public $montant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string FEC:Sens (Not necessary)
|
||||||
|
*/
|
||||||
public $sens;
|
public $sens;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,9 +152,24 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $fk_user_author;
|
public $fk_user_author;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string key for import
|
||||||
|
*/
|
||||||
public $import_key;
|
public $import_key;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string code journal
|
||||||
|
*/
|
||||||
public $code_journal;
|
public $code_journal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string label journal
|
||||||
|
*/
|
||||||
public $journal_label;
|
public $journal_label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int accounting transaction id
|
||||||
|
*/
|
||||||
public $piece_num;
|
public $piece_num;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,7 +178,6 @@ class BookKeeping extends CommonObject
|
|||||||
public $picto = 'generic';
|
public $picto = 'generic';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1077,7 +1077,7 @@ else
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|||||||
@ -373,11 +373,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
@ -823,7 +823,7 @@ if ($rowid > 0)
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -321,13 +321,15 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|
||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
//if ($user->rights->emailcollector->creer)
|
//if ($user->rights->emailcollector->creer)
|
||||||
//{
|
//{
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton.' '.$linkback, '', $limit);
|
||||||
|
|
||||||
// Add code for pre mass action (confirmation or email presend form)
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
/*$topicmail="";
|
/*$topicmail="";
|
||||||
|
|||||||
@ -391,11 +391,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
@ -606,7 +606,7 @@ if ($rowid > 0)
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -95,7 +95,7 @@ class BOM extends CommonObject
|
|||||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'),
|
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'),
|
||||||
'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
|
'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
|
||||||
'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
|
'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
|
||||||
'duration' => array('type'=>'real', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'),
|
'duration' => array('type'=>'duration', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'),
|
||||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>102),
|
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'enabled'=>1, 'visible'=>-1, 'position'=>102),
|
||||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-2, 'position'=>161, 'notnull'=>-1,),
|
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-2, 'position'=>161, 'notnull'=>-1,),
|
||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-2, 'position'=>162, 'notnull'=>-1,),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-2, 'position'=>162, 'notnull'=>-1,),
|
||||||
|
|||||||
@ -278,7 +278,7 @@ if ($user->rights->categorie->creer)
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -789,7 +789,8 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
$objs = array();
|
$objs = array();
|
||||||
|
|
||||||
$obj = new $this->MAP_OBJ_CLASS[$type]( $this->db );
|
$tmpclass = $this->MAP_OBJ_CLASS[$type];
|
||||||
|
$obj = new $tmpclass($this->db);
|
||||||
|
|
||||||
$sql = "SELECT c.fk_".$this->MAP_CAT_FK[$type];
|
$sql = "SELECT c.fk_".$this->MAP_CAT_FK[$type];
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".$this->MAP_CAT_TABLE[$type]." as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".$this->MAP_CAT_TABLE[$type]." as c";
|
||||||
|
|||||||
@ -180,7 +180,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -1132,7 +1132,7 @@ if ($action == 'create')
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -1549,7 +1549,7 @@ if ($id > 0)
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -1242,7 +1242,7 @@ else
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -1771,7 +1771,7 @@ if ($action == 'create' && $usercancreate)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Template to use by default
|
// Template to use by default
|
||||||
|
|||||||
@ -443,7 +443,7 @@ if ($action == 'create')
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -945,7 +945,7 @@ else
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -344,8 +344,6 @@ if ($action == 'create')
|
|||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
if (is_array($options) && count($options) && $conf->categorie->enabled)
|
if (is_array($options) && count($options) && $conf->categorie->enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3282,11 +3282,11 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols'=>2);
|
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Template to use by default
|
// Template to use by default
|
||||||
|
|||||||
@ -829,7 +829,7 @@ else
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table><br>";
|
print "</table><br>";
|
||||||
@ -1162,12 +1162,12 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"', 'cols'=>3);
|
$parameters = array('colspan' => ' colspan="3"', 'cols'=> '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->load_ref_elements();
|
$object->load_ref_elements();
|
||||||
|
|||||||
@ -1265,13 +1265,13 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"', 'cols'=>3);
|
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2017-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,7 +49,14 @@ if ($action == 'add' && ! empty($permissiontoadd))
|
|||||||
{
|
{
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
|
if ($object->fields[$key]['type'] == 'duration') {
|
||||||
|
if (GETPOST($key.'hour') == '' && GETPOST($key.'min') == '') continue; // The field was not submited to be edited
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited
|
||||||
|
}
|
||||||
|
// Ignore special fields
|
||||||
|
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
||||||
|
|
||||||
// Set value to insert
|
// Set value to insert
|
||||||
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
||||||
@ -58,6 +65,8 @@ if ($action == 'add' && ! empty($permissiontoadd))
|
|||||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
|
$value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
|
||||||
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
||||||
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
|
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'));
|
||||||
|
} elseif ($object->fields[$key]['type'] == 'duration') {
|
||||||
|
$value = 60*60*GETPOST($key.'hour', 'int') + 60*GETPOST($key.'min', 'int');
|
||||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||||
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
$value = price2num(GETPOST($key, 'none')); // To fix decimal separator according to lang setup
|
||||||
} else {
|
} else {
|
||||||
@ -108,8 +117,16 @@ if ($action == 'update' && !empty($permissiontoadd))
|
|||||||
{
|
{
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
|
// Check if field was submited to be edited
|
||||||
|
if ($object->fields[$key]['type'] == 'duration') {
|
||||||
|
if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) continue; // The field was not submited to be edited
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited
|
if (!GETPOSTISSET($key)) continue; // The field was not submited to be edited
|
||||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Ignore special fields
|
}
|
||||||
|
// Ignore special fields
|
||||||
|
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
||||||
|
|
||||||
// Set value to update
|
// Set value to update
|
||||||
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
if (in_array($object->fields[$key]['type'], array('text', 'html'))) {
|
||||||
$value = GETPOST($key, 'none');
|
$value = GETPOST($key, 'none');
|
||||||
@ -117,6 +134,12 @@ if ($action == 'update' && !empty($permissiontoadd))
|
|||||||
$value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
$value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
||||||
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
||||||
$value = dol_mktime(GETPOST($key.'hour'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
$value = dol_mktime(GETPOST($key.'hour'), GETPOST($key.'min'), 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year'));
|
||||||
|
} elseif ($object->fields[$key]['type'] == 'duration') {
|
||||||
|
if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') {
|
||||||
|
$value = 60*60*GETPOST($key.'hour', 'int') + 60*GETPOST($key.'min', 'int');
|
||||||
|
} else {
|
||||||
|
$value = '';
|
||||||
|
}
|
||||||
} elseif (in_array($object->fields[$key]['type'], array('price', 'real'))) {
|
} elseif (in_array($object->fields[$key]['type'], array('price', 'real'))) {
|
||||||
$value = price2num(GETPOST($key));
|
$value = price2num(GETPOST($key));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -5626,14 +5626,12 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$objectid = $this->id;
|
$objectid = $this->id;
|
||||||
|
|
||||||
|
|
||||||
if ($computed)
|
if ($computed)
|
||||||
{
|
{
|
||||||
if (!preg_match('/^search_/', $keyprefix)) return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
|
if (!preg_match('/^search_/', $keyprefix)) return '<span class="opacitymedium">'.$langs->trans("AutomaticallyCalculated").'</span>';
|
||||||
else return '';
|
else return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set value of $morecss. For this, we use in priority showsize from parameters, then $val['css'] then autodefine
|
// Set value of $morecss. For this, we use in priority showsize from parameters, then $val['css'] then autodefine
|
||||||
if (empty($morecss) && !empty($val['css']))
|
if (empty($morecss) && !empty($val['css']))
|
||||||
{
|
{
|
||||||
@ -5689,6 +5687,10 @@ abstract class CommonObject
|
|||||||
// TODO Must also support $moreparam
|
// TODO Must also support $moreparam
|
||||||
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
|
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
|
||||||
}
|
}
|
||||||
|
elseif (in_array($type, array('duration')))
|
||||||
|
{
|
||||||
|
$out=$form->select_duration($keyprefix.$key.$keysuffix, $value, 0, 'text', 0, 1);
|
||||||
|
}
|
||||||
elseif (in_array($type, array('int', 'integer')))
|
elseif (in_array($type, array('int', 'integer')))
|
||||||
{
|
{
|
||||||
$tmp = explode(',', $size);
|
$tmp = explode(',', $size);
|
||||||
@ -6239,7 +6241,6 @@ abstract class CommonObject
|
|||||||
$type = 'sellist';
|
$type = 'sellist';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$langfile = $val['langfile'];
|
$langfile = $val['langfile'];
|
||||||
$list = $val['list'];
|
$list = $val['list'];
|
||||||
$help = $val['help'];
|
$help = $val['help'];
|
||||||
@ -6313,9 +6314,16 @@ abstract class CommonObject
|
|||||||
$value = '';
|
$value = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif ($type == 'duration')
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
if (! is_null($value) && $value !== '') {
|
||||||
|
$value = convertSecondToTime($value, 'allhourmin');
|
||||||
|
}
|
||||||
|
}
|
||||||
elseif ($type == 'double' || $type == 'real')
|
elseif ($type == 'double' || $type == 'real')
|
||||||
{
|
{
|
||||||
if (!empty($value)) {
|
if (! is_null($value) && $value !== '') {
|
||||||
$value = price($value);
|
$value = price($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6341,8 +6349,10 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
elseif ($type == 'price')
|
elseif ($type == 'price')
|
||||||
{
|
{
|
||||||
|
if (! is_null($value) && $value !== '') {
|
||||||
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
elseif ($type == 'select')
|
elseif ($type == 'select')
|
||||||
{
|
{
|
||||||
$value = $param['options'][$value];
|
$value = $param['options'][$value];
|
||||||
@ -6614,12 +6624,21 @@ abstract class CommonObject
|
|||||||
// Load language if required
|
// Load language if required
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
||||||
|
|
||||||
$colspan = '3';
|
$colspan = '';
|
||||||
if (is_array($params) && count($params) > 0) {
|
if (is_array($params) && count($params) > 0) {
|
||||||
if (array_key_exists('colspan', $params)) {
|
if (array_key_exists('cols', $params)) {
|
||||||
|
$colspan = $params['cols'];
|
||||||
|
}
|
||||||
|
elseif (array_key_exists('colspan', $params)) { // For backward compatibility. Use cols instead now.
|
||||||
|
$reg = array();
|
||||||
|
if (preg_match('/colspan="(\d+)"/', $params['colspan'], $reg)) {
|
||||||
|
$colspan = $reg[1];
|
||||||
|
}
|
||||||
|
else {
|
||||||
$colspan = $params['colspan'];
|
$colspan = $params['colspan'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case "view":
|
case "view":
|
||||||
@ -6659,7 +6678,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$out .= $extrafields->showSeparator($key, $this);
|
$out .= $extrafields->showSeparator($key, $this, ($colspan + 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -6679,9 +6698,9 @@ abstract class CommonObject
|
|||||||
$domData .= ' data-targetelement="'.$this->element.'"';
|
$domData .= ' data-targetelement="'.$this->element.'"';
|
||||||
$domData .= ' data-targetid="'.$this->id.'"';
|
$domData .= ' data-targetid="'.$this->id.'"';
|
||||||
|
|
||||||
$html_id = !empty($this->id) ? 'extrarow-'.$this->element.'_'.$key.'_'.$this->id : '';
|
$html_id = (empty($this->id) ? '' : 'extrarow-'.$this->element.'_'.$key.'_'.$this->id);
|
||||||
|
|
||||||
$out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
|
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan = '0'; }
|
if (!empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan = '0'; }
|
||||||
|
|
||||||
@ -6725,8 +6744,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
|
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
|
||||||
|
|
||||||
$out .= '<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'" '.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
|
$out .= '<td '.($html_id ? 'id="'.$html_id.'" ' : '').'class="'.$this->element.'_extras_'.$key.'" '.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
|
||||||
//$out .='<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'">';
|
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case "view":
|
case "view":
|
||||||
@ -7173,6 +7191,22 @@ abstract class CommonObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function test if type is duration
|
||||||
|
*
|
||||||
|
* @param array $info content informations of field
|
||||||
|
* @return bool true if field of type duration
|
||||||
|
*/
|
||||||
|
public function isDuration($info)
|
||||||
|
{
|
||||||
|
if (is_array($info))
|
||||||
|
{
|
||||||
|
if (isset($info['type']) && ($info['type'] == 'duration')) return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function test if type is integer
|
* Function test if type is integer
|
||||||
*
|
*
|
||||||
@ -7307,19 +7341,24 @@ abstract class CommonObject
|
|||||||
$queryarray[$field] = null;
|
$queryarray[$field] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($this->isInt($info))
|
elseif ($this->isDuration($info))
|
||||||
|
{
|
||||||
|
// $this->{$field} may be null, '', 0, '0', 123, '123'
|
||||||
|
if ($this->{$field} != '' || !empty($info['notnull'])) $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||||
|
else $queryarray[$field] = null;
|
||||||
|
}
|
||||||
|
elseif ($this->isInt($info) || $this->isFloat($info))
|
||||||
{
|
{
|
||||||
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field] = $conf->entity;
|
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field] = $conf->entity;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$queryarray[$field] = (int) $this->{$field};
|
// $this->{$field} may be null, '', 0, '0', 123, '123'
|
||||||
if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field.
|
if ($this->{$field} != '' || !empty($info['notnull'])) {
|
||||||
|
if ($this->isInt($info)) $queryarray[$field] = (int) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||||
|
if ($this->isFloat($info)) $queryarray[$field] = (double) $this->{$field}; // If '0', it may be set to null later if $info['notnull'] == -1
|
||||||
}
|
}
|
||||||
|
else $queryarray[$field] = null;
|
||||||
}
|
}
|
||||||
elseif($this->isFloat($info))
|
|
||||||
{
|
|
||||||
$queryarray[$field] = (double) $this->{$field};
|
|
||||||
if (empty($queryarray[$field])) $queryarray[$field]=0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -7327,7 +7366,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($info['type'] == 'timestamp' && empty($queryarray[$field])) unset($queryarray[$field]);
|
if ($info['type'] == 'timestamp' && empty($queryarray[$field])) unset($queryarray[$field]);
|
||||||
if (!empty($info['notnull']) && $info['notnull'] == -1 && empty($queryarray[$field])) $queryarray[$field] = null;
|
if (!empty($info['notnull']) && $info['notnull'] == -1 && empty($queryarray[$field])) $queryarray[$field] = null; // May force 0 to null
|
||||||
}
|
}
|
||||||
|
|
||||||
return $queryarray;
|
return $queryarray;
|
||||||
@ -7370,7 +7409,11 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (! is_null($obj->{$field}) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||||
$this->{$field} = (int) $obj->{$field};
|
$this->{$field} = (int) $obj->{$field};
|
||||||
|
} else {
|
||||||
|
$this->{$field} = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7383,7 +7426,11 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (! is_null($obj->{$field}) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||||
$this->{$field} = (double) $obj->{$field};
|
$this->{$field} = (double) $obj->{$field};
|
||||||
|
} else {
|
||||||
|
$this->{$field} = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -7417,7 +7464,7 @@ abstract class CommonObject
|
|||||||
protected function quote($value, $fieldsentry)
|
protected function quote($value, $fieldsentry)
|
||||||
{
|
{
|
||||||
if (is_null($value)) return 'NULL';
|
if (is_null($value)) return 'NULL';
|
||||||
elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) return $this->db->escape("$value");
|
||||||
else return "'".$this->db->escape($value)."'";
|
else return "'".$this->db->escape($value)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7438,6 +7485,7 @@ abstract class CommonObject
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$fieldvalues = $this->setSaveQuery();
|
$fieldvalues = $this->setSaveQuery();
|
||||||
|
|
||||||
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) $fieldvalues['date_creation'] = $this->db->idate($now);
|
||||||
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) $fieldvalues['fk_user_creat'] = $user->id;
|
||||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
|
||||||
@ -7459,7 +7507,7 @@ abstract class CommonObject
|
|||||||
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
|
if (!empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key] = '';
|
||||||
|
|
||||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||||
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
|
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && !isset($values[$key]) && is_null($this->fields[$key]['default']))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
$this->errors[] = $langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||||
@ -7670,6 +7718,7 @@ abstract class CommonObject
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$fieldvalues = $this->setSaveQuery();
|
$fieldvalues = $this->setSaveQuery();
|
||||||
|
|
||||||
if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) $fieldvalues['date_modification'] = $this->db->idate($now);
|
if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) $fieldvalues['date_modification'] = $this->db->idate($now);
|
||||||
if (array_key_exists('fk_user_modif', $fieldvalues) && !($fieldvalues['fk_user_modif'] > 0)) $fieldvalues['fk_user_modif'] = $user->id;
|
if (array_key_exists('fk_user_modif', $fieldvalues) && !($fieldvalues['fk_user_modif'] > 0)) $fieldvalues['fk_user_modif'] = $user->id;
|
||||||
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
|
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
|
||||||
|
|||||||
@ -1957,13 +1957,14 @@ class ExtraFields
|
|||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @param string $object Object
|
* @param string $object Object
|
||||||
|
* @param int $colspan Value of colspan to use (it must includes the first column with title)
|
||||||
* @return string HTML code with line for separator
|
* @return string HTML code with line for separator
|
||||||
*/
|
*/
|
||||||
public function showSeparator($key, $object)
|
public function showSeparator($key, $object, $colspan = 2)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$out = '<tr id="trextrafieldseparator'.$key.'" class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="2"><strong>';
|
$out = '<tr id="trextrafieldseparator'.$key.'" class="trextrafieldseparator trextrafieldseparator'.$key.'"><td colspan="'.$colspan.'"><strong>';
|
||||||
$out .= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
|
$out .= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
|
||||||
$out .= '</strong></td></tr>';
|
$out .= '</strong></td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -5753,8 +5753,8 @@ class Form
|
|||||||
* @param int $iSecond Default preselected duration (number of seconds or '')
|
* @param int $iSecond Default preselected duration (number of seconds or '')
|
||||||
* @param int $disabled Disable the combo box
|
* @param int $disabled Disable the combo box
|
||||||
* @param string $typehour If 'select' then input hour and input min is a combo,
|
* @param string $typehour If 'select' then input hour and input min is a combo,
|
||||||
* if 'text' input hour is in text and input min is a text,
|
* If 'text' input hour is in text and input min is a text,
|
||||||
* if 'textselect' input hour is in text and input min is a combo
|
* If 'textselect' input hour is in text and input min is a combo
|
||||||
* @param integer $minunderhours If 1, show minutes selection under the hours
|
* @param integer $minunderhours If 1, show minutes selection under the hours
|
||||||
* @param int $nooutput Do not output html string but return it
|
* @param int $nooutput Do not output html string but return it
|
||||||
* @return string|void
|
* @return string|void
|
||||||
|
|||||||
@ -229,9 +229,10 @@ class FormWebsite
|
|||||||
* @param int $showempty Show empty record
|
* @param int $showempty Show empty record
|
||||||
* @param string $action Action on page that use this select list
|
* @param string $action Action on page that use this select list
|
||||||
* @param string $morecss More CSS
|
* @param string $morecss More CSS
|
||||||
|
* @param array $excludeids Exclude some ID in list
|
||||||
* @return string HTML select component with list of type of containers
|
* @return string HTML select component with list of type of containers
|
||||||
*/
|
*/
|
||||||
public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200')
|
public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -264,6 +265,8 @@ class FormWebsite
|
|||||||
|
|
||||||
foreach ($website->lines as $key => $valpage)
|
foreach ($website->lines as $key => $valpage)
|
||||||
{
|
{
|
||||||
|
if (is_array($excludeids) && count($excludeids) && in_array($valpage->id, $excludeids)) continue;
|
||||||
|
|
||||||
$valueforoption = '<span class="opacitymedium">['.$valpage->type_container.' '.sprintf("%03d", $valpage->id).']</span> ';
|
$valueforoption = '<span class="opacitymedium">['.$valpage->type_container.' '.sprintf("%03d", $valpage->id).']</span> ';
|
||||||
$valueforoption .= $valpage->pageurl.' - '.$valpage->title;
|
$valueforoption .= $valpage->pageurl.' - '.$valpage->title;
|
||||||
if ($website->fk_default_home && $key == $website->fk_default_home) $valueforoption .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
|
if ($website->fk_default_home && $key == $website->fk_default_home) $valueforoption .= ' <span class="opacitymedium">('.$langs->trans("HomePage").')</span>';
|
||||||
|
|||||||
@ -63,8 +63,8 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
if (! preg_match('/^(integer|price|sellist|date|varchar|double|text|html)/', $addfieldentry['type'])
|
if (! preg_match('/^(integer|price|sellist|varchar|double|text|html|duration)/', $addfieldentry['type'])
|
||||||
&& ! preg_match('/^(boolean|real|timestamp)$/', $addfieldentry['type']))
|
&& ! preg_match('/^(boolean|real|date|datetime|timestamp)$/', $addfieldentry['type']))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('BadValueForType', $objectname), null, 'errors');
|
setEventMessages($langs->trans('BadValueForType', $objectname), null, 'errors');
|
||||||
return -2;
|
return -2;
|
||||||
@ -164,7 +164,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||||||
|
|
||||||
if (count($object->fields))
|
if (count($object->fields))
|
||||||
{
|
{
|
||||||
$typetotypephp=array('integer'=>'integer', 'varchar'=>'string');
|
//$typetotypephp=array('integer'=>'integer', 'duration'=>'integer', 'varchar'=>'string');
|
||||||
|
|
||||||
foreach($object->fields as $key => $val)
|
foreach($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
@ -266,7 +266,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||||||
|
|
||||||
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
|
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
|
||||||
elseif ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
|
elseif ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
|
||||||
elseif ($type == 'link' || $type == 'sellist') $type = 'integer';
|
elseif (in_array($type, array('link', 'sellist', 'duration'))) $type = 'integer';
|
||||||
$texttoinsert.= "\t".$key." ".$type;
|
$texttoinsert.= "\t".$key." ".$type;
|
||||||
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
|
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
|
||||||
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
|
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
|
||||||
|
|||||||
@ -508,7 +508,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$title = $langs->trans("GoIntoSetupToChangeLogo");
|
$title = $langs->trans("GoIntoSetupToChangeLogo");
|
||||||
|
|
||||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||||
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1);
|
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo nohover"', 1);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="center '.$logoContainerAdditionalClass.' menulogocontainer"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
|
print '<div class="center '.$logoContainerAdditionalClass.' menulogocontainer"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
|
||||||
|
|||||||
@ -264,12 +264,12 @@ class modEmailCollector extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
|
global $conf, $user;
|
||||||
//$this->_load_tables('/dav/sql/');
|
//$this->_load_tables('/dav/sql/');
|
||||||
|
|
||||||
// Create extrafields
|
// Create extrafields
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
//$extrafields = new ExtraFields($this->db);
|
||||||
|
|
||||||
//$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
//$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
||||||
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
||||||
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled');
|
||||||
@ -278,6 +278,60 @@ class modEmailCollector extends DolibarrModules
|
|||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
|
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity;
|
||||||
|
$tmpresql = $this->db->query($tmpsql);
|
||||||
|
if ($tmpresql) {
|
||||||
|
if ($this->db->num_rows($tmpresql) == 0) {
|
||||||
|
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Requets', 'Example to collect ticket requests', 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
||||||
|
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sqlforexampleA3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleA3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'to', 'support@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sqlforexampleA4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleA4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requets' and entity = ".$conf->entity."), 'ticket', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sql[] = $sqlforexampleA1;
|
||||||
|
$sql[] = $sqlforexampleA2;
|
||||||
|
$sql[] = $sqlforexampleA3;
|
||||||
|
$sql[] = $sqlforexampleA4;
|
||||||
|
}
|
||||||
|
} else dol_print_error($this->db);
|
||||||
|
|
||||||
|
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity;
|
||||||
|
$tmpresql = $this->db->query($tmpsql);
|
||||||
|
if ($tmpresql) {
|
||||||
|
if ($this->db->num_rows($tmpresql) == 0) {
|
||||||
|
$sqlforexampleB1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleB1 .= " VALUES (".$conf->entity.", 'Collect_Responses', 'Example to collect any email responses', 'This collector will scan your mailbox to find all emails that are an answer of an email sent from your application. An event with the email response will be recorded at the good place (Module Agenda must be enabled). For example, if your send a commercial proposal, order or invoice by email and your customer answers your email, the system will automatically find the answer and add it into your ERP.', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
||||||
|
$sqlforexampleB2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleB2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity."), 'withtrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sqlforexampleB3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleB3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses' and entity = ".$conf->entity."), 'recordevent', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sql[] = $sqlforexampleB1;
|
||||||
|
$sql[] = $sqlforexampleB2;
|
||||||
|
$sql[] = $sqlforexampleB3;
|
||||||
|
}
|
||||||
|
} else dol_print_error($this->db);
|
||||||
|
|
||||||
|
$tmpsql = "SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity;
|
||||||
|
$tmpresql = $this->db->query($tmpsql);
|
||||||
|
if ($tmpresql) {
|
||||||
|
if ($this->db->num_rows($tmpresql) == 0) {
|
||||||
|
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Leads', 'Example to collect leads', 'This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can''t be found in database (new customer), the lead will be attached to the thirdparty with ID 1.', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
|
||||||
|
$sqlforexampleC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sqlforexampleC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'to', 'sales@example.com', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
|
||||||
|
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".$conf->entity."), 'project', 'tmp_aaa=EXTRACT:HEADER:^From:(.*);description=EXTRACT:BODY:(.*);title=SET:Lead or message by __tmp_aaa__ receivied by email;socid=SETIFEMPTY:1', '".$this->db->idate(dol_now())."', ".$user->id.", 1)";
|
||||||
|
$sql[] = $sqlforexampleC1;
|
||||||
|
$sql[] = $sqlforexampleC2;
|
||||||
|
$sql[] = $sqlforexampleC3;
|
||||||
|
$sql[] = $sqlforexampleC4;
|
||||||
|
}
|
||||||
|
} else dol_print_error($this->db);
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -455,7 +455,7 @@ if ($action == 'create')
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tbody>';
|
print '</tbody>';
|
||||||
@ -589,7 +589,7 @@ if (!empty($id) && $action == 'edit')
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|||||||
@ -864,17 +864,17 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
if (empty($this->host))
|
if (empty($this->host))
|
||||||
{
|
{
|
||||||
$this->error = $langs->trans('ErrorFieldRequired', 'EMailHost');
|
$this->error = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('EMailHost'));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (empty($this->login))
|
if (empty($this->login))
|
||||||
{
|
{
|
||||||
$this->error = $langs->trans('ErrorFieldRequired', 'Login');
|
$this->error = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Login'));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (empty($this->source_directory))
|
if (empty($this->source_directory))
|
||||||
{
|
{
|
||||||
$this->error = $langs->trans('ErrorFieldRequired', 'MailboxSourceDirectory');
|
$this->error = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('MailboxSourceDirectory'));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!function_exists('imap_open'))
|
if (!function_exists('imap_open'))
|
||||||
|
|||||||
@ -1025,7 +1025,7 @@ if ($action == 'create')
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
@ -1034,7 +1034,7 @@ if ($action == 'create')
|
|||||||
if ($object->fetch_optionals() > 0) {
|
if ($object->fetch_optionals() > 0) {
|
||||||
$expe->array_options = array_merge($expe->array_options, $object->array_options);
|
$expe->array_options = array_merge($expe->array_options, $object->array_options);
|
||||||
}
|
}
|
||||||
print $expe->showOptionals($extrafields, 'edit');
|
print $expe->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1994,7 +1994,7 @@ elseif ($id || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"');
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
|||||||
@ -1532,11 +1532,11 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"');
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => 3);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tbody>';
|
print '<tbody>';
|
||||||
|
|||||||
@ -906,18 +906,17 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
print '<form name="fichinter" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="socid" value='.$soc->id.'>';
|
||||||
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
dol_fiche_head('');
|
dol_fiche_head('');
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
print '<input type="hidden" name="socid" value='.$soc->id.'>';
|
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("ThirdParty").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("ThirdParty").'</td><td>'.$soc->getNomUrl(1).'</td></tr>';
|
||||||
|
|
||||||
print '<input type="hidden" name="action" value="add">';
|
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
|
||||||
|
|
||||||
// Description (must be a textarea and not html must be allowed (used in list view)
|
// Description (must be a textarea and not html must be allowed (used in list view)
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||||
@ -963,15 +962,15 @@ if ($action == 'create')
|
|||||||
// Model
|
// Model
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DefaultModel").'</td>';
|
print '<td>'.$langs->trans("DefaultModel").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
$liste = ModelePDFFicheinter::liste_modeles($db);
|
$liste = ModelePDFFicheinter::liste_modeles($db);
|
||||||
print $form->selectarray('model', $liste, $conf->global->FICHEINTER_ADDON_PDF);
|
print $form->selectarray('model', $liste, $conf->global->FICHEINTER_ADDON_PDF);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Public note
|
// Public note
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
//print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
//print '<textarea name="note_public" cols="80" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
||||||
@ -982,7 +981,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
//print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
//print '<textarea name="note_private" cols="80" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
||||||
@ -990,7 +989,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="2"');
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
|
|||||||
@ -1610,15 +1610,13 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans('RefSupplier').'</td><td><input name="refsupplier" type="text"></td>';
|
print '<tr><td>'.$langs->trans('RefSupplier').'</td><td><input name="refsupplier" type="text"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Payment term
|
// Payment term
|
||||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||||
$form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
$form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||||
$form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
|
$form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -1636,7 +1634,7 @@ if ($action == 'create')
|
|||||||
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && !empty($conf->banque->enabled))
|
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && !empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("bank");
|
$langs->load("bank");
|
||||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
|
||||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1647,10 +1645,9 @@ if ($action == 'create')
|
|||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||||
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$societe->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$societe->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1659,7 +1656,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
|
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $object->label_incoterms, 1).'</label></td>';
|
||||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
print '<td class="maxwidthonsmartphone">';
|
||||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''));
|
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1669,7 +1666,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
||||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
print '<td class="maxwidthonsmartphone">';
|
||||||
print $form->selectMultiCurrency($currency_code, 'multicurrency_code');
|
print $form->selectMultiCurrency($currency_code, 'multicurrency_code');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -1700,26 +1697,26 @@ if ($action == 'create')
|
|||||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||||
|
|
||||||
$newclassname = $classname;
|
$newclassname = $classname;
|
||||||
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
|
print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('AmountHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
|
print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
|
||||||
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE
|
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 RE
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax1)."</td></tr>";
|
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2 IRPF
|
if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) // Localtax2 IRPF
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td colspan="2">'.price($objectsrc->total_localtax2)."</td></tr>";
|
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
|
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled))
|
if (!empty($conf->multicurrency->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
|
print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_tva).'</td></tr>';
|
print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva).'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ttc).'</td></tr>';
|
print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc).'</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -336,22 +336,22 @@ if ($action == 'create' && !$error) {
|
|||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
|
||||||
|
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.dol_escape_htmltag(isset($_POST['ref_supplier']) ? GETPOST('ref_supplier', 'alpha', 2) : '').'" type="text"></td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('RefSupplier').'</td><td><input name="ref_supplier" value="'.dol_escape_htmltag(isset($_POST['ref_supplier']) ? GETPOST('ref_supplier', 'alpha', 2) : '').'" type="text"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date invoice
|
// Date invoice
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
||||||
print $html->selectDate('', '', '', '', '', "add", 1, 1);
|
print $html->selectDate('', '', '', '', '', "add", 1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Payment term
|
// Payment term
|
||||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
|
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||||
$html->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
$html->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||||
$html->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
|
$html->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Project
|
// Project
|
||||||
@ -359,7 +359,7 @@ if ($action == 'create' && !$error) {
|
|||||||
$formproject = new FormProjets($db);
|
$formproject = new FormProjets($db);
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
||||||
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
$formproject->select_projects($soc->id, $projectid, 'projectid');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -367,9 +367,7 @@ if ($action == 'create' && !$error) {
|
|||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'objectsrc' => $objectsrc,
|
'objectsrc' => $objectsrc,
|
||||||
'idsrc' => $listoforders,
|
'idsrc' => $listoforders
|
||||||
'colspan' => ' colspan="2"',
|
|
||||||
'cols'=>2
|
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
@ -390,7 +388,7 @@ if ($action == 'create' && !$error) {
|
|||||||
// Public note
|
// Public note
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
print '<textarea name="note_public" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">';
|
print '<textarea name="note_public" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">';
|
||||||
|
|
||||||
print $langs->trans("Orders").": ".implode(', ', $listoforders);
|
print $langs->trans("Orders").": ".implode(', ', $listoforders);
|
||||||
@ -401,7 +399,7 @@ if ($action == 'create' && !$error) {
|
|||||||
if (empty($user->socid)) {
|
if (empty($user->socid)) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
||||||
|
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 29 KiB |
Binary file not shown.
@ -512,3 +512,29 @@ ALTER TABLE llx_categorie_actioncomm ADD INDEX idx_categorie_actioncomm_fk_actio
|
|||||||
|
|
||||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||||
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
|
ALTER TABLE llx_categorie_actioncomm ADD CONSTRAINT fk_categorie_actioncomm_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm (id);
|
||||||
|
|
||||||
|
CREATE TABLE llx_mrp_production(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
fk_mo integer NOT NULL,
|
||||||
|
position integer NOT NULL DEFAULT 0,
|
||||||
|
fk_product integer NOT NULL,
|
||||||
|
fk_warehouse integer,
|
||||||
|
qty integer NOT NULL DEFAULT 1,
|
||||||
|
batch varchar(30),
|
||||||
|
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
|
||||||
|
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
|
||||||
|
fk_stock_movement integer, -- id of stock movement when movements are validated
|
||||||
|
date_creation datetime NOT NULL,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer NOT NULL,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key varchar(14)
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_mo FOREIGN KEY (fk_mo) REFERENCES llx_mrp_mo (rowid);
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_stock_movement FOREIGN KEY (fk_stock_movement) REFERENCES llx_stock_mouvement (rowid);
|
||||||
|
|
||||||
|
ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo);
|
||||||
|
|
||||||
|
ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity);
|
||||||
|
|||||||
0
htdocs/install/mysql/migration/3.5.0-3.6.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/3.5.0-3.6.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/3.6.0-3.7.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/3.6.0-3.7.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/3.7.0-3.8.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/3.7.0-3.8.0.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/repair.sql
Executable file → Normal file
0
htdocs/install/mysql/migration/repair.sql
Executable file → Normal file
@ -19,7 +19,5 @@ ALTER TABLE llx_emailcollector_emailcollector ADD INDEX idx_emailcollector_entit
|
|||||||
ALTER TABLE llx_emailcollector_emailcollector ADD INDEX idx_emailcollector_status (status);
|
ALTER TABLE llx_emailcollector_emailcollector ADD INDEX idx_emailcollector_status (status);
|
||||||
-- END MODULEBUILDER INDEXES
|
-- END MODULEBUILDER INDEXES
|
||||||
|
|
||||||
--ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_fieldxyz(fieldx, fieldy);
|
ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity);
|
||||||
|
|
||||||
--ALTER TABLE llx_emailcollector_emailcollector ADD CONSTRAINT llx_emailcollector_emailcollector_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid);
|
|
||||||
|
|
||||||
|
|||||||
21
htdocs/install/mysql/tables/llx_mrp_production.key.sql
Normal file
21
htdocs/install/mysql/tables/llx_mrp_production.key.sql
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
-- Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- This program is free software: you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation, either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_mo FOREIGN KEY (fk_mo) REFERENCES llx_mrp_mo (rowid);
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
|
||||||
|
ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_stock_movement FOREIGN KEY (fk_stock_movement) REFERENCES llx_stock_mouvement (rowid);
|
||||||
|
|
||||||
|
ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo);
|
||||||
|
|
||||||
34
htdocs/install/mysql/tables/llx_mrp_production.sql
Normal file
34
htdocs/install/mysql/tables/llx_mrp_production.sql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
-- Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- This program is free software: you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation, either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see http://www.gnu.org/licenses/.
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE llx_mrp_production(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||||
|
fk_mo integer NOT NULL,
|
||||||
|
position integer NOT NULL DEFAULT 0,
|
||||||
|
fk_product integer NOT NULL,
|
||||||
|
fk_warehouse integer,
|
||||||
|
qty integer NOT NULL DEFAULT 1,
|
||||||
|
batch varchar(30),
|
||||||
|
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
|
||||||
|
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
|
||||||
|
fk_stock_movement integer, -- id of stock movement when movements are validated
|
||||||
|
date_creation datetime NOT NULL,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer NOT NULL,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key varchar(14)
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
@ -17,6 +17,7 @@
|
|||||||
--
|
--
|
||||||
-- This table is dedicated to store detail (lots/serial) of a stock
|
-- This table is dedicated to store detail (lots/serial) of a stock
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
CREATE TABLE llx_product_batch (
|
CREATE TABLE llx_product_batch (
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
|
|||||||
@ -50,3 +50,5 @@ BomAndBomLines=Bills Of Material and lines
|
|||||||
BOMLine=Line of BOM
|
BOMLine=Line of BOM
|
||||||
WarehouseForProduction=Warehouse for production
|
WarehouseForProduction=Warehouse for production
|
||||||
CreateMO=Create MO
|
CreateMO=Create MO
|
||||||
|
ToConsume=A consommer
|
||||||
|
Manufactured=Fabriqué
|
||||||
|
|||||||
@ -2480,7 +2480,7 @@ elseif (! empty($module))
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th class="liste_titre">'.$langs->trans("Property");
|
print '<th>'.$langs->trans("Property");
|
||||||
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank">'.$langs->trans("SeeExamples").'</a>)';
|
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank">'.$langs->trans("SeeExamples").'</a>)';
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th>';
|
print '<th>';
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class MyObject extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float')
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
* 'label' the translation key.
|
* 'label' the translation key.
|
||||||
* 'enabled' is a condition when the field must be managed.
|
* 'enabled' is a condition when the field must be managed.
|
||||||
@ -94,7 +94,7 @@ class MyObject extends CommonObject
|
|||||||
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20),
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20),
|
||||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1),
|
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'showoncombobox'=>1),
|
||||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'),
|
'amount' =>array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'),
|
||||||
'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'),
|
'qty' =>array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'),
|
||||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'),
|
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'),
|
||||||
'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1),
|
'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1),
|
||||||
|
|||||||
@ -251,7 +251,10 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
}
|
}
|
||||||
else {
|
else if (jQuery('#fk_bom').val() < 0) {
|
||||||
|
// Redirect to page with all fields defined except fk_bom set
|
||||||
|
console.log(jQuery('#fk_product').val());
|
||||||
|
window.location.href = '<?php echo $_SERVER["PHP_SELF"] ?>?action=create&qty='+jQuery('#qty').val()+'&fk_product='+jQuery('#fk_product').val()+'&label='+jQuery('#label').val()+'&fk_project='+jQuery('#fk_project').val()+'&fk_warehouse='+jQuery('#fk_warehouse').val();
|
||||||
/*
|
/*
|
||||||
$('#qty').val('');
|
$('#qty').val('');
|
||||||
$("#fk_product").val('');
|
$("#fk_product").val('');
|
||||||
@ -275,8 +278,10 @@ if ($action == 'create')
|
|||||||
print '<input type="'.($backtopage ? "submit" : "button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
print '<input type="'.($backtopage ? "submit" : "button").'" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
if (GETPOST('fk_bom', 'int') > 0) {
|
||||||
print load_fiche_titre($langs->trans("ToConsume"));
|
print load_fiche_titre($langs->trans("ToConsume"));
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
$object->lines = $objectbom->lines;
|
$object->lines = $objectbom->lines;
|
||||||
@ -284,6 +289,8 @@ if ($action == 'create')
|
|||||||
$object->printOriginLinesList('', array());
|
$object->printOriginLinesList('', array());
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1146,7 +1146,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => 3);
|
$parameters = array('colspan' => 3, 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
@ -1533,7 +1533,7 @@ else
|
|||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags-Categories
|
// Tags-Categories
|
||||||
@ -1976,7 +1976,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="'.(2 + (($showphoto || $showbarcode) ? 1 : 0)).'"');
|
$parameters = array('colspan' => ' colspan="'.(2 + (($showphoto || $showbarcode) ? 1 : 0)).'"', 'cols' => (2 + (($showphoto || $showbarcode) ? 1 : 0)));
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
|
|||||||
@ -2687,9 +2687,10 @@ class Product extends CommonObject
|
|||||||
* @param int $socid Id societe pour filtrer sur une societe
|
* @param int $socid Id societe pour filtrer sur une societe
|
||||||
* @param string $filtrestatut Id statut pour filtrer sur un statut
|
* @param string $filtrestatut Id statut pour filtrer sur un statut
|
||||||
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
|
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
|
||||||
* @return array Tableau des stats
|
* @param string $filterShipmentStatus [=''] Ids shipment status separated by comma
|
||||||
|
* @return int <0 if KO, >0 if OK (Tableau des stats)
|
||||||
*/
|
*/
|
||||||
public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0)
|
public function load_stats_sending($socid = 0, $filtrestatut = '', $forVirtualStock = 0, $filterShipmentStatus = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
@ -2719,6 +2720,7 @@ class Product extends CommonObject
|
|||||||
if ($filtrestatut <> '') {
|
if ($filtrestatut <> '') {
|
||||||
$sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
$sql.= " AND c.fk_statut in (".$filtrestatut.")";
|
||||||
}
|
}
|
||||||
|
if (!empty($filterShipmentStatus)) $sql.= " AND e.fk_statut IN (" . $filterShipmentStatus . ")";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result ) {
|
if ($result ) {
|
||||||
@ -4680,7 +4682,14 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
if (!empty($conf->expedition->enabled))
|
if (!empty($conf->expedition->enabled))
|
||||||
{
|
{
|
||||||
$result = $this->load_stats_sending(0, '1,2', 1);
|
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
|
||||||
|
$filterShipmentStatus = '';
|
||||||
|
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||||
|
$filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED;
|
||||||
|
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||||
|
$filterShipmentStatus = Expedition::STATUS_CLOSED;
|
||||||
|
}
|
||||||
|
$result = $this->load_stats_sending(0, '1,2', 1, $filterShipmentStatus);
|
||||||
if ($result < 0) dol_print_error($this->db, $this->error);
|
if ($result < 0) dol_print_error($this->db, $this->error);
|
||||||
$stock_sending_client = $this->stats_expedition['qty'];
|
$stock_sending_client = $this->stats_expedition['qty'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1274,7 +1274,7 @@ if ($action == 'edit_price' && $object->getRights()->creer)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$parameters = array('colspan' => 2);
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -721,12 +721,12 @@ else
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"', 'cols'=>3);
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
// Tags-Categories
|
// Tags-Categories
|
||||||
if ($conf->categorie->enabled)
|
if ($conf->categorie->enabled)
|
||||||
|
|||||||
@ -661,8 +661,15 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
// Number of product from customer order already sent (partial shipping)
|
// Number of product from customer order already sent (partial shipping)
|
||||||
if (!empty($conf->expedition->enabled)) {
|
if (!empty($conf->expedition->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
|
||||||
|
$filterShipmentStatus = '';
|
||||||
|
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) {
|
||||||
|
$filterShipmentStatus = Expedition::STATUS_VALIDATED . ',' . Expedition::STATUS_CLOSED;
|
||||||
|
} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
|
||||||
|
$filterShipmentStatus = Expedition::STATUS_CLOSED;
|
||||||
|
}
|
||||||
if ($found) $helpondiff .= '<br>'; else $found = 1;
|
if ($found) $helpondiff .= '<br>'; else $found = 1;
|
||||||
$result = $object->load_stats_sending(0, '2', 1);
|
$result = $object->load_stats_sending(0, '2', 1, $filterShipmentStatus);
|
||||||
$helpondiff .= $langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty'];
|
$helpondiff .= $langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -864,7 +864,7 @@ if ($action == 'create')
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
|
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
@ -875,7 +875,7 @@ if ($action == 'create')
|
|||||||
if ($object->fetch_optionals() > 0) {
|
if ($object->fetch_optionals() > 0) {
|
||||||
$recept->array_options = array_merge($recept->array_options, $object->array_options);
|
$recept->array_options = array_merge($recept->array_options, $object->array_options);
|
||||||
}
|
}
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Incoterms
|
// Incoterms
|
||||||
|
|||||||
@ -1536,12 +1536,12 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign a sale representative
|
// Assign a sale representative
|
||||||
@ -2200,12 +2200,12 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Webservices url/key
|
// Webservices url/key
|
||||||
|
|||||||
@ -1244,11 +1244,11 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('colspan' => ' colspan="3"');
|
$parameters = array('colspan' => ' colspan="3"', 'cols' => 3);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
print $object->showOptionals($extrafields, 'edit');
|
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -809,7 +809,7 @@ table[summary="list_of_modules"] .fa-cog {
|
|||||||
|
|
||||||
.img-skinthumb {
|
.img-skinthumb {
|
||||||
width: 160px;
|
width: 160px;
|
||||||
height: 120px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2120,9 +2120,9 @@ img.login, img.printer, img.entity {
|
|||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
img.userphoto { /* size for user photo in lists */
|
img.userphoto { /* size for user photo in lists */
|
||||||
border-radius: 0.725em;
|
border-radius: 0.72em;
|
||||||
width: 1.45em;
|
width: 1.4em;
|
||||||
height: 1.45em;
|
height: 1.4em;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -968,6 +968,15 @@ table[summary="list_of_modules"] .fa-cog {
|
|||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.linkedcol-element {
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-skinthumb {
|
||||||
|
width: 160px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Styles to hide objects */
|
/* Styles to hide objects */
|
||||||
@ -1494,9 +1503,9 @@ div.nopadding {
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.noborder tr.liste_titre td {
|
/*table.noborder tr.liste_titre td {
|
||||||
padding: 3px !important;
|
padding: 3px !important;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
.containercenter {
|
.containercenter {
|
||||||
display : table;
|
display : table;
|
||||||
@ -2738,7 +2747,7 @@ div.colorback
|
|||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
table.liste, table.noborder, table.formdoc, div.noborder {
|
table.liste, table.noborder, table.formdoc, div.noborder {
|
||||||
width: calc(100% - 1px); /* -1 to fix a bug. Without, a scroll appears dur to overflow-x: auto; of div-tableèresponsive
|
width: calc(100% - 1px); /* -1 to fix a bug. Without, a scroll appears due to overflow-x: auto; of div-table-responsive */
|
||||||
|
|
||||||
border-collapse: separate !important;
|
border-collapse: separate !important;
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
@ -3020,6 +3029,9 @@ ul.noborder li:nth-child(odd):not(.liste_titre) {
|
|||||||
|
|
||||||
/* Set the color for hover lines */
|
/* Set the color for hover lines */
|
||||||
|
|
||||||
|
.tmenucompanylogo.nohover, .tmenucompanylogo.nohover:hover {
|
||||||
|
opacity: unset !important;
|
||||||
|
}
|
||||||
.nohoverborder:hover {
|
.nohoverborder:hover {
|
||||||
border: unset;
|
border: unset;
|
||||||
box-shadow: unset;
|
box-shadow: unset;
|
||||||
|
|||||||
@ -190,10 +190,9 @@ class Users extends DolibarrApi
|
|||||||
throw new RestException(404, 'User group not found');
|
throw new RestException(404, 'User group not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->useraccount = $this->_cleanObjectDatas($this->useraccount);
|
|
||||||
$this->useraccount->user_group_list = $this->_cleanUserGroupListDatas($userGroupList);
|
$this->useraccount->user_group_list = $this->_cleanUserGroupListDatas($userGroupList);
|
||||||
|
|
||||||
return $this->useraccount;
|
return $this->_cleanObjectDatas($this->useraccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -304,7 +304,7 @@ if ($action == 'create')
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters = array('object' => $object, 'colspan' => ' colspan="2"');
|
$parameters = array('object' => $object);
|
||||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
|
|||||||
@ -1398,7 +1398,7 @@ if ($action == 'updatemeta')
|
|||||||
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha');
|
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha');
|
||||||
$objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09');
|
$objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09');
|
||||||
$objectpage->htmlheader = trim(GETPOST('htmlheader', 'none'));
|
$objectpage->htmlheader = trim(GETPOST('htmlheader', 'none'));
|
||||||
$objectpage->fk_page = GETPOST('pageidfortranslation', 'int');
|
$objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0);
|
||||||
|
|
||||||
$newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int'));
|
$newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int'));
|
||||||
if ($newdatecreation) $objectpage->date_creation = $newdatecreation;
|
if ($newdatecreation) $objectpage->date_creation = $newdatecreation;
|
||||||
@ -3034,18 +3034,24 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
$num_rows = $db->num_rows($resql);
|
$num_rows = $db->num_rows($resql);
|
||||||
if ($num_rows > 0)
|
if ($num_rows > 0)
|
||||||
{
|
{
|
||||||
print '<span class="opacitymedium">'.$langs->trans('ThisPageHasTranslationPages').':</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans('ThisPageHasTranslationPages').':</span>';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$tmppage = new WebsitePage($db);
|
||||||
|
$tmpstring = '';
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$tmppage = new WebsitePage($db);
|
$result = $tmppage->fetch($obj->rowid);
|
||||||
$tmppage->fetch($obj->rowid);
|
if ($result > 0) {
|
||||||
if ($i > 0) print ' - ';
|
if ($i > 0) $tmpstring .= '<br>';
|
||||||
print $tmppage->getNomUrl(1).' ('.$tmppage->lang.')<br>';
|
$tmpstring .= $tmppage->getNomUrl(1).' ('.$tmppage->lang.')';
|
||||||
$translatedby++;
|
$translatedby++;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($i > 1) print '<br>';
|
||||||
|
else print ' ';
|
||||||
|
print $tmpstring;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
}
|
}
|
||||||
@ -3059,10 +3065,12 @@ if ($action == 'editmeta' || $action == 'createcontainer')
|
|||||||
}
|
}
|
||||||
elseif ($result > 0)
|
elseif ($result > 0)
|
||||||
{
|
{
|
||||||
$translationof = 0;
|
$translationof = $objectpage->fk_page;
|
||||||
//$translationof = $sourcepage->id;
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans('ThisPageIsTranslationOf').'</span> ';
|
print '<span class="opacitymedium">'.$langs->trans('ThisPageIsTranslationOf').'</span> ';
|
||||||
print $formwebsite->selectContainer($website, 'pageidfortranslation', $translationof, 1, $action, 'minwidth300');
|
print $formwebsite->selectContainer($website, 'pageidfortranslation', ($translationof ? $translationof : -1), 1, $action, 'minwidth300', array($objectpage->id));
|
||||||
|
if ($translationof > 0) {
|
||||||
|
print $sourcepage->getNomUrl(2).' ('.$sourcepage->lang.')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user