dolibarr  16.0.5
opensurveysondage.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
4  * Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
27 // Put here all includes required by your class file
28 require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
29 //require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
30 //require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
31 
32 
37 {
41  public $element = 'opensurvey_sondage';
42 
46  public $table_element = 'opensurvey_sondage';
47 
51  public $picto = 'poll';
52 
56  public $id_sondage;
57 
61  public $description;
62 
66  public $mail_admin;
67 
71  public $nom_admin;
72 
77  public $fk_user_creat;
78 
82  public $title;
83 
84  public $date_fin = '';
85 
89  public $status = 1;
90 
94  public $format;
95 
99  public $mailsonde;
100 
104  public $sujet;
105 
109  public $allow_comments;
110 
114  public $allow_spy;
115 
116 
120  const STATUS_DRAFT = 0;
124  const STATUS_VALIDATED = 1;
128  const STATUS_CLOSED = 2;
129 
130 
136  public function __construct($db)
137  {
138  $this->db = $db;
139  }
140 
141 
149  public function create(User $user, $notrigger = 0)
150  {
151  global $conf;
152 
153  $error = 0;
154 
155  // Clean parameters
156  $this->cleanParameters();
157 
158  // Check parameters
159  if (!$this->date_fin > 0) {
160  $this->error = 'BadValueForEndDate';
161  dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
162  return -1;
163  }
164 
165  // Insert request
166  $sql = "INSERT INTO ".MAIN_DB_PREFIX."opensurvey_sondage(";
167  $sql .= "id_sondage,";
168  $sql .= "commentaires,";
169  $sql .= "fk_user_creat,";
170  $sql .= "titre,";
171  $sql .= "date_fin,";
172  $sql .= "status,";
173  $sql .= "format,";
174  $sql .= "mailsonde,";
175  $sql .= "allow_comments,";
176  $sql .= "allow_spy,";
177  $sql .= "sujet,";
178  $sql .= "entity";
179  $sql .= ") VALUES (";
180  $sql .= "'".$this->db->escape($this->id_sondage)."',";
181  $sql .= " ".(empty($this->description) ? 'NULL' : "'".$this->db->escape($this->description)."'").",";
182  $sql .= " ".(int) $user->id.",";
183  $sql .= " '".$this->db->escape($this->title)."',";
184  $sql .= " '".$this->db->idate($this->date_fin)."',";
185  $sql .= " ".(int) $this->status.",";
186  $sql .= " '".$this->db->escape($this->format)."',";
187  $sql .= " ".((int) $this->mailsonde).",";
188  $sql .= " ".((int) $this->allow_comments).",";
189  $sql .= " ".((int) $this->allow_spy).",";
190  $sql .= " '".$this->db->escape($this->sujet)."',";
191  $sql .= " ".((int) $conf->entity);
192  $sql .= ")";
193 
194  $this->db->begin();
195 
196  dol_syslog(get_class($this)."::create", LOG_DEBUG);
197  $resql = $this->db->query($sql);
198  if (!$resql) {
199  $error++; $this->errors[] = "Error ".$this->db->lasterror();
200  }
201 
202  if (!$error && !$notrigger) {
203  global $langs, $conf;
204 
205  // Call trigger
206  $result = $this->call_trigger('OPENSURVEY_CREATE', $user);
207  if ($result < 0) {
208  $error++;
209  }
210  // End call triggers
211  }
212 
213  // Commit or rollback
214  if ($error) {
215  foreach ($this->errors as $errmsg) {
216  dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
217  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
218  }
219  $this->db->rollback();
220  return -1 * $error;
221  } else {
222  $this->db->commit();
223  return $this->id;
224  }
225  }
226 
227 
235  public function fetch($id, $numsurvey = '')
236  {
237  $sql = "SELECT";
238  $sql .= " t.id_sondage,";
239  $sql .= " t.titre as title,";
240  $sql .= " t.commentaires as description,";
241  $sql .= " t.mail_admin,";
242  $sql .= " t.nom_admin,";
243  $sql .= " t.fk_user_creat,";
244  $sql .= " t.date_fin,";
245  $sql .= " t.status,";
246  $sql .= " t.format,";
247  $sql .= " t.mailsonde,";
248  $sql .= " t.allow_comments,";
249  $sql .= " t.allow_spy,";
250  $sql .= " t.sujet,";
251  $sql .= " t.tms";
252  $sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as t";
253  $sql .= " WHERE t.id_sondage = '".$this->db->escape($id ? $id : $numsurvey)."'";
254 
255  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
256  $resql = $this->db->query($sql);
257  if ($resql) {
258  if ($this->db->num_rows($resql)) {
259  $obj = $this->db->fetch_object($resql);
260 
261  $this->id_sondage = $obj->id_sondage;
262  $this->ref = $this->id_sondage; //For compatibility
263 
264  $this->description = $obj->description;
265  $this->mail_admin = $obj->mail_admin;
266  $this->nom_admin = $obj->nom_admin;
267  $this->title = $obj->title;
268  $this->date_fin = $this->db->jdate($obj->date_fin);
269  $this->status = $obj->status;
270  $this->format = $obj->format;
271  $this->mailsonde = $obj->mailsonde;
272  $this->allow_comments = $obj->allow_comments;
273  $this->allow_spy = $obj->allow_spy;
274  $this->sujet = $obj->sujet;
275  $this->fk_user_creat = $obj->fk_user_creat;
276 
277  $this->date_m = $this->db->jdate($obj->tls);
278  $ret = 1;
279  } else {
280  $sondage = ($id ? 'id='.$id : 'sondageid='.$numsurvey);
281  $this->error = 'Fetch no poll found for '.$sondage;
282  dol_syslog($this->error, LOG_ERR);
283  $ret = 0;
284  }
285 
286  $this->db->free($resql);
287  } else {
288  $this->error = "Error ".$this->db->lasterror();
289  $ret = -1;
290  }
291 
292  return $ret;
293  }
294 
295 
303  public function update(User $user, $notrigger = 0)
304  {
305  global $conf, $langs;
306  $error = 0;
307 
308  // Clean parameters
309  $this->cleanParameters();
310 
311  // Check parameters
312  // Put here code to add a control on parameters values
313 
314  // Update request
315  $sql = "UPDATE ".MAIN_DB_PREFIX."opensurvey_sondage SET";
316  $sql .= " id_sondage=".(isset($this->id_sondage) ? "'".$this->db->escape($this->id_sondage)."'" : "null").",";
317  $sql .= " commentaires=".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "null").",";
318  $sql .= " mail_admin=".(isset($this->mail_admin) ? "'".$this->db->escape($this->mail_admin)."'" : "null").",";
319  $sql .= " nom_admin=".(isset($this->nom_admin) ? "'".$this->db->escape($this->nom_admin)."'" : "null").",";
320  $sql .= " titre=".(isset($this->title) ? "'".$this->db->escape($this->title)."'" : "null").",";
321  $sql .= " date_fin=".(dol_strlen($this->date_fin) != 0 ? "'".$this->db->idate($this->date_fin)."'" : 'null').",";
322  $sql .= " status=".(isset($this->status) ? "'".$this->db->escape($this->status)."'" : "null").",";
323  $sql .= " format=".(isset($this->format) ? "'".$this->db->escape($this->format)."'" : "null").",";
324  $sql .= " mailsonde=".(isset($this->mailsonde) ? ((int) $this->mailsonde) : "null").",";
325  $sql .= " allow_comments=".((int) $this->allow_comments).",";
326  $sql .= " allow_spy=".((int) $this->allow_spy);
327  $sql .= " WHERE id_sondage='".$this->db->escape($this->id_sondage)."'";
328 
329  $this->db->begin();
330 
331  dol_syslog(get_class($this)."::update", LOG_DEBUG);
332  $resql = $this->db->query($sql);
333  if (!$resql) {
334  $error++;
335  $this->errors[] = "Error ".$this->db->lasterror();
336  }
337 
338  if (!$error && !$notrigger) {
339  // Call trigger
340  $result = $this->call_trigger('OPENSURVEY_MODIFY', $user);
341  if ($result < 0) {
342  $error++;
343  }
344  // End call triggers
345  }
346 
347  // Commit or rollback
348  if ($error) {
349  foreach ($this->errors as $errmsg) {
350  dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
351  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
352  }
353  $this->db->rollback();
354  return -1 * $error;
355  } else {
356  $this->db->commit();
357  return 1;
358  }
359  }
360 
369  public function delete(User $user, $notrigger = 0, $numsondage = '')
370  {
371  global $conf, $langs;
372  $error = 0;
373 
374  if (empty($numsondage)) {
375  $numsondage = $this->id_sondage;
376  }
377 
378  $this->db->begin();
379 
380  if (!$error && !$notrigger) {
381  // Call trigger
382  $result = $this->call_trigger('OPENSURVEY_DELETE', $user);
383  if ($result < 0) {
384  $error++;
385  }
386  // End call triggers
387  }
388 
389  if (!$error) {
390  $sql = 'DELETE FROM '.MAIN_DB_PREFIX."opensurvey_comments WHERE id_sondage = '".$this->db->escape($numsondage)."'";
391  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
392  $resql = $this->db->query($sql);
393  $sql = 'DELETE FROM '.MAIN_DB_PREFIX."opensurvey_user_studs WHERE id_sondage = '".$this->db->escape($numsondage)."'";
394  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
395  $resql = $this->db->query($sql);
396 
397  $sql = "DELETE FROM ".MAIN_DB_PREFIX."opensurvey_sondage";
398  $sql .= " WHERE id_sondage = '".$this->db->escape($numsondage)."'";
399 
400  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
401  $resql = $this->db->query($sql);
402  if (!$resql) {
403  $error++; $this->errors[] = "Error ".$this->db->lasterror();
404  }
405  }
406 
407  // Commit or rollback
408  if ($error) {
409  foreach ($this->errors as $errmsg) {
410  dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
411  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
412  }
413  $this->db->rollback();
414  return -1 * $error;
415  } else {
416  $this->db->commit();
417  return 1;
418  }
419  }
420 
430  public function getNomUrl($withpicto = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
431  {
432  global $db, $conf, $langs;
433  global $dolibarr_main_authentication, $dolibarr_main_demo;
434  global $menumanager;
435 
436  if (!empty($conf->dol_no_mouse_hover)) {
437  $notooltip = 1; // Force disable tooltips
438  }
439 
440  $result = '';
441 
442  $label = img_picto('', $this->picto).' <u>'.$langs->trans("ShowSurvey").'</u>';
443  $label .= '<br>';
444  $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref.'<br>';
445  $label .= '<b>'.$langs->trans('Title').':</b> '.$this->title.'<br>';
446 
447  $url = DOL_URL_ROOT.'/opensurvey/card.php?id='.$this->id;
448 
449  // Add param to save lastsearch_values or not
450  $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
451  if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
452  $add_save_lastsearch_values = 1;
453  }
454  if ($add_save_lastsearch_values) {
455  $url .= '&save_lastsearch_values=1';
456  }
457 
458  $linkclose = '';
459  if (empty($notooltip)) {
460  if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
461  $label = $langs->trans("ShowMyObject");
462  $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
463  }
464  $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
465  $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
466  } else {
467  $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
468  }
469 
470  $linkstart = '<a href="'.$url.'"';
471  $linkstart .= $linkclose.'>';
472  $linkend = '</a>';
473 
474  $result .= $linkstart;
475  if ($withpicto) {
476  $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
477  }
478  if ($withpicto != 2) {
479  $result .= $this->ref;
480  }
481  $result .= $linkend;
482 
483  return $result;
484  }
485 
486  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
492  public function fetch_lines()
493  {
494  // phpcs:enable
495  $this->lines = array();
496 
497  $sql = "SELECT id_users, nom as name, reponses";
498  $sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
499  $sql .= " WHERE id_sondage = '".$this->db->escape($this->id_sondage)."'";
500 
501  $resql = $this->db->query($sql);
502 
503  if ($resql) {
504  $num = $this->db->num_rows($resql);
505  $i = 0;
506  while ($i < $num) {
507  $obj = $this->db->fetch_object($resql);
508  $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses);
509 
510  $this->lines[] = $tmp;
511  $i++;
512  }
513  } else {
514  dol_print_error($this->db);
515  }
516 
517  return count($this->lines);
518  }
519 
526  public function initAsSpecimen()
527  {
528  $this->id = 0;
529 
530  $this->id_sondage = 'a12d5g';
531  $this->description = 'Description of the specimen survey';
532  $this->mail_admin = 'email@email.com';
533  $this->nom_admin = 'surveyadmin';
534  $this->title = 'This is a specimen survey';
535  $this->date_fin = dol_now() + 3600 * 24 * 10;
536  $this->status = 1;
537  $this->format = 'classic';
538  $this->mailsonde = 0;
539  }
540 
546  public function getComments()
547  {
548  $comments = array();
549 
550  $sql = 'SELECT id_comment, usercomment, comment';
551  $sql .= ' FROM '.MAIN_DB_PREFIX.'opensurvey_comments';
552  $sql .= " WHERE id_sondage='".$this->db->escape($this->id_sondage)."'";
553  $sql .= " ORDER BY id_comment";
554  $resql = $this->db->query($sql);
555 
556  if ($resql) {
557  $num_rows = $this->db->num_rows($resql);
558 
559  if ($num_rows > 0) {
560  while ($obj = $this->db->fetch_object($resql)) {
561  $comments[] = $obj;
562  }
563  }
564  }
565 
566  return $comments;
567  }
568 
576  public function addComment($comment, $comment_user)
577  {
578  $sql = "INSERT INTO ".MAIN_DB_PREFIX."opensurvey_comments (id_sondage, comment, usercomment)";
579  $sql .= " VALUES ('".$this->db->escape($this->id_sondage)."','".$this->db->escape($comment)."','".$this->db->escape($comment_user)."')";
580  $resql = $this->db->query($sql);
581 
582  if (!$resql) {
583  return false;
584  }
585 
586  return true;
587  }
588 
595  public function deleteComment($id_comment)
596  {
597  $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.((int) $id_comment).' AND id_sondage = "'.$this->db->escape($this->id_sondage).'"';
598  $resql = $this->db->query($sql);
599 
600  if (!$resql) {
601  return false;
602  }
603 
604  return true;
605  }
606 
612  private function cleanParameters()
613  {
614  $this->id_sondage = trim($this->id_sondage);
615  $this->description = trim($this->description);
616  $this->mail_admin = trim($this->mail_admin);
617  $this->nom_admin = trim($this->nom_admin);
618  $this->title = trim($this->title);
619  $this->status = (int) $this->status;
620  $this->format = trim($this->format);
621  $this->mailsonde = ($this->mailsonde ? 1 : 0);
622  $this->allow_comments = ($this->allow_comments ? 1 : 0);
623  $this->allow_spy = ($this->allow_spy ? 1 : 0);
624  $this->sujet = trim($this->sujet);
625  }
626 
627 
634  public function getLibStatut($mode)
635  {
636  return $this->LibStatut($this->status, $mode);
637  }
638 
639  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
647  public function LibStatut($status, $mode)
648  {
649  // phpcs:enable
650  global $langs, $conf;
651 
652  if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
653  global $langs;
654  //$langs->load("mymodule");
655  $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
656  $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Opened');
657  $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed');
658  $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
659  $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Opened');
660  $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('Closed');
661  }
662 
663  $statusType = 'status'.$status;
664  if ($status == self::STATUS_VALIDATED) {
665  if (0) {
666  $statusType = 'status1';
667  } else {
668  $statusType = 'status4';
669  }
670  }
671  if ($status == self::STATUS_CLOSED) {
672  $statusType = 'status6';
673  }
674 
675  return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
676  }
677 
678 
684  public function countVotes()
685  {
686  $result = 0;
687 
688  $sql .= " SELECT COUNT(id_users) as nb FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
689  $sql .= " WHERE id_sondage = '".$this->db->escape($this->ref)."'";
690 
691  $resql = $this->db->query($sql);
692  if ($resql) {
693  $obj = $this->db->fetch_object($resql);
694  if ($obj) {
695  $result = $obj->nb;
696  }
697  } else {
698  $this->error = $this->db->lasterror();
699  $this->errors[] = $this->error;
700  }
701 
702  return $result;
703  }
704 }
Opensurveysondage\__construct
__construct($db)
Constructor.
Definition: opensurveysondage.class.php:136
Opensurveysondage
Put here description of your class.
Definition: opensurveysondage.class.php:36
db
$conf db
API class for accounts.
Definition: inc.php:41
description
print *****$script_file(".$version.") pid cd cd cd description as description
Definition: email_expire_services_to_customers.php:83
Opensurveysondage\STATUS_CLOSED
const STATUS_CLOSED
Closed.
Definition: opensurveysondage.class.php:128
Opensurveysondage\countVotes
countVotes()
Return number of votes done for this survey.
Definition: opensurveysondage.class.php:684
Opensurveysondage\addComment
addComment($comment, $comment_user)
Adds a comment to the poll.
Definition: opensurveysondage.class.php:576
Opensurveysondage\update
update(User $user, $notrigger=0)
Update object into database.
Definition: opensurveysondage.class.php:303
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
Opensurveysondage\LibStatut
LibStatut($status, $mode)
Return label of status.
Definition: opensurveysondage.class.php:647
Opensurveysondage\getNomUrl
getNomUrl($withpicto=0, $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionaly the picto)
Definition: opensurveysondage.class.php:430
Opensurveysondage\cleanParameters
cleanParameters()
Cleans all the class variables before doing an update or an insert.
Definition: opensurveysondage.class.php:612
Opensurveysondage\STATUS_DRAFT
const STATUS_DRAFT
Draft status (not used)
Definition: opensurveysondage.class.php:120
ref
$object ref
Definition: info.php:77
CommonObject
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Definition: commonobject.class.php:44
Opensurveysondage\getComments
getComments()
Returns all comments for the current opensurvey poll.
Definition: opensurveysondage.class.php:546
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
Opensurveysondage\fetch_lines
fetch_lines()
Return array of lines.
Definition: opensurveysondage.class.php:492
Opensurveysondage\getLibStatut
getLibStatut($mode)
Return status label of Order.
Definition: opensurveysondage.class.php:634
Opensurveysondage\STATUS_VALIDATED
const STATUS_VALIDATED
Validated/Opened status.
Definition: opensurveysondage.class.php:124
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
Opensurveysondage\deleteComment
deleteComment($id_comment)
Deletes a comment of the poll.
Definition: opensurveysondage.class.php:595
Opensurveysondage\create
create(User $user, $notrigger=0)
Create object into database.
Definition: opensurveysondage.class.php:149
Opensurveysondage\fetch
fetch($id, $numsurvey='')
Load object in memory from the database.
Definition: opensurveysondage.class.php:235
User
Class to manage Dolibarr users.
Definition: user.class.php:44
dolGetStatus
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
Definition: functions.lib.php:10338
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4211
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
CommonObject\call_trigger
call_trigger($triggerName, $user)
Call trigger based on this instance.
Definition: commonobject.class.php:5791
Opensurveysondage\initAsSpecimen
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
Definition: opensurveysondage.class.php:526