';
}
if ($line->date_start_fill) {
print '
'.$langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
@@ -180,7 +180,7 @@ if (($line->info_bits & 2) == 2) {
}
} else {
if ($line->date_start || $line->date_end) {
- print '
'.get_date_range($line->date_start, $line->date_end, $format).'
';
+ print '
'.get_date_range($line->date_start, $line->date_end, $format).'
';
}
//print get_date_range($line->date_start, $line->date_end, $format);
}
diff --git a/htdocs/datapolicy/admin/setupmail.php b/htdocs/datapolicy/admin/setupmail.php
index 2ec083b0fa8..535c4383d0d 100644
--- a/htdocs/datapolicy/admin/setupmail.php
+++ b/htdocs/datapolicy/admin/setupmail.php
@@ -160,7 +160,7 @@ print dol_get_fiche_end();
print '
';
print $langs->trans('SendAgreementText');
-print '
'.$langs->trans('SendAgreement').' ';
+print '
'.$langs->trans('SendAgreement').' ';
llxFooter();
$db->close();
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index 7d4a3b181e0..c72718ffce2 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -330,7 +330,7 @@ if ($action == 'create') { // Create. Seems to no be used
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1);
@@ -651,9 +651,9 @@ if ($action == 'create') { // Create. Seems to no be used
if ($user->rights->expedition->delivery->supprimer) {
if ($conf->expedition_bon->enabled) {
- print '
'.$langs->trans("Delete").' ';
+ print '
'.$langs->trans("Delete").' ';
} else {
- print '
'.$langs->trans("Delete").' ';
+ print '
'.$langs->trans("Delete").' ';
}
}
diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php
index d8b06285be4..c56effea73a 100644
--- a/htdocs/don/admin/donation.php
+++ b/htdocs/don/admin/donation.php
@@ -251,12 +251,12 @@ if (is_resource($handle)) {
print '';
} else {
print "
\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"), 'switch_on').' ';
print ' ';
}
} else {
print "
\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -267,7 +267,7 @@ if (is_resource($handle)) {
print '';
} else {
print "
";
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
print ' ';
}
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 2aa4b971e0f..528a640b391 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') {
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -876,7 +876,7 @@ if (!empty($id) && $action != 'edit') {
// Classify 'paid'
if ($object->statut == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->rights->don->creer) {
- print '
";
+ print '
";
}
// Delete
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 374306bc7b0..52e33a26cb4 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -132,7 +132,7 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
if ($action != 'classify') {
- // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/don/info.php b/htdocs/don/info.php
index 8d8f4065dda..431783e873a 100644
--- a/htdocs/don/info.php
+++ b/htdocs/don/info.php
@@ -82,7 +82,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
if ($action != 'classify') {
- // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index 13f9b1d4a96..9dca36bd1a0 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
if ($action != 'classify') {
- // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ // $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php
index 40cf0298895..363ef6d34ef 100644
--- a/htdocs/don/payment/card.php
+++ b/htdocs/don/payment/card.php
@@ -213,7 +213,7 @@ print '
';
if (empty($action)) {
if ($user->rights->don->supprimer) {
if (!$disable_delete) {
- print '
'.$langs->trans('Delete').' ';
+ print '
'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans('Delete').' ';
}
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 3c7af135922..54b1e6b6bb8 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -144,7 +144,6 @@ class EcmDirectory extends CommonObject
// Clean parameters
$this->label = dol_sanitizeFileName(trim($this->label));
- $this->fk_parent = trim($this->fk_parent);
$this->description = trim($this->description);
$this->date_c = $now;
$this->fk_user_c = $user->id;
@@ -155,7 +154,7 @@ class EcmDirectory extends CommonObject
// Check if same directory does not exists with this name
$relativepath = $this->label;
- if ($this->fk_parent) {
+ if ($this->fk_parent > 0) {
$parent = new EcmDirectory($this->db);
$parent->fetch($this->fk_parent);
$relativepath = $parent->getRelativePath().$relativepath;
@@ -194,11 +193,11 @@ class EcmDirectory extends CommonObject
$sql .= ") VALUES (";
$sql .= " '".$this->db->escape($this->label)."',";
$sql .= " '".$this->db->escape($conf->entity)."',";
- $sql .= " '".$this->db->escape($this->fk_parent)."',";
+ $sql .= " ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").",";
$sql .= " '".$this->db->escape($this->description)."',";
$sql .= " ".((int) $this->cachenbofdoc).",";
$sql .= " '".$this->db->idate($this->date_c)."',";
- $sql .= " '".$this->db->escape($this->fk_user_c)."'";
+ $sql .= " ".($this->fk_user_c > 0 ? ((int) $this->fk_user_c) : "null").",";
$sql .= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
@@ -249,20 +248,19 @@ class EcmDirectory extends CommonObject
// Clean parameters
$this->label = trim($this->label);
- $this->fk_parent = trim($this->fk_parent);
$this->description = trim($this->description);
-
- // Check parameters
- // Put here code to add control on parameters values
+ if ($this->fk_parent <= 0) {
+ $this->fk_parent = 0;
+ }
$this->db->begin();
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
- $sql .= " label='".$this->db->escape($this->label)."',";
- $sql .= " fk_parent='".$this->db->escape($this->fk_parent)."',";
- $sql .= " description='".$this->db->escape($this->description)."'";
- $sql .= " WHERE rowid=".((int) $this->id);
+ $sql .= " label = '".$this->db->escape($this->label)."',";
+ $sql .= " fk_parent = ".($this->fk_parent > 0 ? ((int) $this->fk_parent) : "null").",";
+ $sql .= " description = '".$this->db->escape($this->description)."'";
+ $sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index 74d7cc309b9..737d2134ccc 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -515,7 +515,7 @@ class EmailCollector extends CommonObject
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/admin/emailcollector_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/admin/emailcollector_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 1987a5300bd..328f3504497 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -106,8 +106,8 @@ class ConferenceOrBooth extends ActionComm
'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
- 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'),
+ 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'),
'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',),
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index f4a4933a899..1e76e3544e5 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -103,14 +103,15 @@ class ConferenceOrBoothAttendee extends CommonObject
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
- 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
- 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project'),
- 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
+ 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
+ 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
+ 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'),
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
- 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
- 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
+ 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,),
+ 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>3,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2),
@@ -126,6 +127,7 @@ class ConferenceOrBoothAttendee extends CommonObject
public $fk_actioncomm;
public $email;
public $date_subscription;
+ public $fk_invoice;
public $amount;
public $note_public;
public $note_private;
@@ -634,6 +636,31 @@ class ConferenceOrBoothAttendee extends CommonObject
}
}
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * Load the project with id $this->fk_project into this->project
+ *
+ * @return int <0 if KO, >=0 if OK
+ */
+ public function fetch_projet()
+ {
+ // phpcs:enable
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+
+ if (empty($this->fk_project) && !empty($this->fk_projet)) {
+ $this->fk_project = $this->fk_projet; // For backward compatibility
+ }
+ if (empty($this->fk_project)) {
+ return 0;
+ }
+
+ $project = new Project($this->db);
+ $result = $project->fetch($this->fk_project);
+
+ $this->projet = $project; // deprecated
+ $this->project = $project;
+ return $result;
+ }
/**
* Set draft status
@@ -736,7 +763,7 @@ class ConferenceOrBoothAttendee extends CommonObject
$label .= '
'.$langs->trans('DateOfRegistration').': '.dol_print_date($this->date_subscription, 'dayhour');
$label .= '
'.$langs->trans('AmountPaid').': '.$this->amount;
- $url = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
@@ -836,6 +863,17 @@ class ConferenceOrBoothAttendee extends CommonObject
return $result;
}
+ /**
+ * Return the label of the status
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
+ */
+ public function getLabelStatus($mode = 0)
+ {
+ return $this->LibStatut($this->status, $mode);
+ }
+
/**
* Return the label of the status
*
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index ec3e00c0dde..fafbd0a6f8b 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -152,8 +152,6 @@ if (empty($reshook)) {
/*
* View
- *
- * Put here all code to build page
*/
$form = new Form($db);
@@ -558,16 +556,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
// Send
if (empty($user->socid)) {
- print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&mode=init#formmailbeforetitle');
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
}
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.$withProjectUrl.'&action=edit&token='.newToken().'', '', $permissiontoadd);
// Clone
- print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.$withProjectUrl.'&action=delete&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print '
'."\n";
}
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index 9fc26503c44..3b135c21dc4 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -358,7 +358,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index 891fdc1da6e..7defb3dbf3c 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -55,6 +55,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
$id = GETPOST('id', 'int');
$projectid = GETPOST('projectid', 'int');
+$projectref = GETPOST('ref');
// Load variable for pagination
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
@@ -152,12 +153,12 @@ if (!$permissiontoread) accessforbidden();
* Actions
*/
-if (preg_match('/^set/', $action) && $projectid > 0 && !empty($user->rights->eventorganization->write)) {
+if (preg_match('/^set/', $action) && ($projectid > 0 || $projectref) && !empty($user->rights->eventorganization->write)) {
$project = new Project($db);
//If "set" fields keys is in projects fields
$project_attr=preg_replace('/^set/', '', $action);
if (array_key_exists($project_attr, $project->fields)) {
- $result = $project->fetch($projectid);
+ $result = $project->fetch($projectid, $projectref);
if ($result < 0) {
setEventMessages(null, $project->errors, 'errors');
} else {
@@ -234,11 +235,13 @@ $now = dol_now();
$help_url = '';
$title = $langs->trans('ListOfConferencesOrBooths');
-if ($projectid > 0) {
+if ($projectid > 0 || $projectref) {
$project = new Project($db);
- $result = $project->fetch($projectid);
+ $result = $project->fetch($projectid, $projectref);
if ($result < 0) {
setEventMessages(null, $project->errors, 'errors');
+ } else {
+ $projectid = $project->id;
}
$result = $project->fetch_thirdparty();
if ($result < 0) {
@@ -430,8 +433,8 @@ if ($projectid > 0) {
print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
//print '';
print '
';
- $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
+ $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.((int) $project->id);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print ' ';
@@ -447,8 +450,8 @@ if ($projectid > 0) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '';
print '
';
- $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$project->id.'&type=global';
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
+ $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.((int) $project->id).'&type=global';
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.((int) $project->id), 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print '
';
@@ -582,7 +585,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.((int) $id));
exit;
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index f10c0b694cb..1b4b5f62828 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -48,7 +48,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
$fk_project = GETPOST('fk_project', 'int');
-$withproject = GETPOST('withproject', 'int');
+$withproject = 1;
// Initialize technical objects
$object = new ConferenceOrBoothAttendee($db);
@@ -65,6 +65,7 @@ if ($conf_or_booth_id > 0) {
} else {
$object->fk_actioncomm = $confOrBooth->id;
$object->fk_project = $confOrBooth->fk_project;
+ $fk_project = $object->fk_project;
}
}
@@ -74,12 +75,24 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
-$search_all = GETPOST("search_all", 'alpha');
+$search_all = GETPOST('search_all', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
- if (GETPOST('search_'.$key, 'alpha')) {
+ if (GETPOST('search_'.$key, 'alpha') !== '') {
$search[$key] = GETPOST('search_'.$key, 'alpha');
}
+ if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
+ $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
+ $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
+ }
+}
+
+// List of fields to search into when doing a "search in all"
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val) {
+ if (!empty($val['searchall'])) {
+ $fieldstosearchall['t.'.$key] = $val['label'];
+ }
}
if (empty($action) && empty($id) && empty($ref)) {
@@ -174,8 +187,6 @@ if (empty($reshook)) {
/*
* View
- *
- * Put here all code to build page
*/
$form = new Form($db);
@@ -305,7 +316,7 @@ if (!empty($withproject)) {
print '
';
print '
';
- print '
';
+ print '';
// Description
print ''.$langs->trans("Description").' ';
@@ -319,7 +330,7 @@ if (!empty($withproject)) {
print " ";
}
- print '';
+ print ' ';
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
@@ -336,15 +347,15 @@ if (!empty($withproject)) {
print " ";
print '';
- print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print ' ';
- print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
print " ";
print '';
- print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print ' ';
- print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
print " ";
print ''.$langs->trans("EventOrganizationICSLink").' ';
@@ -353,7 +364,7 @@ if (!empty($withproject)) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
- $message = 'entity : "");
+ $message = ' entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').' ';
print $message;
@@ -366,7 +377,7 @@ if (!empty($withproject)) {
//print '';
print ' ';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print ' ';
@@ -383,7 +394,7 @@ if (!empty($withproject)) {
//print '';
print '
';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_register.php?id='.$projectstatic->id.'&type=global';
- $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print '
';
@@ -559,6 +570,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '
';
print '
'."\n";
+ $keyforbreak = 'note_public';
+
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
@@ -643,11 +656,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd);
// Clone
- print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print ''."\n";
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 6910973b8d3..19d35a4be0e 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -97,7 +97,7 @@ if (!$sortorder) {
}
// Initialize array of search criterias
-$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
+$search_all = GETPOST('search_all', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha') !== '') {
@@ -369,8 +369,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
}
-// Output page
-// --------------------------------------------------------------------
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
@@ -646,22 +644,25 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
foreach ($search as $key => $val) {
if (is_array($search[$key]) && count($search[$key])) {
foreach ($search[$key] as $skey) {
- $param .= '&search_'.$key.'[]='.urlencode($skey);
+ if ($skey != '') {
+ $param .= '&search_'.$key.'[]='.urlencode($skey);
+ }
}
- } else {
+ } elseif ($search[$key] != '') {
$param .= '&search_'.$key.'='.urlencode($search[$key]);
}
}
if ($confOrBooth->id > 0) {
- $param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl;
+ $param .= '&conforboothid='.urlencode($confOrBooth->id);
}
if ($projectstatic->id > 0) {
- $param .= '&fk_project='.urlencode($projectstatic->id).$withProjectUrl;
+ $param .= '&fk_project='.urlencode($projectstatic->id);
}
-
+$param .= $withProjectUrl;
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
+
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
@@ -694,6 +695,8 @@ print ' ';
print ' ';
print ' ';
print ' ';
+print ' ';
+print ' ';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd);
diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php
index fd72b1588e7..27071ebbae5 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_note.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_note.php
@@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
index f2bb6f0c3ae..732d3254203 100644
--- a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
@@ -54,7 +54,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
}
print '';
echo ''.$objectlink->getLibStatut(3).' ';
- echo 'id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
+ echo 'id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
echo '';
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 46e31740982..84d0cfd452d 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1690,7 +1690,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -2363,10 +2363,10 @@ if ($action == 'create') {
} elseif ($object->statut == Expedition::STATUS_DRAFT) {
// edit-delete buttons
print '';
- print 'id.'&action=editline&lineid='.$lines[$i]->id.'">'.img_edit().' ';
+ print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().' ';
print ' ';
print '';
- print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
+ print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
print ' ';
// Display lines extrafields
@@ -2442,9 +2442,9 @@ if ($action == 'create') {
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) {
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
- print 'id.'&action=reopen">'.$langs->trans("ClassifyUnbilled").' ';
+ print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").' ';
} else {
- print 'id.'&action=reopen">'.$langs->trans("ReOpen").' ';
+ print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").' ';
}
}
@@ -2489,13 +2489,13 @@ if ($action == 'create') {
// Cancel
if ($object->statut == Expedition::STATUS_VALIDATED) {
if ($user->rights->expedition->supprimer) {
- print 'id.'&action=cancel">'.$langs->trans("Cancel").' ';
+ print 'id.'&action=cancel&token='.newToken().'">'.$langs->trans("Cancel").' ';
}
}
// Delete
if ($user->rights->expedition->supprimer) {
- print 'id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
+ print 'id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
}
}
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index aea23298fcf..ac0c068bfc9 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index 43299dad066..ee0014a2f8d 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 9deb80c003a..391628a9d38 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -409,16 +409,16 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($sall) {
- $param .= "&sall=".urlencode($sall);
+ $param .= "&sall=".urlencode($sall);
}
if ($search_ref_exp) {
- $param .= "&search_ref_exp=".urlencode($search_ref_exp);
+ $param .= "&search_ref_exp=".urlencode($search_ref_exp);
}
if ($search_ref_liv) {
- $param .= "&search_ref_liv=".urlencode($search_ref_liv);
+ $param .= "&search_ref_liv=".urlencode($search_ref_liv);
}
if ($search_ref_customer) {
- $param .= "&search_ref_customer=".urlencode($search_ref_customer);
+ $param .= "&search_ref_customer=".urlencode($search_ref_customer);
}
if ($search_user > 0) {
$param .= '&search_user='.urlencode($search_user);
@@ -427,13 +427,13 @@ if ($search_sale > 0) {
$param .= '&search_sale='.urlencode($search_sale);
}
if ($search_company) {
- $param .= "&search_company=".urlencode($search_company);
+ $param .= "&search_company=".urlencode($search_company);
}
if ($search_shipping_method_id) {
$param .= "&search_shipping_method_id=".urlencode($search_shipping_method_id);
}
if ($search_tracking) {
- $param .= "&search_tracking=".urlencode($search_tracking);
+ $param .= "&search_tracking=".urlencode($search_tracking);
}
if ($search_town) {
$param .= '&search_town='.urlencode($search_town);
@@ -789,7 +789,7 @@ while ($i < min($num, $limit)) {
// Ref
if (!empty($arrayfields['e.ref']['checked'])) {
- print "";
+ print ' ';
print $shipment->getNomUrl(1);
print " \n";
if (!$i) {
@@ -809,7 +809,7 @@ while ($i < min($num, $limit)) {
// Third party
if (!empty($arrayfields['s.nom']['checked'])) {
- print '';
+ print ' ';
print $companystatic->getNomUrl(1);
print ' ';
if (!$i) {
@@ -827,7 +827,7 @@ while ($i < min($num, $limit)) {
}
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
- print '';
+ print ' ';
print $obj->zip;
print ' ';
if (!$i) {
@@ -836,7 +836,7 @@ while ($i < min($num, $limit)) {
}
// State
if (!empty($arrayfields['state.nom']['checked'])) {
- print "".$obj->state_name." \n";
+ print ''.$obj->state_name." \n";
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 5ebc54193da..f7217ed2e0a 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -115,7 +115,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index e9f79e2ef12..f543b8baee4 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -293,7 +293,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 191eb6a0458..9941139ea19 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1646,7 +1646,7 @@ if ($action == 'create') {
if ($user->rights->commande->creer)
{
if ($action != 'classify')
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.=''."\n";
+print ' '."\n";
print ' ';
+print ' ';
+print ' ';
+print ' ';
print load_fiche_titre($langs->trans("CommentsOfVoters"), '', '');
@@ -391,7 +407,7 @@ $comments = $object->getComments();
if ($comments) {
foreach ($comments as $comment) {
if ($user->rights->opensurvey->write) {
- print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' ';
+ print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', '', 0).' ';
}
print dol_htmlentities($comment->usercomment).': '.dol_nl2br(dol_htmlentities($comment->comment))." ";
@@ -407,10 +423,7 @@ if ($object->allow_comments) {
print $langs->trans("AddACommentForPoll").' ';
print ' '."\n";
print $langs->trans("Name").': '."\n";
- print ' '."\n";
- if (isset($erreur_commentaire_vide) && $erreur_commentaire_vide == "yes") {
- print "".$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))." ";
- }
+ print ' '."\n";
}
print ' ';
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index ff5198c006a..d03cbca69c5 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -455,20 +455,21 @@ dol_banner_tab($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage', $morehtm
print '';
-print '
';
+print '
';
+print '
';
print '
';
// Type
$type = ($object->format == "A") ? 'classic' : 'date';
-print ''.$langs->trans("Type").' ';
+print ' '.$langs->trans("Type").' ';
print img_picto('', dol_buildpath('/opensurvey/img/'.($type == 'classic' ? 'chart-32.png' : 'calendar-32.png'), 1), 'width="16"', 1);
print ' '.$langs->trans($type == 'classic' ? "TypeClassic" : "TypeDate").' ';
// Title
print '';
$adresseadmin = $object->mail_admin;
-print $langs->trans("Title").' ';
+print $langs->trans("Title").' ';
if ($action == 'edit') {
print ' ';
} else {
@@ -476,8 +477,39 @@ if ($action == 'edit') {
}
print ' ';
+// Description
+print ''.$langs->trans("Description").' ';
+if ($action == 'edit') {
+ $doleditor = new DolEditor('nouveauxcommentaires', $object->description, '', 120, 'dolibarr_notes', 'In', 1, 1, 1, ROWS_7, '90%');
+ $doleditor->Create(0, '');
+} else {
+ print (dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true));
+}
+print ' ';
+
+// EMail
+//If linked user, then emails are going to be sent to users' email
+if (!$object->fk_user_creat) {
+ print ''.$langs->trans("EMail").' ';
+ if ($action == 'edit') {
+ print ' ';
+ } else {
+ print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1);
+ }
+ print ' ';
+}
+
+print '
';
+
+print '
';
+print '
';
+print '
';
+
+print '
';
+
+
// Expire date
-print ''.$langs->trans('ExpireDate').' ';
+print ' '.$langs->trans('ExpireDate').' ';
if ($action == 'edit') {
print $form->selectDate($expiredate ? $expiredate : $object->date_fin, 'expire', 0, 0, 0, '', 1, 0);
} else {
@@ -490,7 +522,7 @@ print ' ';
// Author
print '';
-print $langs->trans("Author").' ';
+print $langs->trans("Author").' ';
if ($object->fk_user_creat) {
print $userstatic->getLoginUrl(1);
} else {
@@ -499,7 +531,7 @@ if ($object->fk_user_creat) {
print ' ';
// Link
-print ''.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
+print ' '.img_picto('', 'globe').' '.$langs->trans("UrlForSurvey", '').' ';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
@@ -521,8 +553,10 @@ if ($action != 'edit') {
print ' ';
print '
';
+print '
';
print '
';
+print '
';
print dol_get_fiche_end();
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index 6458c9ab71c..f40b771b34d 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -121,6 +121,7 @@ class Partnership extends CommonObject
'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>63, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',),
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-2,),
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,),
+ // fk_member and fk_soc are added into constructor
);
/**
@@ -197,9 +198,9 @@ class Partnership extends CommonObject
$this->db = $db;
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
- $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member');
+ $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150');
} else {
- $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company');
+ $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'csslist'=>'tdoverflowmax150');
}
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
@@ -951,7 +952,7 @@ class Partnership extends CommonObject
$label .= ' ';
$label .= ''.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/partnership/partnership_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php
index 799aadd24cd..f154e1b9f5b 100644
--- a/htdocs/partnership/partnership_agenda.php
+++ b/htdocs/partnership/partnership_agenda.php
@@ -154,7 +154,7 @@ if ($object->id > 0) {
$morehtmlref.=' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
}
$morehtmlref.=' : ';
if ($action == 'classify') {
diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php
index bf980ab9cda..db637136cad 100644
--- a/htdocs/partnership/partnership_card.php
+++ b/htdocs/partnership/partnership_card.php
@@ -412,7 +412,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -643,14 +643,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
- $morehtmlright = '';
+ $morehtmlright = ' ';
$morehtmlright .= $langs->trans("SeeAll");
$morehtmlright .= ' ';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright);
print '';
}
diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php
index 1c416cf690c..a4a61c6e907 100644
--- a/htdocs/partnership/partnership_contact.php
+++ b/htdocs/partnership/partnership_contact.php
@@ -140,7 +140,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php
index e7fae7ee7ff..79b7be0057a 100644
--- a/htdocs/partnership/partnership_document.php
+++ b/htdocs/partnership/partnership_document.php
@@ -137,7 +137,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php
index cc97eac5515..67f963b155e 100644
--- a/htdocs/partnership/partnership_note.php
+++ b/htdocs/partnership/partnership_note.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php
index 2b86efa507c..a0849f082e8 100644
--- a/htdocs/printing/admin/printing.php
+++ b/htdocs/printing/admin/printing.php
@@ -274,13 +274,13 @@ if ($mode == 'config' && $user->admin) {
print ajax_constantonoff($printer->active);
} else {
if (empty($conf->global->{$printer->conf})) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
- print ''.img_picto('', 'setup').' ';
- print ''.img_picto('', 'setup').' ';
+ print ''.img_picto('', 'setup').' ';
+ print ''.img_picto('', 'setup').' ';
print ''."\n";
}
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index fa75a20277f..4f6094e1787 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -346,7 +346,7 @@ foreach ($dirproduct as $dirroot) {
}
print '';
if (!$disabled) {
- print '';
+ print ' ';
}
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) {
@@ -448,13 +448,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ' '."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -463,7 +463,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PRODUCT_ADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -762,10 +762,10 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
if ($conf->global->$const) {
print img_picto($langs->trans("Active"), 'tick');
print '';
- print ''.$langs->trans("Disable").' ';
+ print ''.$langs->trans("Disable").' ';
} else {
print ' ';
- print ''.$langs->trans("Activate").' ';
+ print ''.$langs->trans("Activate").' ';
}
print ' ';
diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php
index 3f4fd636de4..24f515fa0bc 100644
--- a/htdocs/product/admin/product_lot.php
+++ b/htdocs/product/admin/product_lot.php
@@ -161,7 +161,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($conf->global->PRODUCTBATCH_LOT_ADDON == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -253,7 +253,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($conf->global->PRODUCTBATCH_SN_ADDON == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 23fc0077c97..b6820bddddd 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -481,7 +481,7 @@ if (empty($reshook)) {
$object->setCategories($categories);
if (!empty($backtopage)) {
- $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation
+ $backtopage = preg_replace('/__ID__/', $object->id, $backtopage); // New method to autoselect project after a New on another form object creation
if (preg_match('/\?/', $backtopage)) {
$backtopage .= '&socid='.$object->id; // Old method
}
@@ -2525,7 +2525,7 @@ if ($action != 'create' && $action != 'edit') {
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
print ''.$langs->trans('Delete').' '."\n";
} else {
- print 'id.'">'.$langs->trans("Delete").' ';
+ print 'id.'">'.$langs->trans("Delete").' ';
}
} else {
print ''.$langs->trans("Delete").' ';
diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php
index 418a71166a8..784be41dfe9 100644
--- a/htdocs/product/dynamic_price/editor.php
+++ b/htdocs/product/dynamic_price/editor.php
@@ -190,7 +190,7 @@ print ''.$langs->trans("Back").' ';
if ($eid == 0) {
print ''.$langs->trans('Delete').'
'."\n";
} else {
- print '';
+ print '';
}
print '';
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 539456351cb..ee39486fb5b 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -315,7 +315,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($action != 'classify')
{
- $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref .= '';
@@ -462,7 +462,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'inventory', 0, 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, 0, 1, '', $MAXEVENT, '', $morehtmlright);
print '';
}
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index 1147869a716..2ebde580db7 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -399,7 +399,7 @@ if ($object->id > 0) {
{
if ($action != 'classify')
{
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.=' ';
@@ -748,7 +748,7 @@ if ($object->id > 0) {
print $warehouse_static->getNomUrl(1);
print '';
print '';
- print $product_static->getNomUrl(1);
+ print $product_static->getNomUrl(1).' - '.$product_static->label;
print ' ';
if ($conf->productbatch->enabled) {
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index e21d17d823f..ecdddba712c 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -953,9 +953,9 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print ''.price($prices['remise_percent']).' % ';
print '';
if (($user->rights->produit->creer || $user->rights->service->creer)) {
- print 'id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
print img_edit().' ';
- print 'id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
print img_delete().' ';
} else {
print ' ';
@@ -1106,9 +1106,9 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print ' '.price($prices['remise_percent']).' % ';
print '';
if (($user->rights->produit->creer || $user->rights->service->creer)) {
- print 'id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=edit_price_by_qty&rowid='.$prices["rowid"].'">';
print img_edit().' ';
- print 'id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
+ print ' id.'&action=delete_price_by_qty&token='.newToken().'&rowid='.$prices["rowid"].'">';
print img_delete().' ';
} else {
print ' ';
@@ -1638,7 +1638,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
print ' ';
if ($candelete || ($db->jdate($objp->dp) >= dol_now())) { // Test on date is to be able to delete a corrupted record with a date in future
- print 'id.'&lineid='.$objp->rowid.'">';
+ print ' id.'&lineid='.$objp->rowid.'">';
print img_delete();
print ' ';
} else {
@@ -2193,11 +2193,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print img_info($langs->trans('PriceByCustomerLog'));
print '';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_edit('default', 0, 'style="vertical-align: middle;"');
print ' ';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_delete('default', 'style="vertical-align: middle;"');
print ' ';
print ' ';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index fc394d6203a..529c0205d32 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -434,7 +434,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index 9fc4e81075a..36897c7aef0 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -64,7 +64,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index da8ef2e5b37..af6d6c08740 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -632,7 +632,7 @@ foreach ($listofdata as $key => $val) {
print '';
}
print ''.$val['qty'].' ';
- print ''.img_delete($langs->trans("Remove")).' ';
+ print ''.img_delete($langs->trans("Remove")).' ';
print '';
}
}
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 161eec99047..6601edd5e10 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -654,7 +654,7 @@ if ($object->id > 0) {
$morehtmlref .= ' '.img_picto('', 'project').' '.$langs->trans('Project').' ';
if ($usercancreate && 1 == 2) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
$projectid = $object->fk_project;
@@ -864,6 +864,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
+ 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
// 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 7a75019c8d1..36e230b911d 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -532,12 +532,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
/*TODO if ($user->rights->stock->lire)
{
- print ''."\n";
+ print ''."\n";
}
if ($user->rights->stock->supprimer)
{
- print ''."\n";
+ print ''."\n";
}
*/
}
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index eaea44dd22b..adef0826992 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROJECT_ADDON == 'mod_'.$classname) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -443,7 +443,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if ($conf->global->PROJECT_TASK_ADDON == 'mod_'.$classname) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -564,13 +564,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir).'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print " ";
} else {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -579,7 +579,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROJECT_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -704,13 +704,13 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
// Active
if (in_array($name, $def)) {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir).'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print " ";
} else {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -719,7 +719,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
if ($conf->global->PROJECT_TASK_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 12b6d8f32df..21b49b9447e 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1281,7 +1281,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Reopen
if ($object->statut == Project::STATUS_CLOSED && $user->rights->projet->creer) {
if ($userWrite > 0) {
- print ''.$langs->trans("ReOpen").' ';
+ print ''.$langs->trans("ReOpen").' ';
} else {
print ''.$langs->trans('ReOpen').' ';
}
@@ -1343,7 +1343,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Delete
if ($user->rights->projet->supprimer || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->rights->projet->creer)) {
- print ''.$langs->trans("Delete").' ';
+ print ''.$langs->trans("Delete").' ';
} else {
print ''.$langs->trans('Delete').' ';
}
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index aa9d9a8a437..6f670af2bb6 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -223,7 +223,7 @@ if ($resql) {
print '';
print '
';
print '';
- print ''.$langs->trans("LatestModifiedProjects", $max).' ';
+ print ''.$langs->trans("LatestModifiedProjects", $max).' ';
print ' ';
$num = $db->num_rows($resql);
@@ -277,12 +277,22 @@ if ($resql) {
print '';
+ // Label
+ print '';
+ print $projectstatic->title;
+ print ' ';
+
+ // Thirdparty
print '';
if ($companystatic->id > 0) {
print $companystatic->getNomUrl(1, 'company', 16);
}
print ' ';
+
+ // Date
print ''.dol_print_date($db->jdate($obj->datem), 'day').' ';
+
+ // Status
print ''.$projectstatic->LibStatut($obj->status, 3).' ';
print '';
$i++;
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index aaa8bd0cd89..76c5239fc17 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -47,13 +47,6 @@ $withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskcommentcard', 'globalcard'));
@@ -79,10 +72,21 @@ if (!empty($project_ref) && !empty($withproject)) {
}
}
+
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* View
-*/
-
+ */
llxHeader('', $langs->trans("CommentPage"));
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index f693d0bf94a..d79406d2d14 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -40,17 +40,18 @@ $confirm = GETPOST('confirm', 'alpha');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-//$result = restrictedArea($user, 'projet', $id, 'projet_task');
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
$object = new Task($db);
$projectstatic = new Project($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
/*
* Actions
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index d9c49001dfc..3a56a7a018a 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -37,21 +37,13 @@ $langs->loadLangs(array('projects', 'other'));
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = GETPOST('mode') == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-//$result=restrictedArea($user,'projet',$id,'');
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -73,6 +65,17 @@ if (!$sortfield) {
$object = new Task($db);
$projectstatic = new Project($db);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* Actions
*/
@@ -92,25 +95,21 @@ if (!empty($project_ref) && !empty($withproject)) {
}
if ($id > 0 || !empty($ref)) {
- if ($object->fetch($id, $ref) > 0) {
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
- $object->fetchComments();
- }
- $projectstatic->fetch($object->fk_project);
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
- $projectstatic->fetchComments();
- }
-
- if (!empty($projectstatic->socid)) {
- $projectstatic->fetch_thirdparty();
- }
-
- $object->project = clone $projectstatic;
-
- $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
- } else {
- dol_print_error($db);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
+ $object->fetchComments();
}
+ $projectstatic->fetch($object->fk_project);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+ }
+
+ if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+ }
+
+ $object->project = clone $projectstatic;
+
+ $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
}
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index f1fc0c31524..21be9b6d5c4 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -31,7 +31,7 @@ $langs->load('projects');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
-$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0;
+$mine = GETPOST('mode') == 'mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@@ -85,6 +85,12 @@ if (!empty($project_ref) && !empty($withproject)) {
}
}
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
$permissionnote = ($user->rights->projet->creer || $user->rights->projet->all->creer);
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 99b390870a8..2ae9bb7cc80 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -46,13 +46,6 @@ $withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
-// Security check
-$socid = 0;
-//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
-if (!$user->rights->projet->lire) {
- accessforbidden();
-}
-
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('projecttaskcard', 'globalcard'));
@@ -69,6 +62,17 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+// Security check
+$socid = 0;
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
+
/*
* Actions
*/
@@ -85,7 +89,6 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
}
if (!$error) {
- $object->fetch($id, $ref);
$object->oldcopy = clone $object;
$tmparray = explode('_', $_POST['task_parent']);
@@ -121,17 +124,15 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
}
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) {
- if ($object->fetch($id, $ref) >= 0) {
- $result = $projectstatic->fetch($object->fk_project);
- $projectstatic->fetch_thirdparty();
+ $result = $projectstatic->fetch($object->fk_project);
+ $projectstatic->fetch_thirdparty();
- if ($object->delete($user) > 0) {
- header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
- exit;
- } else {
- setEventMessages($object->error, $object->errors, 'errors');
- $action = '';
- }
+ if ($object->delete($user) > 0) {
+ header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?restore_lastsearch_values=1&id='.$projectstatic->id.($withproject ? '&withproject=1' : ''));
+ exit;
+ } else {
+ setEventMessages($object->error, $object->errors, 'errors');
+ $action = '';
}
}
@@ -149,8 +150,6 @@ if (!empty($project_ref) && !empty($withproject)) {
// Build doc
if ($action == 'builddoc' && $user->rights->projet->creer) {
- $object->fetch($id, $ref);
-
// Save last template used to generate document
if (GETPOST('model')) {
$object->setDocModel($user, GETPOST('model', 'alpha'));
@@ -172,17 +171,15 @@ if ($action == 'builddoc' && $user->rights->projet->creer) {
if ($action == 'remove_file' && $user->rights->projet->creer) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- if ($object->fetch($id, $ref) >= 0) {
- $langs->load("other");
- $upload_dir = $conf->projet->dir_output;
- $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
+ $langs->load("other");
+ $upload_dir = $conf->projet->dir_output;
+ $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
- $ret = dol_delete_file($file);
- if ($ret) {
- setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- } else {
- setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
- }
+ $ret = dol_delete_file($file);
+ if ($ret) {
+ setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
+ } else {
+ setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
}
@@ -198,449 +195,447 @@ $formother = new FormOther($db);
$formfile = new FormFile($db);
if ($id > 0 || !empty($ref)) {
- if ($object->fetch($id, $ref) > 0) {
- $res = $object->fetch_optionals();
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
- $object->fetchComments();
+ $res = $object->fetch_optionals();
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) {
+ $object->fetchComments();
+ }
+
+ $result = $projectstatic->fetch($object->fk_project);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+ }
+ if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+ }
+
+ $object->project = clone $projectstatic;
+
+ //$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
+
+ if (!empty($withproject)) {
+ // Tabs for project
+ $tab = 'tasks';
+ $head = project_prepare_head($projectstatic);
+ print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
+
+ $param = ($mode == 'mine' ? '&mode=mine' : '');
+
+ // Project card
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref = '';
+ // Title
+ $morehtmlref .= $projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0) {
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref .= '
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (!$user->rights->projet->all->lire) {
+ $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
}
- $result = $projectstatic->fetch($object->fk_project);
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
- $projectstatic->fetchComments();
- }
- if (!empty($projectstatic->socid)) {
- $projectstatic->fetch_thirdparty();
- }
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
- $object->project = clone $projectstatic;
+ print '';
+ print '
';
+ print '
';
- //$userWrite = $projectstatic->restrictedProjectArea($user, 'write');
+ print '
';
- if (!empty($withproject)) {
- // Tabs for project
- $tab = 'tasks';
- $head = project_prepare_head($projectstatic);
- print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
-
- $param = ($mode == 'mine' ? '&mode=mine' : '');
-
- // Project card
-
- $linkback = ''.$langs->trans("BackToList").' ';
-
- $morehtmlref = '';
- // Title
- $morehtmlref .= $projectstatic->title;
- // Thirdparty
- if ($projectstatic->thirdparty->id > 0) {
- $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ // Usage
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
+ print '
';
+ print $langs->trans("Usage");
+ print ' ';
+ print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' ';
}
- $morehtmlref .= '';
-
- // Define a complementary filter for search of next/prev ref.
- if (!$user->rights->projet->all->lire) {
- $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
- $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ print ' usage_task ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowTasks");
+ print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
+ print ' ';
}
-
- dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
- print '';
- print '
';
- print '
';
-
- print '
';
-
- // Usage
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
- print '';
- print $langs->trans("Usage");
- print ' ';
- print '';
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
- print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowOpportunity");
- print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
- print ' ';
- }
- if (empty($conf->global->PROJECT_HIDE_TASKS)) {
- print ' usage_task ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectFollowTasks");
- print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
- print ' ';
- }
- if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
- print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("ProjectBillTimeDescription");
- print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
- print ' ';
- }
- if (!empty($conf->eventorganization->enabled)) {
- print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
- $htmltext = $langs->trans("EventOrganizationDescriptionLong");
- print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
- }
- print ' ';
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
+ print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectBillTimeDescription");
+ print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
+ print ' ';
}
-
- // Visibility
- print ''.$langs->trans("Visibility").' ';
- if ($projectstatic->public) {
- print $langs->trans('SharedProject');
- } else {
- print $langs->trans('PrivateProject');
+ if (!empty($conf->eventorganization->enabled)) {
+ print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("EventOrganizationDescriptionLong");
+ print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
}
print ' ';
-
- // Date start - end
- print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
- $start = dol_print_date($projectstatic->date_start, 'day');
- print ($start ? $start : '?');
- $end = dol_print_date($projectstatic->date_end, 'day');
- print ' - ';
- print ($end ? $end : '?');
- if ($projectstatic->hasDelay()) {
- print img_warning("Late");
- }
- print ' ';
-
- // Budget
- print ''.$langs->trans("Budget").' ';
- if (strcmp($projectstatic->budget_amount, '')) {
- print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
- }
- print ' ';
-
- // Other attributes
- $cols = 2;
- //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
-
- print '
';
-
- print '
';
-
- print '
';
- print '
';
- print '
';
-
- print '
';
-
- // Description
- print ''.$langs->trans("Description").' ';
- print nl2br($projectstatic->description);
- print ' ';
-
- // Categories
- if ($conf->categorie->enabled) {
- print ''.$langs->trans("Categories").' ';
- print $form->showCategories($projectstatic->id, 'project', 1);
- print " ";
- }
-
- print '
';
-
- print '
';
- print '
';
- print '
';
-
- print '
';
-
- print dol_get_fiche_end();
-
- print ' ';
}
- /*
- * Actions
- */
- /*print '';
+ // Visibility
+ print '
'.$langs->trans("Visibility").' ';
+ if ($projectstatic->public) {
+ print $langs->trans('SharedProject');
+ } else {
+ print $langs->trans('PrivateProject');
+ }
+ print ' ';
- if ($user->rights->projet->all->creer || $user->rights->projet->creer)
- {
- if ($projectstatic->public || $userWrite > 0)
- {
- print '
'.$langs->trans('AddTask').' ';
+ // Date start - end
+ print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
+ $start = dol_print_date($projectstatic->date_start, 'day');
+ print ($start ? $start : '?');
+ $end = dol_print_date($projectstatic->date_end, 'day');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($projectstatic->hasDelay()) {
+ print img_warning("Late");
}
- else
- {
- print ''.$langs->trans('AddTask').' ';
- }
- }
- else
- {
- print ''.$langs->trans('AddTask').' ';
+ print ' ';
+
+ // Budget
+ print '
'.$langs->trans("Budget").' ';
+ if (strcmp($projectstatic->budget_amount, '')) {
+ print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
}
+ print ' ';
+
+ // Other attributes
+ $cols = 2;
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
print '
';
- */
- // To verify role of users
- //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
- //$arrayofuseridoftask=$object->getListContactId('internal');
+ print '
';
+ print '
';
+ print '
';
- $head = task_prepare_head($object);
+ print '
';
- if ($action == 'edit' && $user->rights->projet->creer) {
- print '';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($projectstatic->description);
+ print ' ';
- print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
+ // Categories
+ if ($conf->categorie->enabled) {
+ print ''.$langs->trans("Categories").' ';
+ print $form->showCategories($projectstatic->id, 'project', 1);
+ print " ";
+ }
- print '';
- // Ref
- print ''.$langs->trans("Ref").' ';
- print ' ';
+ print '';
+ print '';
+ print '';
- // Label
- print ''.$langs->trans("Label").' ';
- print ' ';
+ print '
';
- // Project
- if (empty($withproject)) {
- print ''.$langs->trans("Project").' ';
- print $projectstatic->getNomUrl(1);
- print ' ';
+ print dol_get_fiche_end();
- // Third party
- print ''.$langs->trans("ThirdParty").' ';
- if ($projectstatic->societe->id) {
- print $projectstatic->societe->getNomUrl(1);
- } else {
- print ' ';
- }
- print ' ';
+ print ' ';
+ }
+
+ /*
+ * Actions
+ */
+ /*print '';
+ */
+
+ // To verify role of users
+ //$userAccess = $projectstatic->restrictedProjectArea($user); // We allow task affected to user even if a not allowed project
+ //$arrayofuseridoftask=$object->getListContactId('internal');
+
+ $head = task_prepare_head($object);
+
+ if ($action == 'edit' && $user->rights->projet->creer) {
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+
+ print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', '');
+
+ print '';
+
+ // Ref
+ print ''.$langs->trans("Ref").' ';
+ print ' ';
+
+ // Label
+ print ''.$langs->trans("Label").' ';
+ print ' ';
+
+ // Project
+ if (empty($withproject)) {
+ print ''.$langs->trans("Project").' ';
+ print $projectstatic->getNomUrl(1);
+ print ' ';
+
+ // Third party
+ print ''.$langs->trans("ThirdParty").' ';
+ if ($projectstatic->societe->id) {
+ print $projectstatic->societe->getNomUrl(1);
+ } else {
+ print ' ';
}
-
- // Task parent
- print ' '.$langs->trans("ChildOfProjectTask").' ';
- print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
print ' ';
+ }
- // Date start
- print ''.$langs->trans("DateStart").' ';
- print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
- print ' ';
+ // Task parent
+ print ''.$langs->trans("ChildOfProjectTask").' ';
+ print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
+ print ' ';
- // Date end
- print ''.$langs->trans("Deadline").' ';
- print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
- print ' ';
+ // Date start
+ print ''.$langs->trans("DateStart").' ';
+ print $form->selectDate($object->date_start, 'dateo', 1, 1, 0, '', 1, 0);
+ print ' ';
- // Planned workload
- print ''.$langs->trans("PlannedWorkload").' ';
- print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
- print ' ';
+ // Date end
+ print ''.$langs->trans("Deadline").' ';
+ print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0);
+ print ' ';
- // Progress declared
- print ''.$langs->trans("ProgressDeclared").' ';
- print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
- print ' ';
+ // Planned workload
+ print ''.$langs->trans("PlannedWorkload").' ';
+ print $form->select_duration('planned_workload', $object->planned_workload, 0, 'text');
+ print ' ';
- // Description
- print ''.$langs->trans("Description").' ';
- print '';
- print ''.$object->description.' ';
- print ' ';
+ // Progress declared
+ print ''.$langs->trans("ProgressDeclared").' ';
+ print $formother->select_percent($object->progress, 'progress', 0, 5, 0, 100, 1);
+ print ' ';
- // Other options
- $parameters = array();
- $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- print $hookmanager->resPrint;
- if (empty($reshook)) {
- print $object->showOptionals($extrafields, 'edit');
- }
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print '';
+ print ''.$object->description.' ';
+ print ' ';
- print '
';
+ // Other options
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (empty($reshook)) {
+ print $object->showOptionals($extrafields, 'edit');
+ }
- print dol_get_fiche_end();
+ print '
';
- print $form->buttonsSaveCancel("Modify");
+ print dol_get_fiche_end();
- print '';
+ print $form->buttonsSaveCancel("Modify");
+
+ print '';
+ } else {
+ /*
+ * Fiche tache en mode visu
+ */
+ $param = ($withproject ? '&withproject=1' : '');
+ $linkback = $withproject ? '
'.$langs->trans("BackToList").' ' : '';
+
+ print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
+
+ if ($action == 'delete') {
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
+ }
+
+ if (!GETPOST('withproject') || empty($projectstatic->id)) {
+ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
+ $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
} else {
- /*
- * Fiche tache en mode visu
- */
- $param = ($withproject ? '&withproject=1' : '');
- $linkback = $withproject ? '
'.$langs->trans("BackToList").' ' : '';
-
- print dol_get_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition');
-
- if ($action == 'delete') {
- print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".GETPOST("id", 'int').'&withproject='.$withproject, $langs->trans("DeleteATask"), $langs->trans("ConfirmDeleteATask"), "confirm_delete");
- }
-
- if (!GETPOST('withproject') || empty($projectstatic->id)) {
- $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
- $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")";
- } else {
- $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
- }
-
- $morehtmlref = '';
-
- // Project
- if (empty($withproject)) {
- $morehtmlref .= '
';
- $morehtmlref .= $langs->trans("Project").': ';
- $morehtmlref .= $projectstatic->getNomUrl(1);
- $morehtmlref .= ' ';
-
- // Third party
- $morehtmlref .= $langs->trans("ThirdParty").': ';
- if (!empty($projectstatic->thirdparty)) {
- $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
- }
- $morehtmlref .= '
';
- }
-
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
-
- print '
';
- print '
';
-
- print '
';
- print '
';
-
- // Task parent
- print ''.$langs->trans("ChildOfTask").' ';
- if ($object->fk_task_parent > 0) {
- $tasktmp = new Task($db);
- $tasktmp->fetch($object->fk_task_parent);
- print $tasktmp->getNomUrl(1);
- }
- print ' ';
-
- // Date start - Date end
- print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").' ';
- $start = dol_print_date($object->date_start, 'dayhour');
- print ($start ? $start : '?');
- $end = dol_print_date($object->date_end, 'dayhour');
- print ' - ';
- print ($end ? $end : '?');
- if ($object->hasDelay()) {
- print img_warning("Late");
- }
- print ' ';
-
- // Planned workload
- print ''.$langs->trans("PlannedWorkload").' ';
- if ($object->planned_workload != '') {
- print convertSecondToTime($object->planned_workload, 'allhourmin');
- }
- print ' ';
-
- // Description
- print ''.$langs->trans("Description").' ';
- print nl2br($object->description);
- print ' ';
-
- print '
';
- print '
';
-
- print '
';
-
- print '
';
- print '
';
-
- // Progress declared
- print ''.$langs->trans("ProgressDeclared").' ';
- if ($object->progress != '') {
- print $object->progress.' %';
- }
- print ' ';
-
- // Progress calculated
- print ''.$langs->trans("ProgressCalculated").' ';
- if ($object->planned_workload != '') {
- $tmparray = $object->getSummaryOfTimeSpent();
- if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
- print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
- } else {
- print '0 %';
- }
- } else {
- print ''.$langs->trans("WorkloadNotDefined").' ';
- }
- print ' ';
-
- // Other attributes
- $cols = 3;
- $parameters = array('socid'=>$socid);
- include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
-
- print '
';
-
- print '
';
- print '
';
-
- print '
';
- print '
';
-
- print dol_get_fiche_end();
+ $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id);
}
+ $morehtmlref = '';
- if ($action != 'edit') {
- /*
- * Actions
- */
+ // Project
+ if (empty($withproject)) {
+ $morehtmlref .= '
';
+ $morehtmlref .= $langs->trans("Project").': ';
+ $morehtmlref .= $projectstatic->getNomUrl(1);
+ $morehtmlref .= '
';
- print '
';
+ // Third party
+ $morehtmlref .= $langs->trans("ThirdParty").': ';
+ if (!empty($projectstatic->thirdparty)) {
+ $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1);
+ }
+ $morehtmlref .= '
';
+ }
- $parameters = array();
- $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
- // modified by hook
- if (empty($reshook)) {
- // Modify
- if ($user->rights->projet->creer) {
- print '
'.$langs->trans('Modify').' ';
- } else {
- print '
'.$langs->trans('Modify').' ';
- }
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
- // Delete
- if ($user->rights->projet->supprimer) {
- if (!$object->hasChildren() && !$object->hasTimeSpent()) {
- print '
'.$langs->trans('Delete').' ';
- } else {
- print '
'.$langs->trans('Delete').' ';
- }
- } else {
- print '
'.$langs->trans('Delete').' ';
- }
+ print '
';
+ print '
';
- print '
';
+ print '
';
+ print '
';
+
+ // Task parent
+ print ''.$langs->trans("ChildOfTask").' ';
+ if ($object->fk_task_parent > 0) {
+ $tasktmp = new Task($db);
+ $tasktmp->fetch($object->fk_task_parent);
+ print $tasktmp->getNomUrl(1);
+ }
+ print ' ';
+
+ // Date start - Date end
+ print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").' ';
+ $start = dol_print_date($object->date_start, 'dayhour');
+ print ($start ? $start : '?');
+ $end = dol_print_date($object->date_end, 'dayhour');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($object->hasDelay()) {
+ print img_warning("Late");
+ }
+ print ' ';
+
+ // Planned workload
+ print ''.$langs->trans("PlannedWorkload").' ';
+ if ($object->planned_workload != '') {
+ print convertSecondToTime($object->planned_workload, 'allhourmin');
+ }
+ print ' ';
+
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($object->description);
+ print ' ';
+
+ print '
';
+ print '
';
+
+ print '
';
+
+ print '
';
+ print '
';
+
+ // Progress declared
+ print ''.$langs->trans("ProgressDeclared").' ';
+ if ($object->progress != '') {
+ print $object->progress.' %';
+ }
+ print ' ';
+
+ // Progress calculated
+ print ''.$langs->trans("ProgressCalculated").' ';
+ if ($object->planned_workload != '') {
+ $tmparray = $object->getSummaryOfTimeSpent();
+ if ($tmparray['total_duration'] > 0 && !empty($object->planned_workload)) {
+ print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %';
+ } else {
+ print '0 %';
+ }
+ } else {
+ print ''.$langs->trans("WorkloadNotDefined").' ';
+ }
+ print ' ';
+
+ // Other attributes
+ $cols = 3;
+ $parameters = array('socid'=>$socid);
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+ print '
';
+
+ print '
';
+ print '
';
+
+ print dol_get_fiche_end();
+ }
+
+
+ if ($action != 'edit') {
+ /*
+ * Actions
+ */
+
+ print '
';
+
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook)) {
+ // Modify
+ if ($user->rights->projet->creer) {
+ print '
'.$langs->trans('Modify').' ';
+ } else {
+ print '
'.$langs->trans('Modify').' ';
}
- print '
';
- print '
'; // ancre
+ // Delete
+ if ($user->rights->projet->supprimer) {
+ if (!$object->hasChildren() && !$object->hasTimeSpent()) {
+ print '
'.$langs->trans('Delete').' ';
+ } else {
+ print '
'.$langs->trans('Delete').' ';
+ }
+ } else {
+ print '
'.$langs->trans('Delete').' ';
+ }
- /*
- * Generated documents
- */
- $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
- $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = ($user->rights->projet->lire);
- $delallowed = ($user->rights->projet->creer);
-
- print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
-
- print '
';
-
- // List of actions on element
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
- $formactions = new FormActions($db);
- $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
- $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
-
- print '
';
+ print '
';
}
+
+ print '
';
+ print '
'; // ancre
+
+ /*
+ * Generated documents
+ */
+ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
+ $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
+ $genallowed = ($user->rights->projet->lire);
+ $delallowed = ($user->rights->projet->creer);
+
+ print $formfile->showdocuments('project_task', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
+
+ print '
';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
+ $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
+
+ print '
';
}
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index fa6884ee920..0c5f5dce75b 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -108,6 +108,13 @@ $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($projectstatic->table_element);
$extrafields->fetch_name_optionals_label($object->table_element);
+if ($id > 0 || $ref) {
+ $object->fetch($id, $ref);
+}
+
+restrictedArea($user, 'projet', $object->fk_project, 'projet&project');
+
+
/*
* Actions
@@ -1219,6 +1226,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as inv ON inv.rowid = il.fk_facture,";
$sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
+
if (empty($projectidforalltimes)) {
$sql .= " AND t.fk_task =".((int) $object->id);
} else {
@@ -1234,7 +1242,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$sql .= natural_search('pt.label', $search_task_label);
}
if ($search_user > 0) {
- $sql .= natural_search('t.fk_user', $search_user);
+ $sql .= natural_search('t.fk_user', $search_user, 2);
}
if ($search_valuebilled == '1') {
$sql .= ' AND t.invoice_id > 0';
@@ -1249,6 +1257,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$resql = $db->query($sql);
+
+ if (! $resql) {
+ dol_print_error($db);
+ exit;
+ }
+
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
$page = 0;
@@ -1729,12 +1743,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
}
print ' ';
- print '
fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print ' fk_task.'&action=editline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_edit();
print ' ';
print ' ';
- print '
fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print ' fk_task.'&action=deleteline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_delete('default', 'class="pictodelete paddingleft"');
print ' ';
diff --git a/htdocs/public/eventorganization/attendee_register.php b/htdocs/public/eventorganization/attendee_register.php
index 0cfdf1dabc0..db3acde4628 100644
--- a/htdocs/public/eventorganization/attendee_register.php
+++ b/htdocs/public/eventorganization/attendee_register.php
@@ -64,19 +64,21 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
global $dolibarr_main_instance_unique_id;
global $dolibarr_main_url_root;
// Init vars
$errmsg = '';
-$num = 0;
$error = 0;
$backtopage = GETPOST('backtopage', 'alpha');
$action = GETPOST('action', 'aZ09');
$email = GETPOST("email");
$societe = GETPOST("societe");
+$emailcompany = GETPOST("emailcompany");
+$note_public = GETPOST('note_public', "nohtml");
// Getting id from Post and decoding it
$type = GETPOST('type', 'aZ09');
@@ -234,7 +236,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
// If the price has been set, name is required for the invoice
if (!GETPOST("societe") && !empty(floatval($project->price_registration))) {
$error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n";
+ $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."
\n";
}
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
$error++;
@@ -269,6 +271,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$confattendee->email = $email;
$confattendee->fk_project = $project->id;
$confattendee->fk_actioncomm = $id;
+ $confattendee->note_public = $note_public;
$resultconfattendee = $confattendee->create($user);
if ($resultconfattendee < 0) {
$error++;
@@ -293,7 +296,9 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
exit;
}
- $resultfetchthirdparty = -1;
+ $resultfetchthirdparty = 0;
+
+ $genericcompanyname = $langs->trans('EventParticipant').' '.($emailcompany ? $emailcompany : $email); // Keep this label simple so we can retreive same thirdparty for another event
// Getting the thirdparty or creating it
$thirdparty = new Societe($db);
@@ -303,45 +308,104 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc);
} else {
if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) {
- // Fetch using the input field by user if we just created the attendee
- if (!empty($societe)) {
- $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
- if ($resultfetchthirdparty <= 0) {
- // Try to find the thirdparty from the contact
- $resultfetchcontact = $contact->fetch('', null, '', $email);
- if ($resultfetchcontact <= 0 || $contact->fk_soc <= 0) {
- // Need to create a new one (not found or multiple with the same name/email)
- $resultfetchthirdparty = 0;
- } else {
- $thirdparty->fetch($contact->fk_soc);
- $confattendee->fk_soc = $thirdparty->id;
- $confattendee->update($user);
- $resultfetchthirdparty = 1;
- }
- } else {
- // We found a unique result with that name/email, so we set the fk_soc of attendee
+ // Fetch using the field input by end user if we have just created the attendee
+ if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($emailcompany)) {
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $emailcompany);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with the name + emailcompany, so we set the fk_soc of attendee
$confattendee->fk_soc = $thirdparty->id;
$confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
+ }
+ }
+ // Fetch using the field input by end user if we have just created the attendee
+ if ($resultfetchthirdparty <= 0 && !empty($societe) && !empty($email) && $email != $emailcompany) {
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with the name + email, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($emailcompany)) {
+ // Try to find thirdparty from the email only
+ $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $emailcompany);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that email only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($email) && $email != $emailcompany) {
+ // Try to find thirdparty from the email only
+ $resultfetchthirdparty = $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that email only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithEmailContactUs", $mysoc->email);
+ }
+ }
+ if ($resultfetchthirdparty <= 0 && !empty($genericcompanyname)) {
+ // Try to find thirdparty from the generic mail only
+ $resultfetchthirdparty = $thirdparty->fetch('', $genericcompanyname, '', '', '', '', '', '', '', '', '');
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that name + email, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = $langs->trans("ErrorSeveralCompaniesWithNameContactUs", $mysoc->email);
+ }
+ }
+
+ // TODO Add more tests on a VAT number, profid or a name ?
+
+ if ($resultfetchthirdparty <= 0 && !empty($email)) {
+ // Try to find the thirdparty from the contact
+ $resultfetchcontact = $contact->fetch('', null, '', $email);
+ if ($resultfetchcontact > 0 && $contact->fk_soc > 0) {
+ $thirdparty->fetch($contact->fk_soc);
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ $resultfetchthirdparty = 1;
+ }
+ }
+
+ if ($resultfetchthirdparty <= 0 && !empty($societe)) {
+ // Try to find thirdparty from the company name only
+ $resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', '');
+ if ($resultfetchthirdparty > 0) {
+ // We found a unique result with that name only, so we set the fk_soc of attendee
+ $confattendee->fk_soc = $thirdparty->id;
+ $confattendee->update($user);
+ } elseif ($resultfetchthirdparty == -2) {
+ $thirdparty->error = "ErrorSeveralCompaniesWithNameContactUs";
}
- } else {
- // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
- $resultfetchthirdparty = 0;
}
- } else {
- // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
- $resultfetchthirdparty = 0;
}
}
+ // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party.
+ if (empty(floatval($project->price_registration))) {
+ $resultfetchthirdparty = 1;
+ }
+
if ($resultfetchthirdparty < 0) {
+ // If an error was found
$error++;
$errmsg .= $thirdparty->error;
- } elseif ($resultfetchthirdparty == 0) {
+ } elseif ($resultfetchthirdparty == 0) { // No thirdparty found + a payment is expected
// Creation of a new thirdparty
if (!empty($societe)) {
$thirdparty->name = $societe;
} else {
- $thirdparty->name = $email;
+ $thirdparty->name = $genericcompanyname;
}
$thirdparty->address = GETPOST("address");
$thirdparty->zip = GETPOST("zipcode");
@@ -350,7 +414,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$thirdparty->fournisseur = 0;
$thirdparty->country_id = GETPOST("country_id", 'int');
$thirdparty->state_id = GETPOST("state_id", 'int');
- $thirdparty->email = $email;
+ $thirdparty->email = ($emailcompany ? $emailcompany : $email);
// Load object modCodeTiers
$module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard');
@@ -388,6 +452,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
if (!$error) {
if (!empty(floatval($project->price_registration))) {
$outputlangs = $langs;
+
// TODO Use default language of $thirdparty->default_lang to build $outputlang
// Get product to use for invoice
@@ -405,30 +470,41 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$errmsg .= $productforinvoicerow->error;
} else {
$facture = new Facture($db);
- $facture->type = Facture::TYPE_STANDARD;
- $facture->socid = $thirdparty->id;
- $facture->paye = 0;
- $facture->date = dol_now();
- $facture->cond_reglement_id = $confattendee->cond_reglement_id;
- $facture->fk_project = $project->id;
+ if (empty($confattendee->fk_invoice)) {
+ $facture->type = Facture::TYPE_STANDARD;
+ $facture->socid = $thirdparty->id;
+ $facture->paye = 0;
+ $facture->date = dol_now();
+ $facture->cond_reglement_id = $confattendee->cond_reglement_id;
+ $facture->fk_project = $project->id;
+ $facture->status = Facture::STATUS_DRAFT;
- if (empty($facture->cond_reglement_id)) {
- $paymenttermstatic = new PaymentTerm($confattendee->db);
- $facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
if (empty($facture->cond_reglement_id)) {
- $error++;
- $confattendee->error = 'ErrorNoPaymentTermRECEPFound';
- $confattendee->errors[] = $confattendee->error;
+ $paymenttermstatic = new PaymentTerm($confattendee->db);
+ $facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
+ if (empty($facture->cond_reglement_id)) {
+ $error++;
+ $confattendee->error = 'ErrorNoPaymentTermRECEPFound';
+ $confattendee->errors[] = $confattendee->error;
+ }
+ }
+ $resultfacture = $facture->create($user);
+ if ($resultfacture <= 0) {
+ $confattendee->error = $facture->error;
+ $confattendee->errors = $facture->errors;
+ $error++;
+ } else {
+ $confattendee->fk_invoice = $resultfacture;
+ $confattendee->update($user);
}
- }
- $resultfacture = $facture->create($user);
- if ($resultfacture <= 0) {
- $confattendee->error = $facture->error;
- $confattendee->errors = $facture->errors;
- $error++;
} else {
- $facture->add_object_linked($confattendee->element, $confattendee->id);
+ $facture->fetch($confattendee->fk_invoice);
}
+
+ // Add link between invoice and the attendee registration
+ /*if (!$error) {
+ $facture->add_object_linked($confattendee->element, $confattendee->id);
+ }*/
}
if (!$error) {
@@ -610,7 +686,10 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print '
' . "\n";
// Email
- print '' . $langs->trans("Email") . '* ' . "\n";
+ print '' . $langs->trans("EmailAttendee") . '* ';
+ print img_picto('', 'email', 'class="pictofixedwidth"');
+ print ' ' . "\n";
+
// Company
print '' . $langs->trans("Company");
if (!empty(floatval($project->price_registration))) {
@@ -619,15 +698,25 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print ' ';
print img_picto('', 'company', 'class="pictofixedwidth"');
print ' ' . "\n";
+
+ // Email company for invoice
+ if ($project->price_registration) {
+ print '' . $langs->trans("EmailCompanyForInvoice") . ' ';
+ print img_picto('', 'email', 'class="pictofixedwidth"');
+ print ' ' . "\n";
+ }
+
// Address
print '' . $langs->trans("Address") . ' ' . "\n";
- print '' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . ' ' . "\n";
+ print '' . dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1) . ' ' . "\n";
+
// Zip / Town
print '' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ' ';
print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
print ' / ';
print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
print ' ';
+
// Country
print '' . $langs->trans('Country') . '* ';
print img_picto('', 'country', 'class="pictofixedwidth"');
@@ -666,6 +755,14 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print ' ';
}
+ $notetoshow = $note_public;
+ print '' . $langs->trans('Note') . ' ';
+ if (!empty($conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION)) {
+ $notetoshow = str_replace('\n', "\n", $conf->global->EVENTORGANIZATION_DEFAULT_NOTE_ON_REGISTRATION);
+ }
+ print ''.dol_escape_htmltag($notetoshow, 0, 1).' ';
+ print ' ';
+
print "
\n";
print dol_get_fiche_end();
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index d7bf9b3d565..059042399a2 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -115,6 +115,8 @@ if (!$action) {
if ($source == 'organizedeventregistration') {
// Finding the Attendee
+ $attendee = new ConferenceOrBoothAttendee($db);
+
$invoiceid = GETPOST('ref', 'int');
$invoice = new Facture($db);
@@ -123,14 +125,28 @@ if ($source == 'organizedeventregistration') {
if ($resultinvoice <= 0) {
setEventMessages(null, $invoice->errors, "errors");
} else {
+ /*
+ $attendeeid = 0;
+
$invoice->fetchObjectLinked();
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
if (is_array($linkedAttendees)) {
$linkedAttendees = array_values($linkedAttendees);
+ $attendeeid = $linkedAttendees[0];
+ }*/
+ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee";
+ $sql .= " WHERE fk_invoice = ".((int) $invoiceid);
+ $resql = $db->query($sql);
+ if ($resql) {
+ $obj = $db->fetch_object($resql);
+ if ($obj) {
+ $attendeeid = $obj->rowid;
+ }
+ }
- $attendee = new ConferenceOrBoothAttendee($db);
- $resultattendee = $attendee->fetch($linkedAttendees[0]);
+ if ($attendeeid > 0) {
+ $resultattendee = $attendee->fetch($attendeeid);
if ($resultattendee <= 0) {
setEventMessages(null, $attendee->errors, "errors");
@@ -1840,7 +1856,7 @@ if ($source == 'organizedeventregistration') {
print ''."\n";
if (! is_object($attendee->project)) {
- $text = 'ErrorProjectotFound';
+ $text = 'ErrorProjectNotFound';
} else {
$text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
}
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 20a5239153a..70a684f5932 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -1037,7 +1037,7 @@ if ($ispaymentok) {
}
// TODO send email with acknowledgment for the donation
- // (need that the donation module can gen a pdf document for the cerfa with pre filled content)
+ // (we need first that the donation module is able to generate a pdf document for the cerfa with pre filled content)
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
// Record payment for registration to an event for an attendee
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 3317288a4e1..fbb9d246431 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1317,7 +1317,7 @@ if ($action == 'create') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -1920,10 +1920,10 @@ if ($action == 'create') {
} elseif ($object->statut == Reception::STATUS_DRAFT) {
// edit-delete buttons
print '
';
- print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().' ';
+ print 'id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().' ';
print ' ';
print '
';
- print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
+ print 'id.'&action=deleteline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_delete().' ';
print ' ';
// Display lines extrafields
@@ -1990,9 +1990,9 @@ if ($action == 'create') {
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Reception::STATUS_CLOSED && $user->rights->reception->creer) {
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
- print '
id.'&action=reopen">'.$langs->trans("ClassifyUnbilled").' ';
+ print '
id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").' ';
} else {
- print '
id.'&action=reopen">'.$langs->trans("ReOpen").' ';
+ print '
id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").' ';
}
}
@@ -2026,12 +2026,12 @@ if ($action == 'create') {
$label = "ClassifyBilled";
$paramaction = 'classifybilled';
}
- print '
id.'&action='.$paramaction.'">'.$langs->trans($label).' ';
+ print '
id.'&action='.$paramaction.'">'.$langs->trans($label).' ';
}
}
if ($user->rights->reception->supprimer) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").' ';
}
}
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index ddc28c72896..498b67d1593 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index 76eb78b856a..b7f3f577ce2 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -579,43 +579,43 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($sall) {
- $param .= "&sall=".urlencode($sall);
+ $param .= "&sall=".urlencode($sall);
}
if ($search_ref_rcp) {
- $param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
+ $param .= "&search_ref_rcp=".urlencode($search_ref_rcp);
}
if ($search_ref_liv) {
- $param .= "&search_ref_liv=".urlencode($search_ref_liv);
+ $param .= "&search_ref_liv=".urlencode($search_ref_liv);
}
if ($search_company) {
- $param .= "&search_company=".urlencode($search_company);
+ $param .= "&search_company=".urlencode($search_company);
}
if ($optioncss != '') {
- $param .= '&optioncss='.urlencode($optioncss);
+ $param .= '&optioncss='.urlencode($optioncss);
}
if ($search_billed != '' && $search_billed >= 0) {
- $param .= "&search_billed=".urlencode($search_billed);
+ $param .= "&search_billed=".urlencode($search_billed);
}
if ($search_town) {
- $param .= "&search_town=".urlencode($search_town);
+ $param .= "&search_town=".urlencode($search_town);
}
if ($search_zip) {
- $param .= "&search_zip=".urlencode($search_zip);
+ $param .= "&search_zip=".urlencode($search_zip);
}
if ($search_state) {
- $param .= "&search_state=".urlencode($search_state);
+ $param .= "&search_state=".urlencode($search_state);
}
if ($search_status != '') {
- $param .= "&search_status=".urlencode($search_status);
+ $param .= "&search_status=".urlencode($search_status);
}
if ($search_country) {
- $param .= "&search_country=".urlencode($search_country);
+ $param .= "&search_country=".urlencode($search_country);
}
if ($search_type_thirdparty) {
- $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
+ $param .= "&search_type_thirdparty=".urlencode($search_type_thirdparty);
}
if ($search_ref_supplier) {
- $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
+ $param .= "&search_ref_supplier=".urlencode($search_ref_supplier);
}
// Add $param from extra fields
foreach ($search_array_options as $key => $val) {
@@ -891,7 +891,7 @@ while ($i < min($num, $limit)) {
// Ref
if (!empty($arrayfields['e.ref']['checked'])) {
- print "
";
+ print ' ';
print $reception->getNomUrl(1);
$filename = dol_sanitizeFileName($reception->ref);
$filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref);
@@ -904,10 +904,10 @@ while ($i < min($num, $limit)) {
}
}
- // Ref customer
+ // Ref supplier
if (!empty($arrayfields['e.ref_supplier']['checked'])) {
- print " ";
- print $obj->ref_supplier;
+ print ' ';
+ print dol_escape_htmltag($obj->ref_supplier);
print " \n";
if (!$i) {
$totalarray['nbfield']++;
@@ -916,7 +916,7 @@ while ($i < min($num, $limit)) {
// Third party
if (!empty($arrayfields['s.nom']['checked'])) {
- print '
';
+ print ' ';
print $companystatic->getNomUrl(1);
print ' ';
if (!$i) {
@@ -925,8 +925,8 @@ while ($i < min($num, $limit)) {
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
- print '
';
- print $obj->town;
+ print ' ';
+ print dol_escape_htmltag($obj->town);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -934,8 +934,8 @@ while ($i < min($num, $limit)) {
}
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
- print '
';
- print $obj->zip;
+ print ' ';
+ print dol_escape_htmltag($obj->zip);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
@@ -943,7 +943,7 @@ while ($i < min($num, $limit)) {
}
// State
if (!empty($arrayfields['state.nom']['checked'])) {
- print "
".$obj->state_name." \n";
+ print "
".dol_escape_htmltag($obj->state_name)." \n";
if (!$i) {
$totalarray['nbfield']++;
}
@@ -952,7 +952,7 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '
';
$tmparray = getCountry($obj->fk_pays, 'all');
- print $tmparray['label'];
+ print dol_escape_htmltag($tmparray['label']);
print ' ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index bbf2c80be2f..a75dd432082 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -129,7 +129,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if (0) { // Do not change on reception
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php
index 39a5a24347d..41ebc02747f 100644
--- a/htdocs/reception/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php
@@ -69,7 +69,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
// For now, receptions must stay linked to order, so link is not deletable
if ($object->element != 'order_supplier') {
?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php
index 6da39445f7f..3f71b0397a1 100644
--- a/htdocs/recruitment/admin/setup.php
+++ b/htdocs/recruitment/admin/setup.php
@@ -459,13 +459,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print '
'."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -475,9 +475,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print '
scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print '
scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php
index 2bcddf58964..9c30f0d1ccf 100644
--- a/htdocs/recruitment/admin/setup_candidatures.php
+++ b/htdocs/recruitment/admin/setup_candidatures.php
@@ -457,13 +457,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print '
'."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -473,9 +473,9 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($conf->global->$constforvar == $name) {
//print img_picto($langs->trans("Default"), 'on');
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
- print '
scandir.'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print '
scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print '
scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
index 192d1d4c526..ce96d1cd67b 100644
--- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
+++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php
@@ -36,7 +36,7 @@ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandida
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
- public $prefix = 'JOC';
+ public $prefix = 'JOA';
/**
* @var string Error code (or message)
diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php
index 01ac72065ea..79795472b4e 100644
--- a/htdocs/recruitment/recruitmentcandidature_agenda.php
+++ b/htdocs/recruitment/recruitmentcandidature_agenda.php
@@ -186,7 +186,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php
index db51171a04a..4e6390314f5 100644
--- a/htdocs/recruitment/recruitmentcandidature_card.php
+++ b/htdocs/recruitment/recruitmentcandidature_card.php
@@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= '
'.$langs->trans('Project') . ' ';
if ($permissiontoadd)
{
- //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -567,7 +567,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->status == $object::STATUS_DRAFT) {
if ($permissiontoadd) {
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
- print '
'.$langs->trans("Validate").' ';
+ print '
'.$langs->trans("Validate").' ';
} else {
$langs->load("errors");
print '
'.$langs->trans("Validate").' ';
@@ -620,7 +620,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
} else {
print '
'.$langs->trans('Delete').' '."\n";
}
diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php
index 2e8c29cf2fe..dcd29c88118 100644
--- a/htdocs/recruitment/recruitmentcandidature_document.php
+++ b/htdocs/recruitment/recruitmentcandidature_document.php
@@ -167,7 +167,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php
index 70b5366aec7..d2315b1f756 100644
--- a/htdocs/recruitment/recruitmentcandidature_list.php
+++ b/htdocs/recruitment/recruitmentcandidature_list.php
@@ -338,7 +338,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id);
exit;
}
diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php
index 19808ca1b59..ead2df3c973 100644
--- a/htdocs/recruitment/recruitmentcandidature_note.php
+++ b/htdocs/recruitment/recruitmentcandidature_note.php
@@ -140,7 +140,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php
index 253bf2a7e0c..4c3e642a224 100644
--- a/htdocs/recruitment/recruitmentjobposition_agenda.php
+++ b/htdocs/recruitment/recruitmentjobposition_agenda.php
@@ -184,7 +184,7 @@ if ($object->id > 0) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php
index e5740fb203c..4295ce73284 100644
--- a/htdocs/recruitment/recruitmentjobposition_applications.php
+++ b/htdocs/recruitment/recruitmentjobposition_applications.php
@@ -148,14 +148,14 @@ if ($reshook < 0) {
if (empty($reshook)) {
$error = 0;
- $backurlforlist = dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1);
+ $backurlforlist = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_list.php';
if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -352,7 +352,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php
index e2a848e9760..89124068ce2 100644
--- a/htdocs/recruitment/recruitmentjobposition_card.php
+++ b/htdocs/recruitment/recruitmentjobposition_card.php
@@ -379,7 +379,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
@@ -466,7 +466,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->status == $object::STATUS_DRAFT) {
if ($permissiontoadd) {
if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
- print '
'.$langs->trans("Validate").' ';
+ print '
'.$langs->trans("Validate").' ';
} else {
$langs->load("errors");
print '
'.$langs->trans("Validate").' ';
@@ -505,7 +505,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
} else {
print '
'.$langs->trans('Delete').' '."\n";
}
diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php
index 43d80901f3d..14355aeb0e3 100644
--- a/htdocs/recruitment/recruitmentjobposition_document.php
+++ b/htdocs/recruitment/recruitmentjobposition_document.php
@@ -165,7 +165,7 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php
index 8f45caed040..0544cdb160f 100644
--- a/htdocs/recruitment/recruitmentjobposition_list.php
+++ b/htdocs/recruitment/recruitmentjobposition_list.php
@@ -359,7 +359,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentjobposition_card.php?id='.$id);
exit;
}
diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php
index dc7cdaef4ae..2645980f7bb 100644
--- a/htdocs/recruitment/recruitmentjobposition_note.php
+++ b/htdocs/recruitment/recruitmentjobposition_note.php
@@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $langs->trans('Project').' ';
if ($permissiontoadd) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index 88b3d0fdb03..649d69d7fb5 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -347,7 +347,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) {
// Delete resource
if ($user->rights->resource->delete) {
print '
';
}
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 7020beced48..a0f80d7b27c 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -974,7 +974,7 @@ class Dolresource extends CommonObject
$linkstart = '
';
$linkend = ' ';
- /*$linkstart = '
';
+ /*$linkstart = ' ';
$linkend = ' ';*/
$result .= $linkstart;
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 4d0736c5f64..4a51f1dfbb3 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -502,7 +502,7 @@ if (!$ret) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index 699b0ec35ba..e06f55fc523 100755
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -628,12 +628,12 @@ if ($action == 'create') {
}
}
);
-
+
} else {
alert("'.$langs->trans("FillFieldFirst").'");
}
});
-
+
})';
print '';
}
@@ -732,7 +732,7 @@ if ($id) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -977,17 +977,17 @@ if ($id) {
if ($action != 'edit') {
// Reopen
if ($object->paye && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Edit
if ($object->paye == 0 && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Emit payment
if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) {
- print "
";
+ print '
";
}
// Classify 'paid'
diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php
index e4364f6727f..d33d04c49ff 100644
--- a/htdocs/salaries/payment_salary/card.php
+++ b/htdocs/salaries/payment_salary/card.php
@@ -248,7 +248,7 @@ print '
';
if ($action == '') {
if ($user->rights->salaries->delete) {
if (!$disable_delete) {
- print '
'.$langs->trans('Delete').' ';
+ print '
'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans('Delete').' ';
}
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index b9b2046fd90..29f8d0b175d 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -391,7 +391,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) {
$disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
print '
';
if (!$disabled) {
- print '';
+ print ' ';
}
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) {
@@ -468,7 +468,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) {
print img_picto($langs->trans("Activated"), 'switch_on');
print ' ';
} else {
- print '
';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) {
print "
\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
//}
@@ -576,7 +576,7 @@ foreach ($dirsociete as $dirroot) {
print " ";
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
}
diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
index 8169a6ca22f..7dfe7c212f2 100644
--- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
@@ -267,7 +267,7 @@ for ($i = 1; $i <= 4; $i++) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
-
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
index f058d38cd7c..86c7d9c9f65 100644
--- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
@@ -194,7 +194,7 @@ if ($this->control->tpl['action_delete']) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
-
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 96142f65cd6..a155f08e529 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2942,7 +2942,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
print '
'.$langs->trans('Delete').' '."\n";
} else {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
}
}
}
diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php
index 1f11e6a29c3..9574544a11a 100644
--- a/htdocs/societe/class/companypaymentmode.class.php
+++ b/htdocs/societe/class/companypaymentmode.class.php
@@ -394,7 +394,7 @@ class CompanyPaymentMode extends CommonObject
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/monmodule/companypaymentmode_card.php', 1).'?id='.$this->id;
+ $url = '';
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 4110e59d4de..8f0e2c84805 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2581,7 +2581,7 @@ class Societe extends CommonObject
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
}
}
- $label .= '
'.$langs->trans('Email').': '.$this->email;
+ $label .= '
'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
if (!empty($this->phone) || !empty($this->fax)) {
$phonelist = array();
if ($this->phone) {
@@ -2590,7 +2590,7 @@ class Societe extends CommonObject
if ($this->fax) {
$phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax');
}
- $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist);
+ $label .= '
'.implode(' ', $phonelist);
}
if (!empty($this->address)) {
$label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index 8fbbbbcee6e..f73c460b4a4 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -392,7 +392,7 @@ class SocieteAccount extends CommonObject
$label .= '
'.$langs->trans('Login').': '.$this->ref;
//$label.= '
' . $langs->trans('WebSite') . ': ' . $this->ref;
- $url = dol_buildpath('/website/websiteaccount_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index ca4793c2c60..bc786a540d6 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1639,7 +1639,7 @@ while ($i < min($num, $limit)) {
$titlealt = $val['label'];
}
if ($obj->stcomm_id != $val['id']) {
- print '
rowid.'&stcomm='.$val['code'].'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
+ print '
rowid.'&stcomm='.urlencode($val['code']).'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
}
}
print '
';
diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php
index 295fe8b2075..85223e856f3 100644
--- a/htdocs/societe/partnership.php
+++ b/htdocs/societe/partnership.php
@@ -132,7 +132,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
if (empty($reshook)) {
$error = 0;
- $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/partnership/partnership.php?id='.($id > 0 ? $id : '__ID__');
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index da4ca1c0cd7..dbb0e8f0553 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -620,11 +620,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print img_info();
print '';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_edit('default', 0, 'style="vertical-align: middle;"');
print ' ';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_delete('default', 'style="vertical-align: middle;"');
print ' ';
print '';
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index b00e5954e6d..bc677f29f53 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1463,7 +1463,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -1848,12 +1848,12 @@ if ($action == 'create') {
// Edit
if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercancreate) {
- print '';
+ print '';
}
// ReOpen
if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $usercanclose) {
- print 'id.'&action=reopen'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
+ print '';
}
@@ -1861,7 +1861,7 @@ if ($action == 'create') {
if (empty($user->socid)) {
if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($usercansend) {
- print '';
+ print '';
} else {
print '';
}
@@ -1889,12 +1889,12 @@ if ($action == 'create') {
// Clone
if ($usercancreate) {
- print '';
+ print '';
}
// Delete
if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) {
- print 'id.'&action=delete&token='.newToken().'"';
+ print '';
}
}
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index 02a4fc51966..faa9127779c 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoedit) {
if ($action != 'classify') {
- //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 580c0f0974e..2795c006723 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -116,7 +116,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php
index 80c67871e91..7d6d72276d8 100644
--- a/htdocs/supplier_proposal/info.php
+++ b/htdocs/supplier_proposal/info.php
@@ -81,7 +81,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index c4ab85e8e20..6466c6f42cb 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
index c33c3b2ebac..d0fce33ed22 100644
--- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
@@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo price($objectlink->total_ht);
} ?>
getLibStatut(3); ?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
global->TAKEPOS_REF_ADDON == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '
';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index ed52280a8f4..858531e97a1 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -999,36 +999,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
query($sql);
-$paiementsModes = array();
-if ($resql) {
- while ($obj = $db->fetch_object($resql)) {
- $paycode = $obj->code;
- if ($paycode == 'LIQ') {
- $paycode = 'CASH';
- }
- if ($paycode == 'CHQ') {
- $paycode = 'CHEQUE';
- }
+ $resql = $db->query($sql);
+ $paiementsModes = array();
+ if ($resql) {
+ while ( $obj = $db->fetch_object($resql) ) {
+ $paycode = $obj->code;
+ if ($paycode == 'LIQ') {
+ $paycode = 'CASH';
+ }
+ if ($paycode == 'CHQ') {
+ $paycode = 'CHEQUE';
+ }
- $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
- //var_dump($constantforkey.' '.$conf->global->$constantforkey);
- if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
- array_push($paiementsModes, $obj);
+ $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
+ //var_dump($constantforkey.' '.$conf->global->$constantforkey);
+ if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
+ array_push($paiementsModes, $obj);
+ }
}
}
+
+ if (empty($paiementsModes)) {
+ $langs->load('errors');
+ setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
+ setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
+ }
}
-if (empty($paiementsModes)) {
- $langs->load('errors');
- setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
- setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
-}
if (count($maincategories) == 0) {
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
$tmpcategory = new Categorie($db);
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 520fe8dccdb..ae12665e008 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) {
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
$bankaccount = GETPOST('accountid', 'int');
} else {
- if ($pay == "cash") {
+ if ($pay == 'LIQ') {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "card") {
- $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "cheque") {
+ } elseif ($pay == "CHQ") {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
} else {
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 773118e670f..51744ce0528 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -330,23 +330,20 @@ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
} else {
print '
'.$langs->trans("NoPaimementModesDefined").' ';
}
@@ -359,23 +356,20 @@ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
} else {
$button = array_pop($action_buttons);
print '
'.$button["text"].' ';
@@ -389,23 +383,20 @@ print '
'.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
+ print '
'.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
} else {
$button = array_pop($action_buttons);
print '
'.$button["text"].' ';
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index fee91e959aa..9acf76b30c2 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -190,7 +190,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -217,7 +217,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
';
-$linkback = ' '.$langs->trans("BackToList").' ';
+$linkback = '
'.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index e7a00699733..f91fe4f01b3 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -532,7 +532,7 @@ if (empty($reshook)) {
}
}
- if ($action == 'setsubject') {
+ if ($action == 'setsubject' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'))) {
if ($action == 'setsubject') {
$object->subject = GETPOST('subject', 'alphanohtml');
@@ -946,7 +946,7 @@ if ($action == 'create' || $action == 'presend') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
@@ -1340,28 +1340,28 @@ if ($action == 'create' || $action == 'presend') {
print '
';
}
if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
- print '
';
+ print '
';
}
/* This is useless. We can already modify each field individually
if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
- print '
';
+ print '
';
}
*/
// Close ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '
';
+ print '
';
}
// Abadon ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '
';
+ print '
';
}
// Re-open ticket
if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) {
- print '
';
+ print '
';
}
// Delete ticket
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index ea273064840..874036a5c38 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1344,7 +1344,7 @@ class Ticket extends CommonObject
$label .= '
'.$langs->trans('TicketTrackId').': '.$this->track_id.'
';
$label .= '
'.$langs->trans('Subject').': '.$this->subject;
- $url = dol_buildpath('/ticket/card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/ticket/card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index 8d450ffb44b..dbd553f9c1f 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -52,7 +52,7 @@ $lineid = GETPOST('lineid', 'int');
// Store current page url
-$url_page_current = dol_buildpath('/ticket/contact.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/contact.php';
$object = new Ticket($db);
@@ -192,7 +192,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index d534e8a1123..8b45b8ebbf7 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -161,7 +161,7 @@ if ($object->id) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 4b048d54671..aeab9ac6e27 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -159,7 +159,7 @@ if (!$user->rights->ticket->read) {
}
// Store current page url
-$url_page_current = dol_buildpath('/ticket/list.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/list.php';
if ($project_ref) {
$tmpproject = new Project($db);
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index 68615424abf..365376f0add 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -188,7 +188,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -215,7 +215,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
';
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
@@ -248,7 +248,7 @@ if (!empty($object->id)) {
// Show link to add event (if read and not closed)
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
- $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
+ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
index 17da4cd2db5..51c2cbfb7fd 100644
--- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
@@ -65,7 +65,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
?>
- id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+ id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 649b8b55502..2dbc2a3f020 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -663,26 +663,103 @@ class User extends CommonObject
* You can use it like this: if ($user->hasRight('module', 'level11')).
* It replaces old syntax: if ($user->rights->module->level1)
*
- * @param int $module Id of permission to add or 0 to add several permissions
- * @param string $permlevel1 Permission level1
+ * @param int $module Module of permission to check
+ * @param string $permlevel1 Permission level1 (Example: 'read', 'write', 'delete')
* @param string $permlevel2 Permission level2
* @return int 1 if user has permission, 0 if not.
* @see clearrights(), delrights(), getrights(), hasRight()
*/
public function hasRight($module, $permlevel1, $permlevel2 = '')
{
+ global $conf;
+
+ // For compatibility with bad naming permissions on module
+ $moduletomoduletouse = array(
+ 'contract' => 'contrat',
+ 'member' => 'adherent', // We must check $user->rights->adherent...
+ 'mo' => 'mrp',
+ 'order' => 'commande',
+ 'product' => 'produit', // We must check $user->rights->produit...
+ 'project' => 'projet',
+ 'shipping' => 'expedition',
+ 'task' => 'task@projet',
+ 'fichinter' => 'ficheinter',
+ 'invoice' => 'facture',
+ 'invoice_supplier' => 'fournisseur',
+ 'knowledgerecord' => 'knowledgerecord@knowledgemanagement'
+ );
+ if (!empty($moduletomoduletouse[$module])) {
+ $module = $moduletomoduletouse[$module];
+ }
+
+ // If module is abc@module, we check permission user->rights->module->abc->permlevel1
+ $tmp = explode('@', $module, 2);
+ if (! empty($tmp[1])) {
+ $module = $tmp[1];
+ $permlevel2 = $permlevel1;
+ $permlevel1 = $tmp[0];
+ }
+
+ //var_dump($module);
+ //var_dump($this->rights->$module);
+ if (!in_array($module, $conf->modules)) {
+ return 0;
+ }
+
+ // For compatibility with bad naming permissions on permlevel1
+ if ($permlevel1 == 'propale') {
+ $permlevel1 = 'propal';
+ }
+ if ($permlevel1 == 'member') {
+ $permlevel1 = 'adherent';
+ }
+ if ($permlevel1 == 'recruitmentcandidature') {
+ $permlevel1 = 'recruitmentjobposition';
+ }
+
+ //var_dump($module.' '.$permlevel1.' '.$permlevel2);
if (empty($module) || empty($this->rights) || empty($this->rights->$module) || empty($permlevel1)) {
return 0;
}
if ($permlevel2) {
- if (!empty($this->rights->$module->$permlevel1) && !empty($this->rights->$module->$permlevel1->$permlevel2)) {
- return $this->rights->$module->$permlevel1->$permlevel2;
+ if (!empty($this->rights->$module->$permlevel1)) {
+ if (!empty($this->rights->$module->$permlevel1->$permlevel2)) {
+ return $this->rights->$module->$permlevel1->$permlevel2;
+ }
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel2 == 'read' && !empty($this->rights->$module->$permlevel1->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'delete' && !empty($this->rights->$module->$permlevel1->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
} else {
if (!empty($this->rights->$module->$permlevel1)) {
return $this->rights->$module->$permlevel1;
}
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel1 == 'read' && !empty($this->rights->$module->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'delete' && !empty($this->rights->$module->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
return 0;
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 186d8463549..4fb9c51644f 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -96,7 +96,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/user/group/card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -380,11 +380,11 @@ if ($action == 'create') {
}
if ($caneditperms) {
- print ''.$langs->trans("Modify").' ';
+ print ''.$langs->trans("Modify").' ';
}
if ($candisableperms) {
- print ''.$langs->trans("DeleteGroup").' ';
+ print ''.$langs->trans("DeleteGroup").' ';
}
print "\n";
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index e2c419b0543..46506163c1f 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -332,7 +332,7 @@ if ($object->id > 0) {
if (in_array($obj->id, $permsgroupbyentity[$entity])) {
// Own permission by group
if ($caneditperms) {
- print 'id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' ';
@@ -343,7 +343,7 @@ if ($object->id > 0) {
} else {
// Do not own permission
if ($caneditperms) {
- print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=addrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' ';
diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php
index 5ff285972df..48cbad46799 100644
--- a/htdocs/user/notify/card.php
+++ b/htdocs/user/notify/card.php
@@ -337,7 +337,7 @@ if ($result > 0) {
print $langs->trans("SMS");
}
print '';
- print ''.img_delete().' ';
+ print ''.img_delete().' ';
print '';
$i++;
}
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 391682b2d6d..7c7fe868b2f 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -279,9 +279,9 @@ print ''.$langs->trans("Module").' ';
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
print '';
- print 'id.'&action=addrights&entity='.$entity.'&module=allmodules&confirm=yes&token='.newToken().'">'.$langs->trans("All")." ";
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("All")." ";
print ' / ';
- print 'id.'&action=delrights&entity='.$entity.'&module=allmodules&confirm=yes&token='.newToken().'">'.$langs->trans("None")." ";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module=allmodules&confirm=yes">'.$langs->trans("None")." ";
print ' ';
}
print ' ';
@@ -359,9 +359,9 @@ if ($result) {
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
print '';
- print 'id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'&confirm=yes&token='.newToken().'">'.$langs->trans("All")." ";
+ print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("All")." ";
print ' / ';
- print 'id.'&action=delrights&entity='.$entity.'&module='.$obj->module.'&confirm=yes&token='.newToken().'">'.$langs->trans("None")." ";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("None")." ";
print ' ';
}
print ' ';
@@ -399,7 +399,7 @@ if ($result) {
print '';
} elseif (in_array($obj->id, $permsuser)) { // Permission granted by user
if ($caneditperms) {
- print 'id.'&action=delrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' ';
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index c29fc519258..a3ad036ca9a 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -888,7 +888,7 @@ if (!empty($id) || !empty($ref)) {
print ''.$prodstatic->getLibStatut(2, 0).' ';
print ''.$prodstatic->getLibStatut(2, 1).' ';
print '';
- print 'id.'">'.img_edit().' ';
+ print 'id.'">'.img_edit().' ';
print 'id.'">'.img_delete().' ';
print ' ';
print '';
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 5d941d0564b..62b024047e4 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -3123,7 +3123,7 @@ if (!GETPOST('hide_websitemenu')) {
print ''; // end websitetools
print '';
- if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
+ if ($action == 'editsource' || $action == 'editcontent' || GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) {
$url = 'https://wiki.dolibarr.org/index.php/Module_Website';
$htmltext = $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url);
diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php
index 398affc8cb2..ac035127f14 100644
--- a/htdocs/website/websiteaccount_card.php
+++ b/htdocs/website/websiteaccount_card.php
@@ -230,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($action != 'classify')
{
- $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='';
@@ -344,7 +344,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'websiteaccount', $socid, 1, '', $MAXEVENT);
+ $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT);
*/
print '';
diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php
index 682431d7c8a..a3204e76459 100755
--- a/htdocs/workstation/workstation_agenda.php
+++ b/htdocs/workstation/workstation_agenda.php
@@ -154,7 +154,7 @@ if ($object->id > 0) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php
index 0cf0f628492..8bf2dc48e2d 100755
--- a/htdocs/workstation/workstation_card.php
+++ b/htdocs/workstation/workstation_card.php
@@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project') . ' ';
if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
if ($action == 'classify') {
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php
index b33be2818dc..7c5d654a7d9 100755
--- a/htdocs/workstation/workstation_document.php
+++ b/htdocs/workstation/workstation_document.php
@@ -118,7 +118,7 @@ if ($object->id) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
@@ -135,7 +135,7 @@ if ($object->id) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php
index b395c5e5a1b..b5a27aeb1e2 100755
--- a/htdocs/workstation/workstation_list.php
+++ b/htdocs/workstation/workstation_list.php
@@ -345,7 +345,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/workstation/workstation_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/workstation/workstation_card.php?id='.$id);
exit;
}
diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php
index 7e1b765bf82..ebe8d99af16 100755
--- a/htdocs/workstation/workstation_note.php
+++ b/htdocs/workstation/workstation_note.php
@@ -96,7 +96,7 @@ if ($id > 0 || !empty($ref)) {
// Object card
// ------------------------------------------------------------
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '
'.$langs->trans("BackToList").' ';
$morehtmlref = '
';
/*
@@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) {
if ($permissiontoadd)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php
index b27959a24c6..5d0155885c2 100644
--- a/htdocs/zapier/class/hook.class.php
+++ b/htdocs/zapier/class/hook.class.php
@@ -516,7 +516,7 @@ class Hook extends CommonObject
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/zapier/hook_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/zapier/hook_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not