Beispiel #1
0
 public static function listAll()
 {
     $arr = parent::lister(get_class(), null, null);
     $ret = array();
     foreach ($arr as $item) {
         if (!empty($item)) {
             $ret[] = $item;
         }
     }
     return $ret;
 }
Beispiel #2
0
 public static function listAll($group = null)
 {
     return parent::lister(get_class(), null, null, "namn", null, null, null, null, $group);
 }
 public static function getMedlemFolders($medlem)
 {
     return parent::lister(get_class(), "medlem_id", $medlem->getId(), "folder_name");
 }
Beispiel #4
0
 public static function listByForetag(Foretag $foretag)
 {
     return parent::lister(get_class(), "foretag_id", $foretag->getId());
 }
Beispiel #5
0
 public static function listByKommunId($id)
 {
     return parent::lister(get_class(), "kommun_id", $id);
 }
Beispiel #6
0
 public static function listAll()
 {
     Security::demand(SUPERADMIN);
     return parent::lister(get_class());
 }
Beispiel #7
0
 public static function listAll()
 {
     return parent::lister(get_class());
 }
Beispiel #8
0
 /**
  * List all "foretag". If $showValid is true then an extra "where" parameter isValid = 1 is added.
  * It is only possible to send one or none parameter to "Mobject->lister" some trix are made here (Dr. Krillo)
  * 
  * See Mobject->lister for more details about parameters
  * 
  * Changed by krillo 20090426
  */
 public static function listForetag($offset, $limit, $field, $search, $way, $showValid = null)
 {
     $newField = "id";
     //if (DEBUG) {
     //	echo "Foretag.php->listForetag()<br>";
     //	echo "showValid = " .$showValid . "<br>";
     //	echo "field = " .$field . "<br>";
     //	echo "search = " .$search . "<br>";
     //}
     //if no params at all, add "isValid = 1" when missing or not false
     if ($field == null && $search == null && ($showValid == "true" || $showValid == null)) {
         $newField = "isValid";
         $search = 1;
         //if(DEBUG){
         // 	echo "first <br>";
         //}
     } else {
         if ($field != null && $search != null && ($showValid == "true" || $showValid == null)) {
             //trick in the extra param
             $newField = "isValid=1 and " . $field;
             //if(DEBUG){
             //	echo "second <br>";
             //}
         } else {
             $newField = $field;
             //if(DEBUG){
             //	echo "third - all fields <br>";
             //}
         }
     }
     return parent::lister(get_class(), $newField, $search, "id", $offset, $limit, $search, $way);
 }
Beispiel #9
0
 /**
  * List all orders. If $showValid is true then an extra "where" parameter isValid = 1 is added.
  * It is only possible to send one or none parameter to "Mobject->lister" some trix are made here (Dr. Krillo)
  * See Mobject->lister for more details about parameters
  * created by krillo 20090804
  */
 public static function listOrderKrillo($offset, $limit, $field, $search, $way, $showValid = null, $showForetag = false)
 {
     $newField = "id";
     $foretagString = "";
     if ($showForetag) {
         $foretagString = " typ IN ('foretag', 'foretag_tillagg', 'foretag_again' ) AND ";
     }
     switch (true) {
         //if no params at all, add "isValid = 1"
         case $field == null && $search == null && ($showValid == "true" || $showValid == null):
             $newField = "isValid";
             $search = 1;
             break;
         case $field != null && $search != null && ($showValid == "true" || $showValid == null):
             $newField = "isValid=1 and " . $field;
             //trick in the extra param
             break;
         default:
             $newField = $field;
             break;
     }
     $newField = $foretagString . $newField;
     return parent::lister(get_class(), $newField, $search, "id", $offset, $limit, $search, $way);
 }
Beispiel #10
0
 public static function loadByMedlem(Medlem $medlem)
 {
     $medlem_id = $medlem->getId();
     return parent::lister(get_class(), "medlem_id", $medlem_id, "tillagd");
 }
Beispiel #11
0
 public static function listAll()
 {
     return parent::lister(get_class(), null, null, "namn");
 }
Beispiel #12
0
 public static function listPublic()
 {
     return parent::lister(get_class(), "publik", "1");
 }
Beispiel #13
0
 public static function listByLan($lan)
 {
     $kommuner = parent::lister(get_class(), "lan", $lan, "`namn`");
     return $kommuner;
 }
Beispiel #14
0
 public static function listByQuizFraga(QuizFraga $quizFraga)
 {
     return parent::lister(get_class(), "quizFraga_id", $quizFraga->getId());
 }
Beispiel #15
0
 public static function deleteUserStrackor(Medlem $medlem, $cleared = true)
 {
     if (Security::authorized(ADMIN) or Security::authorized(USER, $medlem)) {
         if ($cleared) {
             $strackor = parent::lister(get_class(), "medlem_id", $medlem->getId());
         } else {
             $strackor;
         }
         foreach ($strackor as $stracka) {
             $stracka->delete();
         }
     }
 }
Beispiel #16
0
 public static function listMedlemmar($offset, $limit, $sort, $search, $way)
 {
     $arr = parent::lister(get_class(), $sort, null, $sort, $offset, $limit, $search, $way);
     $ret = array();
     foreach ($arr as $medlem) {
         if (!empty($medlem)) {
             $ret[] = $medlem;
         }
     }
     return $ret;
 }
Beispiel #17
0
 public static function listByKommun(Kommun $kommun)
 {
     return parent::lister(get_class(), "kommun_id", $kommun->getId(), "id");
 }
Beispiel #18
0
 public static function removeAllMemberMail(Medlem $medlem)
 {
     if (Security::authorized(ADMIN) or Security::authorized(USER, $medlem)) {
         global $db;
         $fromMail = parent::lister(get_class(), "from_id", $medlem->getId());
         foreach ($fromMail as $mail) {
             $mail->delete();
         }
         $toMail = parent::lister(get_class(), "to_id", $medlem->getId());
         foreach ($toMail as $mail) {
             $mail->delete();
         }
     }
 }
Beispiel #19
0
 public static function listAllRandom()
 {
     $list = parent::lister(get_class());
     $randlist = shuffle($list);
     return $randlist;
 }
Beispiel #20
0
 public static function loadByGroupId($gid)
 {
     return parent::lister(get_class(), "grupp_id", $gid);
 }